Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 1 | #!/bin/bash |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 2 | # Copyright 2019 Ciena Corporation |
| 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 | |
David Bainbridge | 38dc1e8 | 2019-08-12 15:18:45 +0000 | [diff] [blame] | 16 | FANCY=${FANCY:-1} |
| 17 | if [ "$TERM X" == " X" ]; then |
| 18 | FANCY=0 |
| 19 | fi |
| 20 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 21 | # trap ctrl-c and call ctrl_c() |
| 22 | trap ctrl_c INT |
| 23 | |
| 24 | function ctrl_c() { |
David Bainbridge | 38dc1e8 | 2019-08-12 15:18:45 +0000 | [diff] [blame] | 25 | echo -en $CNORM |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 26 | echo "" |
| 27 | echo "ctrl-c trapped" |
| 28 | echo "Thank you for trying 'votlha up'" |
| 29 | exit |
| 30 | } |
| 31 | |
Test User | 08ebbd9 | 2019-07-03 17:15:39 +0000 | [diff] [blame] | 32 | VOLTCTL_VERSION=${VOLTCTL_VERSION:-0.0.5-dev} |
| 33 | KIND_VERSION=${KIND_VERSION:-v0.4.0} |
| 34 | _VOLTCTL_VERSION=$(echo $VOLTCTL_VERSION | sed -e 's/-/_/g') |
| 35 | |
David Bainbridge | 38dc1e8 | 2019-08-12 15:18:45 +0000 | [diff] [blame] | 36 | BLACK= |
| 37 | RED= |
| 38 | GREEN= |
| 39 | YELLOW= |
| 40 | BLUE= |
| 41 | MAGENTA= |
| 42 | CYAN= |
| 43 | WHITE= |
| 44 | BOLD= |
| 45 | NORMAL= |
| 46 | ERROR= |
| 47 | CEOL= |
| 48 | CNORM= |
| 49 | CIVIS= |
| 50 | if [ $FANCY -eq 1 ]; then |
| 51 | BLACK=$(tput setaf 0) |
| 52 | RED=$(tput setaf 1) |
| 53 | GREEN=$(tput setaf 2) |
| 54 | YELLOW=$(tput setaf 3) |
| 55 | BLUE=$(tput setaf 4) |
| 56 | MAGENTA=$(tput setaf 5) |
| 57 | CYAN=$(tput setaf 6) |
| 58 | WHITE=$(tput setaf 7) |
| 59 | BOLD=$(tput bold) |
| 60 | NORMAL=$(tput sgr0) |
| 61 | ERROR="\xe2\x9c\x97\x20" |
| 62 | CEOL=$(tput el) |
| 63 | CNORM=$(tput cnorm) |
| 64 | CIVIS=$(tput civis) |
| 65 | fi |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 66 | |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 67 | TYPE=${TYPE:-minimal} |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 68 | NAME=${NAME:-$TYPE} |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 69 | WITH_TIMINGS=${WITH_TIMINGS:-no} |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 70 | WITH_BBSIM=${WITH_BBSIM:-no} |
David Bainbridge | 5b7b96b | 2019-07-25 20:29:13 +0000 | [diff] [blame] | 71 | WITH_RADIUS=${WITH_RADIUS:-no} |
David Bainbridge | b270c20 | 2019-07-26 01:44:42 +0000 | [diff] [blame] | 72 | WITH_ONOS=${WITH_ONOS:-yes} |
David Bainbridge | 0129495 | 2019-07-30 19:33:45 +0000 | [diff] [blame] | 73 | WITH_TP=${WITH_TP:-yes} |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 74 | JUST_K8S=${JUST_K8S:-no} |
| 75 | DEPLOY_K8S=${DEPLOY_K8S:-yes} |
David Bainbridge | e10f6d5 | 2019-07-25 00:28:13 +0000 | [diff] [blame] | 76 | SKIP_RESTART_API=${SKIP_RESTART_API:-no} |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 77 | INSTALL_KUBECTL=${INSTALL_KUBECTL:-yes} |
| 78 | INSTALL_HELM=${INSTALL_HELM:-yes} |
David Bainbridge | 5b7b96b | 2019-07-25 20:29:13 +0000 | [diff] [blame] | 79 | USE_GO=${USE_GO:-yes} |
| 80 | VOLTHA_LOG_LEVEL=${VOLTHA_LOG_LEVEL:-WARN} |
David Bainbridge | e10f6d5 | 2019-07-25 00:28:13 +0000 | [diff] [blame] | 81 | VOLTHA_CHART=${VOLTHA_CHART:=onf/voltha} |
| 82 | VOLTHA_ADAPTER_SIM_CHART=${VOLTHA_ADAPTER_SIM_CHART:-onf/voltha-adapter-simulated} |
| 83 | VOLTHA_ADAPTER_OPEN_OLT_CHART=${VOLTHA_ADAPTER_OPEN_OLT_CHART:-onf/voltha-adapter-openolt} |
| 84 | VOLTHA_ADAPTER_OPEN_ONU_CHART=${VOLTHA_ADAPTER_OPEN_ONU_CHART:-onf/voltha-adapter-openonu} |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 85 | |
| 86 | HAVE_GO=$(which go >/dev/null 2>&1 && echo "yes" || echo "no") |
| 87 | HOSTOS=$(uname -s | tr "[:upper:]" "[:lower:"]) |
| 88 | HOSTARCH=$(uname -m | tr "[:upper:]" "[:lower:"]) |
| 89 | if [ $HOSTARCH == "x86_64" ]; then |
| 90 | HOSTARCH="amd64" |
| 91 | fi |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 92 | |
| 93 | # Verify TYPE setting |
| 94 | if [ $(echo ":minimal:full:" | grep -ic ":$TYPE:") -eq 0 ]; then |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 95 | >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$TYPE value of '$TYPE'. Should be 'minimal' or 'full'${NORMAL}" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 96 | exit 1 |
| 97 | fi |
| 98 | |
| 99 | # Verify WITH_BBSIM settting and convert uniform value of yes or no |
| 100 | if [ $(echo ":y:yes:true:n:no:false:1:0:" | grep -ic ":$WITH_BBSIM:") -eq 0 ]; then |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 101 | >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$WITH_BBSIM value of '$WITH_BBSIM'. Should be 'yes' or 'no'${NORMAL}" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 102 | exit 1 |
| 103 | fi |
| 104 | if [ $(echo ":y:yes:true:1:" | grep -ic ":$WITH_BBSIM:") -eq 1 ]; then |
| 105 | WITH_BBSIM=yes |
| 106 | else |
| 107 | WITH_BBSIM=no |
| 108 | fi |
| 109 | |
David Bainbridge | 5b7b96b | 2019-07-25 20:29:13 +0000 | [diff] [blame] | 110 | # Verify WITH_RADIUS settting and convert uniform value of yes or no |
| 111 | if [ $(echo ":y:yes:true:n:no:false:1:0:" | grep -ic ":$WITH_RADIUS:") -eq 0 ]; then |
| 112 | >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$WITH_RADIUS value of '$WITH_RADIUS'. Should be 'yes' or 'no'${NORMAL}" |
| 113 | exit 1 |
| 114 | fi |
| 115 | if [ $(echo ":y:yes:true:1:" | grep -ic ":$WITH_RADIUS:") -eq 1 ]; then |
| 116 | WITH_RADIUS=yes |
| 117 | else |
| 118 | WITH_RADIUS=no |
| 119 | fi |
| 120 | |
David Bainbridge | 0129495 | 2019-07-30 19:33:45 +0000 | [diff] [blame] | 121 | # Verify WITH_TP settting and convert uniform value of yes or no |
| 122 | if [ $(echo ":y:yes:true:n:no:false:1:0:" | grep -ic ":$WITH_TP:") -eq 0 ]; then |
| 123 | >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$WITH_TP value of '$WITH_TP'. Should be 'yes' or 'no'${NORMAL}" |
| 124 | exit 1 |
| 125 | fi |
| 126 | if [ $(echo ":y:yes:true:1:" | grep -ic ":$WITH_TP:") -eq 1 ]; then |
| 127 | WITH_TP=yes |
| 128 | else |
| 129 | WITH_TP=no |
| 130 | fi |
| 131 | |
David Bainbridge | b270c20 | 2019-07-26 01:44:42 +0000 | [diff] [blame] | 132 | # Verify WITH_ONOS settting and convert uniform value of yes or no |
| 133 | if [ $(echo ":y:yes:true:n:no:false:1:0:" | grep -ic ":$WITH_ONOS:") -eq 0 ]; then |
| 134 | >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$WITH_ONOS value of '$WITH_ONOS'. Should be 'yes' or 'no'${NORMAL}" |
| 135 | exit 1 |
| 136 | fi |
| 137 | if [ $(echo ":y:yes:true:1:" | grep -ic ":$WITH_ONOS:") -eq 1 ]; then |
| 138 | WITH_ONOS=yes |
| 139 | else |
| 140 | WITH_ONOS=no |
| 141 | fi |
| 142 | |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 143 | # Verify JUST_K8S settting and convert uniform value of yes or no |
| 144 | if [ $(echo ":y:yes:true:n:no:false:1:0:" | grep -ic ":$JUST_K8S:") -eq 0 ]; then |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 145 | >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$JUST_K8S value of '$JUST_K8S'. Should be 'yes' or 'no'${NORMAL}" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 146 | exit 1 |
| 147 | fi |
| 148 | if [ $(echo ":y:yes:true:1:" | grep -ic ":$JUST_K8S:") -eq 1 ]; then |
| 149 | JUST_K8S=yes |
| 150 | else |
| 151 | JUST_K8S=no |
| 152 | fi |
| 153 | |
| 154 | # Verify DEPLOY_K8S settting and convert uniform value of yes or no |
| 155 | if [ $(echo ":y:yes:true:n:no:false:1:0:" | grep -ic ":$DEPLOY_K8S:") -eq 0 ]; then |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 156 | >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$DEPLOY_K8S value of '$DEPLOY_K8S'. Should be 'yes' or 'no'${NORMAL}" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 157 | exit 1 |
| 158 | fi |
| 159 | if [ $(echo ":y:yes:true:1:" | grep -ic ":$DEPLOY_K8S:") -eq 1 ]; then |
| 160 | DEPLOY_K8S=yes |
| 161 | else |
| 162 | DEPLOY_K8S=no |
| 163 | fi |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 164 | |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 165 | # Verify INSTALL_KUBECTL settting and convert uniform value of yes or no |
| 166 | if [ $(echo ":y:yes:true:n:no:false:1:0:" | grep -ic ":$INSTALL_KUBECTL:") -eq 0 ]; then |
| 167 | >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$INSTALL_KUBECTL value of '$INSTALL_KUBECTL'. Should be 'yes' or 'no'${NORMAL}" |
| 168 | exit 1 |
| 169 | fi |
| 170 | |
| 171 | if [ $(echo ":y:yes:true:1:" | grep -ic ":$INSTALL_KUBECTL:") -eq 1 ]; then |
| 172 | INSTALL_KUBECTL=yes |
| 173 | else |
| 174 | INSTALL_KUBECTL=no |
| 175 | fi |
| 176 | |
David Bainbridge | e10f6d5 | 2019-07-25 00:28:13 +0000 | [diff] [blame] | 177 | # Verify SKIP_RESTART_API settting and convert uniform value of yes or no |
| 178 | if [ $(echo ":y:yes:true:n:no:false:1:0:" | grep -ic ":$SKIP_RESTART_API:") -eq 0 ]; then |
| 179 | >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$SKIP_RESTART_API value of '$SKIP_RESTART_API'. Should be 'yes' or 'no'${NORMAL}" |
| 180 | exit 1 |
| 181 | fi |
| 182 | if [ $(echo ":y:yes:true:1:" | grep -ic ":$SKIP_RESTART_API:") -eq 1 ]; then |
| 183 | SKIP_RESTART_API=yes |
| 184 | else |
| 185 | SKIP_RESTART_API=no |
| 186 | fi |
| 187 | |
David Bainbridge | 1ceabc1 | 2019-07-25 17:21:05 +0000 | [diff] [blame] | 188 | # Verify USE_GO settting and convert uniform value of yes or no |
| 189 | if [ $(echo ":y:yes:true:n:no:false:1:0:" | grep -ic ":$USE_GO:") -eq 0 ]; then |
| 190 | >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$USE_GO value of '$USE_GO'. Should be 'yes' or 'no'${NORMAL}" |
| 191 | exit 1 |
| 192 | fi |
| 193 | if [ $(echo ":y:yes:true:1:" | grep -ic ":$USE_GO:") -eq 1 ]; then |
| 194 | USE_GO=true |
| 195 | else |
| 196 | USE_GO=false |
| 197 | fi |
| 198 | |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 199 | # Verify INSTALL_HELM settting and convert uniform value of yes or no |
| 200 | if [ $(echo ":y:yes:true:n:no:false:1:0:" | grep -ic ":$INSTALL_HELM:") -eq 0 ]; then |
| 201 | >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$INSTALL_HELM value of '$INSTALL_HELM'. Should be 'yes' or 'no'${NORMAL}" |
| 202 | exit 1 |
| 203 | fi |
| 204 | |
| 205 | if [ $(echo ":y:yes:true:1:" | grep -ic ":$INSTALL_HELM:") -eq 1 ]; then |
| 206 | INSTALL_HELM=yes |
| 207 | else |
| 208 | INSTALL_HELM=no |
| 209 | fi |
| 210 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 211 | # Verify WITH_TIMINGS settting and convert uniform value of yes or no |
| 212 | if [ $(echo ":y:yes:true:n:no:false:1:0:" | grep -ic ":$WITH_TIMINGS:") -eq 0 ]; then |
| 213 | >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$WITH_TIMINGS value of '$WITH_TIMINGS'. Should be 'yes' or 'no'${NORMAL}" |
| 214 | exit 1 |
| 215 | fi |
| 216 | |
| 217 | if [ $(echo ":y:yes:true:1:" | grep -ic ":$WITH_TIMINGS:") -eq 1 ]; then |
| 218 | WITH_TIMINGS=yes |
| 219 | else |
| 220 | WITH_TIMINGS=no |
| 221 | fi |
| 222 | |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 223 | mkdir -p .voltha |
| 224 | touch .voltha/ports |
| 225 | HAVE=$(grep $NAME .voltha/ports) |
| 226 | if [ "$HAVE X" == " X" ]; then |
| 227 | # Find free port prefix |
| 228 | START=81 |
| 229 | while true; do |
| 230 | if [ $(grep -c $START .voltha/ports) -eq 0 ]; then |
| 231 | break |
| 232 | fi |
| 233 | START=$(expr $START + 1) |
| 234 | done |
| 235 | DELTA=$(expr $START - 81) |
| 236 | ONOS_API_PORT=${START}81 |
| 237 | ONOS_SSH_PORT=${START}01 |
| 238 | VOLTHA_API_PORT=5$(expr 55 + $DELTA)55 |
| 239 | VOLTHA_SSH_PORT=$(expr 50 + $DELTA)22 |
| 240 | VOLTHA_ETCD_PORT=$(expr 23 + $DELTA)79 |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 241 | else |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 242 | VALUES=$(echo $HAVE | sed -e 's/\s//g' | cut -d= -f2) |
| 243 | ONOS_API_PORT=$(echo $VALUES | cut -d, -f1) |
| 244 | ONOS_SSH_PORT=$(echo $VALUES | cut -d, -f2) |
| 245 | VOLTHA_API_PORT=$(echo $VALUES | cut -d, -f3) |
| 246 | VOLTHA_SSH_PORT=$(echo $VALUES | cut -d, -f4) |
| 247 | VOLTHA_ETCD_PORT=$(echo $VALUES | cut -d, -f5) |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 248 | fi |
| 249 | |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 250 | PORTTMP=$(mktemp -u) |
| 251 | cat .voltha/ports | grep -v $NAME > $PORTTMP |
| 252 | echo "$NAME=$ONOS_API_PORT,$ONOS_SSH_PORT,$VOLTHA_API_PORT,$VOLTHA_SSH_PORT,$VOLTHA_ETCD_PORT" >> $PORTTMP |
| 253 | cp $PORTTMP .voltha/ports |
| 254 | rm -f $PORTTMP |
| 255 | |
David Bainbridge | 0129495 | 2019-07-30 19:33:45 +0000 | [diff] [blame] | 256 | if [ "$WITH_TP" == "yes" ]; then |
| 257 | SADIS_VER=3.1.0 |
| 258 | OLT_VER=3.0.1 |
| 259 | AAA_VER=1.9.0 |
| 260 | DHCP_VER=1.6.0 |
| 261 | else |
| 262 | SADIS_VER=2.2.0 |
| 263 | OLT_VER=2.1.0 |
| 264 | AAA_VER=1.8.0 |
| 265 | DHCP_VER=1.5.0 |
| 266 | fi |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 267 | export ONOS_API_PORT ONOS_SSH_PORT SADIS_VER OLT_VER AAA_VER DHCP_VER |
David Bainbridge | 0129495 | 2019-07-30 19:33:45 +0000 | [diff] [blame] | 268 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 269 | spin() { |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame] | 270 | PARTS="\ |
| 271 | \xe2\xa2\x8e\xe2\xa1\xb0 \ |
| 272 | \xe2\xa2\x8e\xe2\xa1\xa1 \ |
| 273 | \xe2\xa2\x8e\xe2\xa1\x91 \ |
| 274 | \xe2\xa2\x8e\xe2\xa0\xb1 \ |
| 275 | \xe2\xa0\x8e\xe2\xa1\xb1 \ |
| 276 | \xe2\xa2\x8a\xe2\xa1\xb1 \ |
| 277 | \xe2\xa2\x8c\xe2\xa1\xb1 \ |
| 278 | \xe2\xa2\x86\xe2\xa1\xb1 \ |
| 279 | " |
| 280 | IDX=1 |
David Bainbridge | 38dc1e8 | 2019-08-12 15:18:45 +0000 | [diff] [blame] | 281 | echo -en $CIVIS |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 282 | while true; do |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame] | 283 | C=$(echo $PARTS | cut '-d ' -f $IDX) |
| 284 | echo -en "$C" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 285 | IDX=$(expr $IDX + 1) |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame] | 286 | if [ $IDX -gt 8 ]; then |
| 287 | IDX=1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 288 | fi |
| 289 | sleep .15 |
| 290 | echo -en "\r" |
| 291 | done |
| 292 | } |
| 293 | |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame] | 294 | IDX=1 |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 295 | CLOCK="TIME:" |
David Bainbridge | 38dc1e8 | 2019-08-12 15:18:45 +0000 | [diff] [blame] | 296 | SPIN_PARTS= |
| 297 | NOT_VERIFIED= |
| 298 | VERIFIED= |
| 299 | HELM= |
| 300 | OLD_KEY= |
| 301 | BIRD= |
| 302 | HIGH_VOLTAGE= |
| 303 | PLUG= |
| 304 | RESTART= |
| 305 | FORWARD= |
| 306 | INSTALL= |
| 307 | STOP= |
| 308 | GO= |
| 309 | DOWNLOAD= |
| 310 | GEAR= |
| 311 | NO_ENTRY= |
| 312 | LOCK= |
| 313 | |
| 314 | if [ $FANCY -eq 1 ]; then |
| 315 | SPIN_PARTS="\ |
| 316 | \xe2\xa2\x8e\xe2\xa1\xb0 \ |
| 317 | \xe2\xa2\x8e\xe2\xa1\xa1 \ |
| 318 | \xe2\xa2\x8e\xe2\xa1\x91 \ |
| 319 | \xe2\xa2\x8e\xe2\xa0\xb1 \ |
| 320 | \xe2\xa0\x8e\xe2\xa1\xb1 \ |
| 321 | \xe2\xa2\x8a\xe2\xa1\xb1 \ |
| 322 | \xe2\xa2\x8c\xe2\xa1\xb1 \ |
| 323 | \xe2\xa2\x86\xe2\xa1\xb1 \ |
| 324 | " |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 325 | CLOCK="\xe2\x8f\xb1" |
David Bainbridge | 38dc1e8 | 2019-08-12 15:18:45 +0000 | [diff] [blame] | 326 | NOT_VERIFIED="\xe2\x9c\x97\x20" |
| 327 | VERIFIED="\xe2\x9c\x93\x20" |
| 328 | HELM="\xE2\x8E\x88" |
| 329 | OLD_KEY="\xF0\x9F\x97\x9D" |
| 330 | BIRD="\xF0\x9F\x90\xA6" |
| 331 | HIGH_VOLTAGE="\xE2\x9A\xA1" |
| 332 | PLUG="\xF0\x9F\xa7\xa9" |
| 333 | RESTART="\xf0\x9f\x94\x84" |
| 334 | FORWARD="\xE2\x87\xA8" |
| 335 | INSTALL="\xF0\x9F\x8F\x97" |
| 336 | STOP="\xf0\x9f\x9b\x91" |
| 337 | GO="\xf0\x9f\x9a\x80" |
| 338 | DOWNLOAD="\xf0\x9f\x93\xa5" |
| 339 | GEAR="\xe2\x9a\x99" |
| 340 | NO_ENTRY="\xe2\x9b\x94" |
| 341 | LOCK="\xf0\x9f\x94\x92" |
| 342 | fi |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 343 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 344 | timeout() { |
| 345 | local INDENT= |
| 346 | if [ "$1" == "-" ]; then |
| 347 | INDENT=" " |
| 348 | shift |
| 349 | fi |
| 350 | local h=$(expr $1 / 3600) |
| 351 | local m=$(expr $1 % 3600 / 60) |
| 352 | local s=$(expr $1 % 60) |
| 353 | local t="" |
| 354 | |
| 355 | if [ $h -gt 0 ]; then |
| 356 | t="$t${h}h" |
| 357 | fi |
| 358 | if [ $m -gt 0 ]; then |
| 359 | t="$t${m}m" |
| 360 | fi |
| 361 | t="$t${s}s" |
| 362 | echo -e "$INDENT $CLOCK $t" |
| 363 | } |
| 364 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 365 | bspin() { |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame] | 366 | IDX=1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 367 | local INDENT= |
| 368 | if [ "$1" == "-" ]; then |
| 369 | INDENT=" " |
| 370 | shift |
| 371 | fi |
David Bainbridge | 38dc1e8 | 2019-08-12 15:18:45 +0000 | [diff] [blame] | 372 | if [ $FANCY -eq 0 ]; then |
| 373 | LINE=$(echo $* | sed -e 's/[\s+-]//g') |
| 374 | if [ "$LINE X" == " X" ]; then |
| 375 | return |
| 376 | fi |
| 377 | echo -e "$CIVIS$INDENT$*" |
| 378 | else |
| 379 | echo -en "$CIVIS$INDENT $*" |
| 380 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 381 | } |
| 382 | |
| 383 | sspin() { |
| 384 | local INDENT= |
| 385 | if [ "$1" == "-" ]; then |
| 386 | INDENT=" " |
| 387 | shift |
| 388 | fi |
David Bainbridge | 38dc1e8 | 2019-08-12 15:18:45 +0000 | [diff] [blame] | 389 | if [ $FANCY -eq 0 ]; then |
| 390 | LINE=$(echo $* | sed -e 's/[\s+-]//g') |
| 391 | if [ "$LINE X" == " X" ]; then |
| 392 | return |
| 393 | fi |
| 394 | echo -e "$INDENT$*" |
| 395 | else |
| 396 | C=$(echo $SPIN_PARTS | cut '-d ' -f $IDX) |
| 397 | echo -en "\r$INDENT$C $*" |
| 398 | IDX=$(expr $IDX + 1) |
| 399 | if [ $IDX -gt 8 ]; then |
| 400 | IDX=1 |
| 401 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 402 | fi |
| 403 | } |
| 404 | |
| 405 | espin() { |
| 406 | local INDENT= |
| 407 | if [ "$1" == "-" ]; then |
| 408 | INDENT=" " |
| 409 | shift |
| 410 | fi |
David Bainbridge | 38dc1e8 | 2019-08-12 15:18:45 +0000 | [diff] [blame] | 411 | if [ $FANCY -eq 0 ]; then |
| 412 | LINE=$(echo $* | sed -e 's/[\s+-]//g') |
| 413 | if [ "$LINE X" == " X" ]; then |
| 414 | return |
| 415 | fi |
| 416 | echo -e "$INDENT$*" |
| 417 | else |
| 418 | echo -e "\r$INDENT$*$CNORM" |
| 419 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 420 | } |
| 421 | |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 422 | if [ "$1" == "get" -a "$2" == "voltconfig" ]; then |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 423 | echo "$HOME/.volt/config-$NAME" |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 424 | exit |
| 425 | fi |
| 426 | |
| 427 | if [ $# -ne 1 -o $(echo ":up:down:dump:" | grep -c ":$1:") -ne 1 ]; then |
| 428 | >&2 echo "What wouild you like to do today:" |
| 429 | >&2 echo " up - bring up voltha" |
| 430 | >&2 echo " down - tear down voltha" |
| 431 | >&2 echo " dump - create a debug dump of running system" |
| 432 | exit 1 |
| 433 | fi |
| 434 | |
| 435 | if [ "$1" == "down" ]; then |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 436 | echo "Tearing down voltha cluster $NAME" |
| 437 | LOG="down-$NAME.log" |
| 438 | echo $(date -u +"%Y%m%dT%H%M%SZ") >$LOG |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 439 | if [ $DEPLOY_K8S == "yes" ]; then |
| 440 | if [ -x ./bin/kind ]; then |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 441 | bspin "Delete Kubernetes Kind Cluster" |
| 442 | (set -x; ./bin/kind delete cluster --name voltha-$NAME >>$LOG 2>&1) >>$LOG 2>&1 |
| 443 | espin $VERIFIED |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 444 | else |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 445 | espin "$NO_ENTRY Delete Kubernetes Kind Cluster: kind command not found" |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 446 | fi |
| 447 | else |
| 448 | EXISTS=$(helm list -q) |
| 449 | EXPECT="etcd-operator onos open-olt open-onu sim voltha bbsim radius" |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 450 | bspin "Remove Helm Deployments" |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 451 | for i in $EXISTS; do |
| 452 | if [ $(echo $EXPECT | grep -c $i) -eq 1 ]; then |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 453 | sspin "Remove Helm Deployments: $i$CEOL" |
| 454 | (set -x; ./bin/helm delete --purge $i >>$LOG 2>&1) >>$LOG 2>&1 |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 455 | fi |
| 456 | done |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 457 | espin "$VERIFIED Remove Helm Deployments$CEOL" |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 458 | fi |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 459 | bspin "Remove port-forwards: onos-ui-$NAME" |
| 460 | for i in $(screen -ls | grep onos-ui-$NAME | awk '{print $1}'); do |
| 461 | sspin |
| 462 | (set -x; screen -X -S $i quit >>$LOG 2>&1) >>$LOG 2>&1 |
| 463 | done |
| 464 | sspin "Remove port-forwards: onos-ssh-$NAME$CEOL" |
| 465 | for i in $(screen -ls | grep onos-ssh-$NAME | awk '{print $1}'); do |
| 466 | sspin |
| 467 | (set -x; screen -X -S $i quit >>$LOG 2>&1) >>$LOG 2>&1 |
| 468 | done |
| 469 | sspin "Remove port-forwards: voltha-api-$NAME$CEOL" |
| 470 | for i in $(screen -ls | grep voltha-api-$NAME | awk '{print $1}'); do |
| 471 | sspin |
| 472 | (set -x; screen -X -S $i quit >>$LOG 2>&1) >>$LOG 2>&1 |
| 473 | done |
| 474 | sspin "Remove port-forwards: voltha-ssh-$NAME$CEOL" |
| 475 | for i in $(screen -ls | grep voltha-ssh-$NAME | awk '{print $1}'); do |
| 476 | sspin |
| 477 | (set -x; screen -X -S $i quit >>$LOG 2>&1) >>$LOG 2>&1 |
| 478 | done |
| 479 | sspin "Remove port-forwards: voltha-etcd-$NAME$CEOL" |
| 480 | for i in $(screen -ls | grep voltha-etcd-$NAME | awk '{print $1}'); do |
| 481 | sspin |
| 482 | (set -x; screen -X -S $i quit >>$LOG 2>&1) >>$LOG 2>&1 |
| 483 | done |
| 484 | espin "$VERIFIED Remove port-forwards$CEOL" |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 485 | exit |
| 486 | fi |
| 487 | |
| 488 | if [ "$1" == "dump" ]; then |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 489 | LOG="dump-$NAME.log" |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 490 | TS=$(date -u +"%Y%m%dT%H%M%SZ") |
| 491 | WORK=$(mktemp -u -d) |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 492 | DATA=$WORK/voltha-debug-dump-$NAME-$TS |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 493 | mkdir -p $DATA |
| 494 | echo $TS > $LOG |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 495 | echo -e "Capturing debug dump to voltha-debug-dump-$NAME-$TS.tgz" |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 496 | bspin - "Copy install log" |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 497 | if [ -f install-$NAME.log ]; then |
| 498 | (set -x; cp install-$NAME.log $DATA/install-$NAME.log) >>$LOG 2>&1 |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 499 | espin - $VERIFIED |
| 500 | else |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 501 | espin - "$NO_ENTRY Copy install log: install-$NAME.log not found" |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 502 | fi |
| 503 | bspin - "Dumping Kubernetes PODs" |
| 504 | (set -x; kubectl get --all-namespaces pods >> $DATA/all-pods.txt 2>&1) >>$LOG 2>&1 |
| 505 | espin - $VERIFIED |
| 506 | bspin - "Dumping Kubernetes SERVICEs" |
| 507 | (set -x; kubectl get --all-namespaces svc >> $DATA/all-services.txt 2>&1) >>$LOG 2>&1 |
| 508 | espin - $VERIFIED |
| 509 | bspin - "Dumping Kubernetes EVENTs" |
| 510 | (set -x; kubectl get --all-namespaces events >> $DATA/all-events.txt 2>&1) >>$LOG 2>&1 |
| 511 | espin - $VERIFIED |
| 512 | bspin - "Dumping VOLTHA POD details" |
| 513 | PODS=$(kubectl get -n voltha pod -o name) |
| 514 | for POD in $PODS; do |
| 515 | sspin - "Dumping VOLTHA POD details: $POD$CEOL" |
| 516 | mkdir -p $DATA/$POD |
| 517 | (set -x; kubectl describe -n voltha $POD >> $DATA/$POD/describe.txt 2>&1) >>$LOG 2>&1 |
| 518 | sspin - "Dumping VOLTHA POD details: $POD" |
| 519 | (set -x; kubectl logs -n voltha --all-containers --previous $LOG_ARGS $POD >> $DATA/$POD/logs-previous.txt 2>&1) >>$LOG 2>&1 |
| 520 | sspin - "Dumping VOLTHA POD details: $POD" |
| 521 | (set -x; kubectl logs -n voltha --all-containers $LOG_ARGS $POD >> $DATA/$POD/logs-current.txt 2>&1) >>$LOG 2>&1 |
| 522 | sspin - "Dumping VOLTHA POD details: $POD" |
| 523 | done |
| 524 | espin - "$VERIFIED Dumping VOLTHA POD details$CEOL" |
| 525 | bspin - "Dumping ETCD" |
| 526 | if [ "$(which etcdctl) X" != " X" ]; then |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 527 | (set -x; ETCDCTL_API=3 etcdctl --endpoints localhost:$VOLTHA_ETCD_PORT get --prefix service/voltha | hexdump -C >> $DATA/etcd.hex 2>&1) >>$LOG 2>&1 |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 528 | espin - $VERIFIED |
| 529 | else |
| 530 | espin - "$NO_ENTRY Dumping ETCD: etcdctl command not available" |
| 531 | fi |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 532 | bspin - "Creating compressed TAR: voltha-debug-dump-$NAME-$TS.tgz" |
| 533 | (set -x; tar -C $WORK -zcf voltha-debug-dump-$NAME-$TS.tgz ./voltha-debug-dump-$NAME-$TS) >>$LOG 2>&1 |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 534 | espin - $VERIFIED |
| 535 | bspin - "Cleanup" |
| 536 | (set -x; rm -rf $WORK) >>$LOG 2>&1 |
| 537 | espin - $VERIFIED |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 538 | bspin - "$(ls -l voltha-debug-dump-$NAME-$TS.tgz)" |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 539 | espin - $VERIFIED |
| 540 | exit |
| 541 | fi |
| 542 | |
| 543 | |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 544 | LOG="install-$NAME.log" |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 545 | date > $LOG |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 546 | echo "PORTS=$ONOS_API_PORT,$ONOS_SSH_PORT,$VOLTHA_API_PORT,$VOLTHA_SSH_PORT,$VOLTHA_ETCD_PORT" >> $LOG |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 547 | |
| 548 | # Output install options to log |
| 549 | echo "OPTIONS" >> $LOG |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 550 | ALL_OPTIONS="NAME TYPE WITH_TIMINGS WITH_BBSIM WITH_RADIUS WITH_ONOS WITH_TP JUST_K8S DEPLOY_K8S \ |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 551 | SKIP_RESTART_API INSTALL_KUBECTL INSTALL_HELM USE_GO VOLTHA_LOG_LEVEL \ |
| 552 | VOLTHA_CHART VOLTHA_ADAPTER_SIM_CHART VOLTHA_ADAPTER_OPEN_OLT_CHART \ |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 553 | VOLTHA_ADAPTER_OPEN_ONU_CHART SADIS_VER OLT_VER AAA_VER DHCP_VER \ |
| 554 | ONOS_API_PORT ONOS_SSH_PORT VOLTHA_API_PORT VOLTHA_SSH_PORT VOLTHA_ETCD_PORT" |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 555 | for O in $ALL_OPTIONS; do |
| 556 | VAL=$(eval echo \$$O) |
| 557 | if [ $O == "USE_GO" ]; then |
| 558 | VAL="$(echo $VAL| test $(grep -c true) -eq 1 && echo yes || echo no)" |
| 559 | fi |
| 560 | if [ ! -z "$VAL" ]; then |
| 561 | printf " %-30s = %s\n" $O $VAL >> $LOG |
| 562 | fi |
| 563 | done |
| 564 | |
David Bainbridge | d31d612 | 2019-08-13 19:37:59 +0000 | [diff] [blame^] | 565 | push_onos_config() { |
| 566 | local MSG=$1 |
| 567 | local RESOURCE=$2 |
| 568 | local DATA=$3 |
| 569 | |
| 570 | bspin - "$MSG $GEAR" |
| 571 | until test; do |
| 572 | (set -x; curl --fail -sSL --user karaf:karaf -X POST -H Content-Type:application/json http://127.0.0.1:$ONOS_API_PORT/onos/v1/$RESOURCE --data @$DATA >>$LOG 2>&1) >>$LOG 2>&1 |
| 573 | if [ $? -eq 0 ]; then |
| 574 | break |
| 575 | fi |
| 576 | sleep .2 |
| 577 | sspin - |
| 578 | done |
| 579 | espin - $VERIFIED |
| 580 | } |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 581 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 582 | count_pods() { |
| 583 | local NAMESPACE=$1; shift |
| 584 | local PODS=$(kubectl -n $NAMESPACE get pod -o go-template="{{range .items}}{{.metadata.name}}/{{.status.phase}}/_{{range .status.containerStatuses}}{{.ready}}_{{end}} {{end}}") |
| 585 | local COUNT=0 |
| 586 | local PATTERNS=$* |
| 587 | for POD in $PODS; do |
| 588 | local NAME=$(echo $POD | cut -d/ -f 1) |
| 589 | local STATE=$(echo $POD | cut -d/ -f 2) |
| 590 | local CONTAINERS=$(echo $POD | cut -d/ -f 3 | sed -e 's/_/ /g') |
| 591 | if [ "$STATE" == "Running" ]; then |
| 592 | local TOTAL=$(echo $CONTAINERS | wc -w) |
| 593 | local FOUND=$(echo $CONTAINERS | grep -o true | wc -l) |
| 594 | if [ $TOTAL -eq $FOUND ]; then |
| 595 | for PATTERN in $PATTERNS; do |
| 596 | if [[ $NAME =~ $PATTERN ]]; then |
| 597 | COUNT=$(expr $COUNT + 1) |
| 598 | fi |
| 599 | done |
| 600 | fi |
| 601 | fi |
| 602 | done |
| 603 | echo $COUNT |
| 604 | } |
| 605 | |
| 606 | wait_for_pods() { |
| 607 | local INDENT= |
| 608 | if [ "$1" == "-" ]; then |
| 609 | INDENT=$1; shift |
| 610 | fi |
| 611 | local NAMESPACE=$1; shift |
| 612 | local EXPECT=$1; shift |
| 613 | local RETRY=$1; shift |
| 614 | local MESSAGE=$1; shift |
| 615 | local PATTERNS=$* |
| 616 | local HAVE=$(count_pods $NAMESPACE $PATTERNS) |
| 617 | COUNT=$(expr 300 / 15) |
| 618 | bspin $INDENT $MESSAGE |
| 619 | sspin $INDENT |
| 620 | if [ $HAVE -ne $EXPECT ]; then |
| 621 | while [ $HAVE -ne $EXPECT ]; do |
| 622 | sspin $INDENT |
| 623 | COUNT=$(expr $COUNT - 1) |
| 624 | if [ $COUNT -eq 0 ]; then |
| 625 | HAVE=$(count_pods $NAMESPACE $PATTERNS) |
| 626 | COUNT=$(expr 300 / 15) |
| 627 | fi |
| 628 | sleep .15 |
| 629 | done |
| 630 | fi |
| 631 | espin $INDENT $VERIFIED |
| 632 | if [ $HAVE -ne $EXPECT ]; then |
| 633 | return 1 |
| 634 | fi |
| 635 | return 0 |
| 636 | } |
| 637 | |
| 638 | helm_install() { |
| 639 | local INDENT= |
| 640 | if [ "$1" == "-" ]; then |
| 641 | INDENT=$1; shift |
| 642 | fi |
| 643 | local NAMESPACE=$1; shift |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 644 | local INAME=$1; shift |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 645 | local CHART=$1; shift |
| 646 | local MESSAGE=$* |
| 647 | |
| 648 | COUNT=$(expr 300 / 15) |
| 649 | bspin $INDENT $MESSAGE |
David Bainbridge | 458bb66 | 2019-08-02 20:04:23 +0000 | [diff] [blame] | 650 | (set -x; helm install -f $NAME-values.yaml --set use_go=$USE_GO --set defaults.log_level=$VOLTHA_LOG_LEVEL --namespace $NAMESPACE --name $INAME $EXTRA_HELM_FLAGS $CHART >>$LOG 2>&1) >>$LOG 2>&1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 651 | SUCCESS=$? |
| 652 | while [ $SUCCESS -ne 0 ]; do |
| 653 | sspin $INDENT |
| 654 | COUNT=$(expr $COUNT - 1) |
| 655 | if [ $COUNT -eq 0 ]; then |
David Bainbridge | 458bb66 | 2019-08-02 20:04:23 +0000 | [diff] [blame] | 656 | (set -x; helm install -f $NAME-values.yaml --set use_go=$USE_GO --set defaults.log_level=$VOLTHA_LOG_LEVEL --namespace $NAMESPACE --name $INAME $EXTRA_HELM_FLAGS $CHART >>$LOG 2>&1) >>$LOG 2>&1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 657 | COUNT=$(expr 300 / 15) |
| 658 | fi |
| 659 | sleep .15 |
| 660 | done |
| 661 | espin $INDENT $VERIFIED |
| 662 | } |
| 663 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 664 | echo "INSTALL TYPE: $TYPE" >> $LOG |
| 665 | |
| 666 | bspin "Verify GOPATH" |
| 667 | export GOPATH=$(pwd) |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 668 | mkdir -p $GOPATH/bin |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 669 | espin $VERIFIED |
| 670 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 671 | STIME=$(date +%s) |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 672 | if [ "$INSTALL_KUBECTL" == "no" ]; then |
| 673 | bspin "Skip kubectl install" |
| 674 | espin $NO_ENTRY |
Test User | c13bdc9 | 2019-07-03 20:57:49 +0000 | [diff] [blame] | 675 | else |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 676 | bspin "Verify kubectl $HELM" |
| 677 | if [ -x $GOPATH/bin/kubectl ]; then |
| 678 | espin $VERIFIED |
| 679 | else |
| 680 | espin $NOT_VERIFIED |
| 681 | bspin - "Download and install Kubernetes/kubectl $DOWNLOAD" |
| 682 | (set -x; curl -o $GOPATH/bin/kubectl -sSL https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/$HOSTOS/$HOSTARCH/kubectl >>$LOG 2>&1) >>$LOG 2>&1 |
| 683 | (set -x; chmod 755 $GOPATH/bin/kubectl >>$LOG 2>&1) >>$LOG 2>&1 |
| 684 | espin - $VERIFIED |
| 685 | fi |
Test User | c13bdc9 | 2019-07-03 20:57:49 +0000 | [diff] [blame] | 686 | fi |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 687 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 688 | timeout $(expr $(date +%s) - $STIME) |
| 689 | fi |
Test User | c13bdc9 | 2019-07-03 20:57:49 +0000 | [diff] [blame] | 690 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 691 | STIME=$(date +%s) |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 692 | if [ "$DEPLOY_K8S" == "no" ]; then |
| 693 | bspin "Skip Kubernetes/Kind Deployment" |
| 694 | espin $NO_ENTRY |
| 695 | else |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 696 | bspin "Verify Kubernetes/Kind $HELM" |
| 697 | if [ -x $GOPATH/bin/kind ]; then |
| 698 | espin $VERIFIED |
| 699 | else |
| 700 | espin $NOT_VERIFIED |
| 701 | bspin - "Download and install Kubernetes/kind $DOWNLOAD" |
David Bainbridge | 9e2a666 | 2019-07-11 17:07:57 +0000 | [diff] [blame] | 702 | (set -x; curl -o $GOPATH/bin/kind -sSL https://github.com/kubernetes-sigs/kind/releases/download/$KIND_VERSION/kind-$HOSTOS-$HOSTARCH >>$LOG 2>&1) >>$LOG 2>&1 |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 703 | (set -x; chmod 755 $GOPATH/bin/kind >>$LOG 2>&1) >>$LOG 2>&1 |
| 704 | espin - $VERIFIED |
| 705 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 706 | fi |
| 707 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 708 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 709 | timeout $(expr $(date +%s) - $STIME) |
| 710 | fi |
| 711 | |
| 712 | STIME=$(date +%s) |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 713 | if [ "$INSTALL_HELM" == "no" ]; then |
| 714 | bspin "Skip Helm Install" |
| 715 | espin $NO_ENTRY |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 716 | else |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 717 | bspin "Verify Helm $HELM" |
| 718 | if [ -x $GOPATH/bin/helm ]; then |
| 719 | espin $VERIFIED |
| 720 | else |
| 721 | espin $NOT_VERIFIED |
| 722 | bspin - "Download and install Helm $DOWNLOAD" |
| 723 | (set -x; curl -sSL https://git.io/get_helm.sh | USE_SUDO=false HELM_INSTALL_DIR=$GOPATH/bin bash >>$LOG 2>&1) >>$LOG 2>&1 |
| 724 | espin - $VERIFIED |
| 725 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 726 | fi |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 727 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 728 | timeout $(expr $(date +%s) - $STIME) |
| 729 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 730 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 731 | STIME=$(date +%s) |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 732 | bspin "Verify voltctl $HIGH_VOLTAGE" |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 733 | if [ -x $GOPATH/bin/voltctl ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 734 | espin $VERIFIED |
| 735 | else |
| 736 | espin $NOT_VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 737 | bspin - "Download and build voltctl $DOWNLOAD" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 738 | (set -x; curl -o $GOPATH/bin/voltctl -sSL https://github.com/ciena/voltctl/releases/download/$VOLTCTL_VERSION/voltctl-$_VOLTCTL_VERSION-$HOSTOS-$HOSTARCH >>$LOG 2>&1) >>$LOG 2>&1 |
Test User | 08ebbd9 | 2019-07-03 17:15:39 +0000 | [diff] [blame] | 739 | (set -x; chmod 755 $GOPATH/bin/voltctl >>$LOG 2>&1) >>$LOG 2>&1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 740 | espin - $VERIFIED |
| 741 | fi |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 742 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 743 | timeout $(expr $(date +%s) - $STIME) |
| 744 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 745 | |
| 746 | bspin "Verify command PATH" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 747 | export PATH=$GOPATH/bin:$PATH |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 748 | espin $VERIFIED |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 749 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 750 | STIME=$(date +%s) |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 751 | if [ "$DEPLOY_K8S" == "yes" ]; then |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 752 | HAVE=$(kind get clusters | grep -c voltha-$NAME) |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 753 | bspin "Verify Kubernetes/Kind Cluster" |
| 754 | sspin |
| 755 | if [ $HAVE -eq 0 ]; then |
David Bainbridge | 491b1bd | 2019-07-11 17:53:11 +0000 | [diff] [blame] | 756 | espin $NOT_VERIFIED |
| 757 | bspin - "Verify cluster configuration" |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 758 | if [ ! -r ./$NAME-cluster.cfg ]; then |
David Bainbridge | 491b1bd | 2019-07-11 17:53:11 +0000 | [diff] [blame] | 759 | espin - $NOT_VERIFIED |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 760 | bspin - "Download cluster configuration: $TYPE-cluster.cfg to $NAME-cluster.cfg $DOWNLOAD" |
| 761 | (set -x; curl -o ./$NAME-cluster.cfg -sSL https://raw.githubusercontent.com/ciena/kind-voltha/master/$TYPE-cluster.cfg >>$LOG 2>&1) >>$LOG 2>&1 |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 762 | espin - $VERIFIED |
| 763 | else |
| 764 | espin - $VERIFIED |
| 765 | fi |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 766 | kind create cluster --name voltha-$NAME --config $NAME-cluster.cfg |
David Bainbridge | 491b1bd | 2019-07-11 17:53:11 +0000 | [diff] [blame] | 767 | else |
| 768 | espin $VERIFIED |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 769 | fi |
| 770 | |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 771 | export KUBECONFIG="$(kind get kubeconfig-path --name="voltha-$NAME")" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 772 | P="coredns-.* \ |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 773 | etcd-voltha-$NAME-control-plane \ |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 774 | kindnet-.* \ |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 775 | kube-apiserver-voltha-$NAME-control-plane \ |
| 776 | kube-controller-manager-voltha-$NAME-control-plane \ |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 777 | kube-proxy-.* \ |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 778 | kube-scheduler-voltha-$NAME-control-plane" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 779 | |
| 780 | EXPECT=$(test "$TYPE" == "minimal" && echo "12" || echo "14") |
| 781 | wait_for_pods - "kube-system" $EXPECT -1 "Waiting for system PODs to start" $P |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 782 | fi |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 783 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 784 | timeout $(expr $(date +%s) - $STIME) |
| 785 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 786 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 787 | STIME=$(date +%s) |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 788 | COUNT=$(count_pods "kube-system" "tiller-deploy-.*") |
| 789 | bspin "Verify Helm" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 790 | if [ $COUNT -ne 1 ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 791 | espin $NOT_VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 792 | echo -e "Configuring Helm $GEAR" |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 793 | if [ "$INSTALL_HELM" == "no" ]; then |
| 794 | bspin - "Skip Helm/Tiller Initialization" |
| 795 | espin - $NO_ENTRY |
| 796 | else |
| 797 | bspin - "Initialize Helm" |
| 798 | (set -x; helm init --upgrade >>$LOG 2>&1) >>$LOG 2>&1 |
| 799 | espin - $VERIFIED |
| 800 | wait_for_pods - "kube-system" 1 -1 "Waiting for Tiller POD to start" "tiller-deploy-.*" |
| 801 | fi |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 802 | bspin - "Add Google Incubator repository to Helm" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 803 | (set -x; helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com >>$LOG 2>&1) >>$LOG 2>&1 |
| 804 | espin - $VERIFIED |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 805 | |
| 806 | # HACK (sort-of) - the config for tiller is about to be patched, which will |
| 807 | # cause the tiller pod to be recreated. This can sometimes cause a timing |
| 808 | # issue with the "wait_for_pods" call on tiller as it may incorrectly |
| 809 | # identify the running/ready tiller pod that is soon to be terminated as |
| 810 | # what it is waiting for. To avoid this issue we do a clean scale down and |
| 811 | # scale up of the pod so the script controlls when it should be expecting |
| 812 | # things |
| 813 | (set -x; kubectl -n kube-system scale deploy tiller-deploy --replicas=0 >>$LOG 2>&1) >>$LOG 2>&1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 814 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 815 | bspin - "Add Google Stable repository to Helm" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 816 | (set -x; helm repo add stable https://kubernetes-charts.storage.googleapis.com >>$LOG 2>&1) >>$LOG 2>&1 |
| 817 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 818 | bspin - "Add ONF repository to Helm" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 819 | (set -x; helm repo add onf https://charts.opencord.org >>$LOG 2>&1) >>$LOG 2>&1 |
| 820 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 821 | bspin - "Update Helm repository cache" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 822 | (set -x; helm repo update >>$LOG 2>&1) >>$LOG 2>&1 |
| 823 | espin - $VERIFIED |
| 824 | |
| 825 | # Create and k8s service account so that Helm can create pods |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 826 | bspin - "Create Tiller ServiceAccount" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 827 | (set -x; kubectl create serviceaccount --namespace kube-system tiller >>$LOG 2>&1) >>$LOG 2>&1 |
| 828 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 829 | bspin - "Create Tiller ClusterRoleBinding" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 830 | (set -x; kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller >>$LOG 2>&1) >>$LOG 2>&1 |
| 831 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 832 | bspin - "Update Tiller Manifest" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 833 | (set -x; kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}' >>$LOG 2>&1) >>$LOG 2>&1 |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 834 | |
| 835 | # HACK (sort-of) - part to, spin it back up |
| 836 | (set -x; kubectl -n kube-system scale deploy tiller-deploy --replicas=1 >>$LOG 2>&1) >>$LOG 2>&1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 837 | espin - $VERIFIED |
| 838 | else |
| 839 | espin $VERIFIED |
| 840 | fi |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 841 | wait_for_pods - "kube-system" 1 -1 "Waiting for Tiller POD to start" "tiller-deploy-.*" |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 842 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 843 | timeout $(expr $(date +%s) - $STIME) |
| 844 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 845 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 846 | STIME=$(date +%s) |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 847 | bspin "Verify Helm values file: $NAME-values.yaml" |
| 848 | if [ ! -r "./$NAME-values.yaml" ]; then |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 849 | espin $NOT_VERIFIED |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 850 | bspin - "Download Helm values file: $TYPE-values.yaml to $NAME-values.yaml $DOWNLOAD" |
| 851 | (set -x; curl -o ./$NAME-values.yaml -sSL https://raw.githubusercontent.com/ciena/kind-voltha/master/$TYPE-values.yaml >>$LOG 2>&1) >>$LOG 2>&1 |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 852 | espin - $VERIFIED |
| 853 | else |
| 854 | espin $VERIFIED |
| 855 | fi |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 856 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 857 | timeout $(expr $(date +%s) - $STIME) |
| 858 | fi |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 859 | |
| 860 | if [ "$JUST_K8S" == "yes" ]; then |
| 861 | echo "Environment deployed, not deploying VOLTHA artifacts as requested. Good bye." |
| 862 | echo "" |
| 863 | echo "Please issue the following commands in your terminal to ensure that you" | tee -a $LOG |
| 864 | echo "are accessing the correct Kubernetes/Kind cluster as well as have the " | tee -a $LOG |
| 865 | echo "tools required by VOLTHA in your command path. " | tee -a $LOG |
| 866 | echo "" | tee -a $LOG |
| 867 | echo -en $BOLD |
| 868 | if [ $DEPLOY_K8S == "yes" ]; then |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 869 | echo "export KUBECONFIG=\"\$(./bin/kind get kubeconfig-path --name=\"voltha-$NAME\")\"" | tee -a $LOG |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 870 | fi |
| 871 | echo "export PATH=$GOPATH/bin:\$PATH" | tee -a $LOG |
| 872 | echo -en $NORMAL |
| 873 | echo "" | tee -a $LOG |
| 874 | echo "Thank you for choosing kind-voltha for you quick cluster needs." | tee -a $LOG |
| 875 | exit 0 |
| 876 | fi |
| 877 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 878 | STIME=$(date +%s) |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 879 | bspin "Verify ETCD Operator $OLD_KEY" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 880 | if [ $(helm list --deployed --short --namespace voltha "^etcd-operator\$" | wc -l) -ne 1 ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 881 | espin $NOT_VERIFIED |
| 882 | helm_install - voltha etcd-operator stable/etcd-operator "Install ETCD Operator" |
| 883 | else |
| 884 | espin $VERIFIED |
| 885 | fi |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 886 | EXPECT=$(test "$TYPE" == "minimal" && echo "1" || echo "3") |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 887 | wait_for_pods - "voltha" $EXPECT -1 "Waiting for ETCD Operator to start" "etcd-operator-.*" |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 888 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 889 | timeout $(expr $(date +%s) - $STIME) |
| 890 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 891 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 892 | STIME=$(date +%s) |
David Bainbridge | b270c20 | 2019-07-26 01:44:42 +0000 | [diff] [blame] | 893 | if [ $WITH_ONOS == "yes" ]; then |
| 894 | bspin "Verify ONOS installed $BIRD" |
| 895 | if [ $(helm list --deployed --short --namespace default "^onos\$" | wc -l) -ne 1 ]; then |
| 896 | espin $NOT_VERIFIED |
| 897 | helm_install - default onos onf/onos "Install ONOS" |
| 898 | else |
| 899 | espin $VERIFIED |
| 900 | fi |
| 901 | wait_for_pods - "default" 1 -1 "Waiting for ONOS to start" "onos-.*" |
| 902 | |
| 903 | bspin - "Forward ONOS API port $FORWARD" |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 904 | for i in $(screen -ls | grep onos-ui-$NAME | awk '{print $1}'); do |
David Bainbridge | 82bd121 | 2019-07-29 19:19:31 +0000 | [diff] [blame] | 905 | (set -x; screen -X -S $i quit >>$LOG 2>&1) >>$LOG 2>&1 |
| 906 | done |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 907 | (set -x; screen -dmS onos-ui-$NAME bash -c "while true; do kubectl port-forward service/onos-ui $ONOS_API_PORT:8181; done" >>$LOG 2>&1) >>$LOG 2>&1 |
David Bainbridge | b270c20 | 2019-07-26 01:44:42 +0000 | [diff] [blame] | 908 | espin - $VERIFIED |
| 909 | bspin - "Forward ONOS SSH port $FORWARD" |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 910 | for i in $(screen -ls | grep onos-ssh-$NAME | awk '{print $1}'); do |
David Bainbridge | 82bd121 | 2019-07-29 19:19:31 +0000 | [diff] [blame] | 911 | (set -x; screen -X -S $i quit >>$LOG 2>&1) >>$LOG 2>&1 |
| 912 | done |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 913 | (set -x; screen -dmS onos-ssh-$NAME bash -c "while true; do kubectl port-forward service/onos-ssh $ONOS_SSH_PORT:8101; done" >>$LOG 2>&1) >>$LOG 2>&1 |
David Bainbridge | b270c20 | 2019-07-26 01:44:42 +0000 | [diff] [blame] | 914 | espin - $VERIFIED |
David Bainbridge | d31d612 | 2019-08-13 19:37:59 +0000 | [diff] [blame^] | 915 | bspin - "Verify or download ONOS configuration support files $DOWNLOAD" |
| 916 | (set -x; mkdir -p ./onos-files >>$LOG 2>&1) >>$LOG 2>&1 |
| 917 | for i in dhcp-to-controller-flow.json olt-onos-enableExtraneousRules.json olt-onos-netcfg.json olt-onos-olt-settings.json radius-config.json; do |
| 918 | if [ ! -r ./onos-files/$i ]; then |
| 919 | (set -x; curl -o ./onos-files/$i -sSL https://raw.githubusercontent.com/ciena/kind-voltha/master/onos-files/$i >>$LOG 2>&1) >>$LOG 2>&1 |
| 920 | fi |
| 921 | done |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 922 | espin - $VERIFIED |
David Bainbridge | d31d612 | 2019-08-13 19:37:59 +0000 | [diff] [blame^] | 923 | |
| 924 | push_onos_config "Push ONOS Network Configuration" "network/configuration" "onos-files/olt-onos-netcfg.json" |
| 925 | push_onos_config "Enable VOLTHA ONOS DHCP provisioning" "configuration/org.opencord.olt.impl.Olt" "onos-files/olt-onos-olt-settings.json" |
| 926 | push_onos_config "Enabling extraneous rules for ONOS" "configuration/org.onosproject.net.flow.impl.FlowRuleManager" "onos-files/olt-onos-enableExtraneousRules.json" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 927 | fi |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 928 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 929 | timeout $(expr $(date +%s) - $STIME) |
| 930 | fi |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 931 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 932 | STIME=$(date +%s) |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 933 | bspin "Verify VOLTHA installed $HIGH_VOLTAGE" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 934 | if [ $(helm list --deployed --short --namespace voltha "^voltha\$" | wc -l) -ne 1 ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 935 | espin $NOT_VERIFIED |
David Bainbridge | e10f6d5 | 2019-07-25 00:28:13 +0000 | [diff] [blame] | 936 | helm_install - voltha voltha $VOLTHA_CHART "Install VOLTHA Core" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 937 | else |
| 938 | espin $VERIFIED |
| 939 | fi |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 940 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 941 | VOLTHA="ofagent-.* \ |
| 942 | ro-core.* \ |
| 943 | rw-core.* \ |
| 944 | voltha-api-server-.* \ |
| 945 | voltha-cli-server-.* \ |
| 946 | voltha-etcd-cluster-.* \ |
| 947 | voltha-kafka-.* \ |
| 948 | voltha-zookeeper-.*" |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 949 | EXPECT=$(test "$TYPE" == "minimal" && echo "9" || echo "11") |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 950 | wait_for_pods - "voltha" $EXPECT -1 "Waiting for VOLTHA Core to start" $VOLTHA |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 951 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 952 | timeout $(expr $(date +%s) - $STIME) |
| 953 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 954 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 955 | STIME=$(date +%s) |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 956 | echo -e "Verify Adapters $PLUG" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 957 | bspin - "Verify Simulated Adapters installed" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 958 | if [ $(helm list --deployed --short --namespace voltha "^sim\$" | wc -l) -ne 1 ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 959 | espin - $NOT_VERIFIED |
David Bainbridge | e10f6d5 | 2019-07-25 00:28:13 +0000 | [diff] [blame] | 960 | helm_install - voltha sim $VOLTHA_ADAPTER_SIM_CHART "Install Simulated Adapters" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 961 | else |
| 962 | espin - $VERIFIED |
| 963 | fi |
| 964 | |
| 965 | bspin - "Verify OpenOLT Adapter installed" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 966 | if [ $(helm list --deployed --short --namespace voltha "^open-olt\$" | wc -l) -ne 1 ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 967 | espin - $NOT_VERIFIED |
David Bainbridge | e10f6d5 | 2019-07-25 00:28:13 +0000 | [diff] [blame] | 968 | helm_install - voltha open-olt $VOLTHA_ADAPTER_OPEN_OLT_CHART "Install OpenOLT Adapter" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 969 | else |
| 970 | espin - $VERIFIED |
| 971 | fi |
| 972 | bspin - "Verify OpenONU Adapter installed" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 973 | if [ $(helm list --deployed --short --namespace voltha "^open-onu\$" | wc -l) -ne 1 ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 974 | espin - $NOT_VERIFIED |
David Bainbridge | e10f6d5 | 2019-07-25 00:28:13 +0000 | [diff] [blame] | 975 | helm_install - voltha open-onu $VOLTHA_ADAPTER_OPEN_ONU_CHART "Install OpenONU Adapter" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 976 | else |
| 977 | espin - $VERIFIED |
| 978 | fi |
| 979 | |
| 980 | ADAPTERS="adapter-.*" |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 981 | wait_for_pods - "voltha" 4 -1 "Waiting for adapters to start" $ADAPTERS |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 982 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 983 | timeout $(expr $(date +%s) - $STIME) |
| 984 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 985 | |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 986 | if [ $WITH_BBSIM == "yes" ]; then |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 987 | STIME=$(date +%s) |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 988 | echo -e "Verify BBSIM $PLUG" |
David Bainbridge | 5b7b96b | 2019-07-25 20:29:13 +0000 | [diff] [blame] | 989 | bspin - "Verify BBSIM Installed" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 990 | if [ $(helm list --deployed --short --namespace voltha "^bbsim\$" | wc -l) -ne 1 ]; then |
| 991 | espin - $NOT_VERIFIED |
| 992 | helm_install - voltha bbsim onf/bbsim "Install BBSIM" |
| 993 | else |
| 994 | espin - $VERIFIED |
| 995 | fi |
| 996 | wait_for_pods - "voltha" 1 -1 "Waiting for BBSIM to start" "bbsim-.*" |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 997 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 998 | timeout $(expr $(date +%s) - $STIME) |
| 999 | fi |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 1000 | fi |
| 1001 | |
David Bainbridge | 5b7b96b | 2019-07-25 20:29:13 +0000 | [diff] [blame] | 1002 | if [ $WITH_RADIUS == "yes" ]; then |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 1003 | STIME=$(date +%s) |
David Bainbridge | 5b7b96b | 2019-07-25 20:29:13 +0000 | [diff] [blame] | 1004 | echo -e "Verify RADIUS $LOCK" |
| 1005 | bspin - "Verify RADIUS Installed" |
| 1006 | if [ $(helm list --deployed --short --namespace voltha "^radius\$" | wc -l) -ne 1 ]; then |
| 1007 | espin - $NOT_VERIFIED |
| 1008 | helm_install - voltha radius onf/freeradius "Install RADIUS" |
| 1009 | else |
| 1010 | espin - $VERIFIED |
| 1011 | fi |
| 1012 | wait_for_pods - "voltha" 1 -1 "Waiting for RADIUS to start" "radius-.*" |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 1013 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 1014 | timeout $(expr $(date +%s) - $STIME) |
| 1015 | fi |
David Bainbridge | 5b7b96b | 2019-07-25 20:29:13 +0000 | [diff] [blame] | 1016 | fi |
| 1017 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 1018 | STIME=$(date +%s) |
David Bainbridge | e10f6d5 | 2019-07-25 00:28:13 +0000 | [diff] [blame] | 1019 | if [ $SKIP_RESTART_API == "no" ]; then |
| 1020 | echo -e "Restart VOLTHA API $RESTART" |
| 1021 | API="voltha-api-server-.* ofagent-.*" |
| 1022 | (set -x; kubectl scale --replicas=0 deployment -n voltha voltha-api-server ofagent >>$LOG 2>&1) >>$LOG 2>&1 |
| 1023 | wait_for_pods - "voltha" 0 -1 "Wait for API to stop $STOP" $API |
| 1024 | (set -x; kubectl scale --replicas=1 deployment -n voltha voltha-api-server ofagent >>$LOG 2>&1) >>$LOG 2>&1 |
| 1025 | wait_for_pods - "voltha" 2 -1 "Wait for API to re-start $GO" $API |
| 1026 | else |
| 1027 | bspin "Skip VOLTHA API Restart" |
| 1028 | espin $NO_ENTRY |
| 1029 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 1030 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 1031 | bspin - "Forward VOLTHA API port $FORWARD" |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1032 | for i in $(screen -ls | grep voltha-api-$NAME | awk '{print $1}'); do |
David Bainbridge | 82bd121 | 2019-07-29 19:19:31 +0000 | [diff] [blame] | 1033 | (set -x; screen -X -S $i quit >>$LOG 2>&1) >>$LOG 2>&1 |
| 1034 | done |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1035 | (set -x; screen -dmS voltha-api-$NAME bash -c "while true; do kubectl port-forward -n voltha service/voltha-api $VOLTHA_API_PORT:55555; done" >>$LOG 2>&1) >>$LOG 2>&1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 1036 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 1037 | bspin - "Forward VOLTHA SSH port $FORWARD" |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1038 | for i in $(screen -ls | grep voltha-ssh-$NAME | awk '{print $1}'); do |
David Bainbridge | 82bd121 | 2019-07-29 19:19:31 +0000 | [diff] [blame] | 1039 | (set -x; screen -X -S $i quit >>$LOG 2>&1) >>$LOG 2>&1 |
| 1040 | done |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1041 | (set -x; screen -dmS voltha-ssh-$NAME bash -c "while true; do kubectl port-forward -n voltha service/voltha-cli $VOLTHA_SSH_PORT:5022; done" >>$LOG 2>&1) >>$LOG 2>&1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 1042 | espin - $VERIFIED |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 1043 | bspin - "Forward VOLTHA ETCD port $FORWARD" |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1044 | for i in $(screen -ls | grep voltha-etcd-$NAME | awk '{print $1}'); do |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 1045 | (set -x; screen -X -S $i quit >>$LOG 2>&1) >>$LOG 2>&1 |
| 1046 | done |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1047 | (set -x; screen -dmS voltha-etcd-$NAME bash -c "while true; do kubectl port-forward -n voltha service/voltha-etcd-cluster-client $VOLTHA_ETCD_PORT:2379; done" >>$LOG 2>&1) >>$LOG 2>&1 |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 1048 | espin - $VERIFIED |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame] | 1049 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 1050 | timeout $(expr $(date +%s) - $STIME) |
| 1051 | fi |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 1052 | |
David Bainbridge | b270c20 | 2019-07-26 01:44:42 +0000 | [diff] [blame] | 1053 | if [ $WITH_ONOS == "yes" -a $WITH_RADIUS == "yes" ]; then |
David Bainbridge | 5b7b96b | 2019-07-25 20:29:13 +0000 | [diff] [blame] | 1054 | bspin "Configure ONOS RADIUS Connection $GEAR" |
| 1055 | (set -x; cat onos-files/radius-config.json | sed -e "s/:RADIUS_IP:/$(kubectl -n voltha get service/radius -o jsonpath={.spec.clusterIP})/g" | curl -XPOST -sSL http://karaf:karaf@localhost:8181/onos/v1/network/configuration -H Content-type:application/json -d@- >>$LOG 2>&1) >>$LOG 2>&1 |
| 1056 | espin $VERIFIED |
| 1057 | fi |
| 1058 | |
| 1059 | bspin "Create voltctl configuration file" |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 1060 | (set -x; mkdir -p $HOME/.volt >>$LOG 2>&1) >>$LOG 2>&1 |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1061 | (set -x; voltctl -a v2 -s localhost:$VOLTHA_API_PORT config > $HOME/.volt/config-$NAME 2>>$LOG) >>$LOG 2>&1 |
David Bainbridge | 5b7b96b | 2019-07-25 20:29:13 +0000 | [diff] [blame] | 1062 | espin $VERIFIED |
Test User | 08ebbd9 | 2019-07-03 17:15:39 +0000 | [diff] [blame] | 1063 | |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1064 | if [ ! -f "$NAME-env.sh" ]; then |
| 1065 | touch $NAME-env.sh |
David Bainbridge | b07fdf7 | 2019-07-29 22:51:40 +0000 | [diff] [blame] | 1066 | fi |
| 1067 | |
David Bainbridge | 596f30d | 2019-07-30 17:07:59 +0000 | [diff] [blame] | 1068 | for O in $ALL_OPTIONS; do |
| 1069 | VAL=$(eval echo \$$O) |
| 1070 | if [ $O == "USE_GO" ]; then |
| 1071 | VAL="$(echo $VAL| test $(grep -c true) -eq 1 && echo yes || echo no)" |
| 1072 | fi |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1073 | if [ ! -z "$VAL" -a $(grep -c "^export $O=" $NAME-env.sh) -eq 0 ]; then |
| 1074 | echo "export $O=\"$(eval echo \$$O)\"" >> $NAME-env.sh |
David Bainbridge | b07fdf7 | 2019-07-29 22:51:40 +0000 | [diff] [blame] | 1075 | fi |
| 1076 | done |
| 1077 | |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1078 | if [ $DEPLOY_K8S == "yes" -a $(grep -c "^export KUBECONFIG=" $NAME-env.sh) -eq 0 ]; then |
| 1079 | echo "export KUBECONFIG=\"$(./bin/kind get kubeconfig-path --name=voltha-$NAME)\"" >> $NAME-env.sh |
David Bainbridge | b07fdf7 | 2019-07-29 22:51:40 +0000 | [diff] [blame] | 1080 | fi |
| 1081 | |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1082 | if [ $(grep -c "^export VOLTCONFIG=" $NAME-env.sh) -eq 0 ]; then |
| 1083 | echo "export VOLTCONFIG=\"$HOME/.volt/config-$NAME\"" >> $NAME-env.sh |
David Bainbridge | b07fdf7 | 2019-07-29 22:51:40 +0000 | [diff] [blame] | 1084 | fi |
| 1085 | |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1086 | if [ $(grep -c "^export PATH=" $NAME-env.sh) -eq 0 ]; then |
| 1087 | echo "export PATH=\"$GOPATH/bin:\$PATH\"" >> $NAME-env.sh |
David Bainbridge | b07fdf7 | 2019-07-29 22:51:40 +0000 | [diff] [blame] | 1088 | fi |
| 1089 | |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 1090 | echo "" |
Test User | 08ebbd9 | 2019-07-03 17:15:39 +0000 | [diff] [blame] | 1091 | echo "Please issue the following commands in your terminal to ensure that you" | tee -a $LOG |
| 1092 | echo "are accessing the correct Kubernetes/Kind cluster as well as have the " | tee -a $LOG |
| 1093 | echo "tools required by VOLTHA in your command path. " | tee -a $LOG |
| 1094 | echo "" | tee -a $LOG |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 1095 | echo -en $BOLD |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 1096 | if [ $DEPLOY_K8S == "yes" ]; then |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1097 | echo "export KUBECONFIG=\"\$(./bin/kind get kubeconfig-path --name=\"voltha-$NAME\")\"" | tee -a $LOG |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 1098 | fi |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1099 | echo "export VOLTCONFIG=\"$HOME/.volt/config-$NAME\"" | tee -a $LOG |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 1100 | echo "export PATH=$GOPATH/bin:\$PATH" | tee -a $LOG |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 1101 | echo -en $NORMAL |
Test User | 08ebbd9 | 2019-07-03 17:15:39 +0000 | [diff] [blame] | 1102 | echo "" | tee -a $LOG |
| 1103 | echo "Thank you for choosing kind-voltha for you quick cluster needs." | tee -a $LOG |
| 1104 | |