Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 1 | <!-- |
| 2 | ~ Copyright 2017-present Open Networking Foundation |
| 3 | ~ |
| 4 | ~ Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | ~ you may not use this file except in compliance with the License. |
| 6 | ~ You may obtain a copy of the License at |
| 7 | ~ |
| 8 | ~ http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | ~ |
| 10 | ~ Unless required by applicable law or agreed to in writing, software |
| 11 | ~ distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | ~ See the License for the specific language governing permissions and |
| 14 | ~ limitations under the License. |
| 15 | --> |
| 16 | <scenario name="upgrade" description="ONOS cluster upgrade"> |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 17 | <import file="${ONOS_SCENARIOS}/dist-setup.xml"/> |
| 18 | <dependency name="Distributed-Primitives-Setup"/> |
| 19 | |
| 20 | <group name="Upgrade" requires="Distributed-Primitives-Setup"> |
Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 21 | <step name="Push-Bits" exec="onos-push-bits-through-proxy" if="${OCT}"/> |
| 22 | |
| 23 | <step name="Initialize-Upgrade" |
Jordan Halterman | a57a472 | 2018-03-19 15:44:24 -0700 | [diff] [blame] | 24 | exec="onos ${OC1} issu init"/> |
Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 25 | |
| 26 | <group name="Phase-1"> |
| 27 | <sequential var="${OCMI#}" |
| 28 | starts="Phase-One-Stop-Service-${#}" |
| 29 | ends="Phase-One-Wait-for-Start-${#-1}"> |
| 30 | <step name="Phase-One-Stop-Service-${#}" |
| 31 | exec="onos-service ${OCMI#} stop" |
| 32 | requires="Initialize-Upgrade"/> |
| 33 | |
| 34 | <step name="Phase-One-Wait-for-Stop-${#}" |
| 35 | exec="onos-wait-for-stop ${OCMI#}" |
| 36 | requires="~Phase-One-Stop-Service-${#}"/> |
| 37 | |
| 38 | <step name="Phase-One-Uninstall-${#}" |
| 39 | exec="onos-uninstall ${OCMI#}" |
| 40 | requires="~Phase-One-Wait-for-Stop-${#}"/> |
| 41 | |
| 42 | <step name="Phase-One-Push-Bits-${#}" |
| 43 | exec="onos-push-bits ${OCMI#}" |
| 44 | unless="${OCT}" |
| 45 | requires="~Phase-One-Stop-Service-${#}"/> |
| 46 | |
| 47 | <step name="Phase-One-Install-Upgrade-${#}" |
| 48 | exec="onos-install -v ${OCMI#}" |
| 49 | requires="Phase-One-Push-Bits-${#},Push-Bits,Phase-One-Uninstall-${#}"/> |
| 50 | |
| 51 | <step name="Phase-One-Secure-SSH-${#}" |
| 52 | exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OCMI#}" |
| 53 | requires="~Phase-One-Install-Upgrade-${#}"/> |
| 54 | |
| 55 | <step name="Phase-One-Wait-for-Start-${#}" |
| 56 | exec="onos-wait-for-start ${OCMI#}" |
| 57 | requires="Phase-One-Secure-SSH-${#}"/> |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 58 | |
| 59 | <step name="Phase-One-Distributed-Primitives-Check-Apps-${#}" |
| 60 | exec="onos-check-apps ${OCMI#} distributedprimitives includes" |
| 61 | requires="Phase-One-Wait-for-Start-${#}"/> |
Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 62 | </sequential> |
| 63 | </group> |
| 64 | |
| 65 | <step name="Run-Upgrade" |
| 66 | exec="onos ${OC1} issu upgrade" |
Jordan Halterman | a57a472 | 2018-03-19 15:44:24 -0700 | [diff] [blame] | 67 | requires="Phase-1"/> |
Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 68 | |
| 69 | <group name="Phase-2" requires="Run-Upgrade"> |
| 70 | <sequential var="${OCMA#}" |
| 71 | starts="Phase-Two-Stop-Service-${#}" |
| 72 | ends="Phase-Two-Wait-for-Start-${#-1}"> |
| 73 | <step name="Phase-Two-Stop-Service-${#}" |
| 74 | exec="onos-service ${OCMA#} stop" |
| 75 | requires="Run-Upgrade"/> |
| 76 | |
| 77 | <step name="Phase-Two-Wait-for-Stop-${#}" |
| 78 | exec="onos-wait-for-stop ${OCMA#}" |
| 79 | requires="~Phase-Two-Stop-Service-${#}"/> |
| 80 | |
| 81 | <step name="Phase-Two-Uninstall-${#}" |
| 82 | exec="onos-uninstall ${OCMA#}" |
| 83 | requires="~Phase-Two-Wait-for-Stop-${#}"/> |
| 84 | |
| 85 | <step name="Phase-Two-Push-Bits-${#}" |
| 86 | exec="onos-push-bits ${OCMA#}" |
| 87 | unless="${OCT}" |
| 88 | requires="~Phase-Two-Stop-Service-${#}"/> |
| 89 | |
| 90 | <step name="Phase-Two-Install-Upgrade-${#}" |
| 91 | exec="onos-install -v ${OCMA#}" |
| 92 | requires="Phase-Two-Push-Bits-${#},Push-Bits,Phase-Two-Uninstall-${#}"/> |
| 93 | |
| 94 | <step name="Phase-Two-Secure-SSH-${#}" |
| 95 | exec="onos-secure-ssh -u ${ONOS_WEB_USER} -p ${ONOS_WEB_PASS} ${OCMA#}" |
| 96 | requires="~Phase-Two-Install-Upgrade-${#}"/> |
| 97 | |
| 98 | <step name="Phase-Two-Wait-for-Start-${#}" |
| 99 | exec="onos-wait-for-start ${OCMA#}" |
| 100 | requires="Phase-Two-Secure-SSH-${#}"/> |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 101 | |
| 102 | <step name="Phase-Two-Distributed-Primitives-Check-Apps-${#}" |
| 103 | exec="onos-check-apps ${OCMA#} distributedprimitives includes" |
| 104 | requires="Phase-Two-Wait-for-Start-${#}"/> |
Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 105 | </sequential> |
| 106 | </group> |
| 107 | |
| 108 | <step name="Commit-Upgrade" |
| 109 | exec="onos ${OC1} issu commit" |
| 110 | requires="Phase-2"/> |
| 111 | |
| 112 | <group name="Verify-Upgrade" requires="Commit-Upgrade"> |
| 113 | <parallel var="${OC#}"> |
| 114 | <step name="Check-Nodes-${#}" |
| 115 | exec="onos-check-nodes ${OC#}" |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 116 | delay="3"/> |
| 117 | |
Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 118 | <step name="Check-Components-${#}" |
| 119 | exec="onos-check-components ${OC#}" |
| 120 | delay="5" |
| 121 | requires="~Check-Nodes-${#}"/> |
| 122 | |
| 123 | <step name="Check-Logs-${#}" |
| 124 | exec="onos-check-logs ${OC#}" |
| 125 | requires="~Check-Components-${#}"/> |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 126 | |
Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 127 | <step name="Check-Apps-${#}" |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 128 | exec="onos-check-apps ${OC#} ${ONOS_APPS},distributedprimitives includes" |
Jordan Halterman | 980a8c1 | 2017-09-22 18:01:19 -0700 | [diff] [blame] | 129 | requires="~Check-Components-${#}"/> |
| 130 | </parallel> |
| 131 | </group> |
| 132 | </group> |
Dimitrios Mavrommatis | 03728eb | 2017-11-06 13:09:07 -0800 | [diff] [blame] | 133 | </scenario> |