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 | |
| 565 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 566 | count_pods() { |
| 567 | local NAMESPACE=$1; shift |
| 568 | local PODS=$(kubectl -n $NAMESPACE get pod -o go-template="{{range .items}}{{.metadata.name}}/{{.status.phase}}/_{{range .status.containerStatuses}}{{.ready}}_{{end}} {{end}}") |
| 569 | local COUNT=0 |
| 570 | local PATTERNS=$* |
| 571 | for POD in $PODS; do |
| 572 | local NAME=$(echo $POD | cut -d/ -f 1) |
| 573 | local STATE=$(echo $POD | cut -d/ -f 2) |
| 574 | local CONTAINERS=$(echo $POD | cut -d/ -f 3 | sed -e 's/_/ /g') |
| 575 | if [ "$STATE" == "Running" ]; then |
| 576 | local TOTAL=$(echo $CONTAINERS | wc -w) |
| 577 | local FOUND=$(echo $CONTAINERS | grep -o true | wc -l) |
| 578 | if [ $TOTAL -eq $FOUND ]; then |
| 579 | for PATTERN in $PATTERNS; do |
| 580 | if [[ $NAME =~ $PATTERN ]]; then |
| 581 | COUNT=$(expr $COUNT + 1) |
| 582 | fi |
| 583 | done |
| 584 | fi |
| 585 | fi |
| 586 | done |
| 587 | echo $COUNT |
| 588 | } |
| 589 | |
| 590 | wait_for_pods() { |
| 591 | local INDENT= |
| 592 | if [ "$1" == "-" ]; then |
| 593 | INDENT=$1; shift |
| 594 | fi |
| 595 | local NAMESPACE=$1; shift |
| 596 | local EXPECT=$1; shift |
| 597 | local RETRY=$1; shift |
| 598 | local MESSAGE=$1; shift |
| 599 | local PATTERNS=$* |
| 600 | local HAVE=$(count_pods $NAMESPACE $PATTERNS) |
| 601 | COUNT=$(expr 300 / 15) |
| 602 | bspin $INDENT $MESSAGE |
| 603 | sspin $INDENT |
| 604 | if [ $HAVE -ne $EXPECT ]; then |
| 605 | while [ $HAVE -ne $EXPECT ]; do |
| 606 | sspin $INDENT |
| 607 | COUNT=$(expr $COUNT - 1) |
| 608 | if [ $COUNT -eq 0 ]; then |
| 609 | HAVE=$(count_pods $NAMESPACE $PATTERNS) |
| 610 | COUNT=$(expr 300 / 15) |
| 611 | fi |
| 612 | sleep .15 |
| 613 | done |
| 614 | fi |
| 615 | espin $INDENT $VERIFIED |
| 616 | if [ $HAVE -ne $EXPECT ]; then |
| 617 | return 1 |
| 618 | fi |
| 619 | return 0 |
| 620 | } |
| 621 | |
| 622 | helm_install() { |
| 623 | local INDENT= |
| 624 | if [ "$1" == "-" ]; then |
| 625 | INDENT=$1; shift |
| 626 | fi |
| 627 | local NAMESPACE=$1; shift |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 628 | local INAME=$1; shift |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 629 | local CHART=$1; shift |
| 630 | local MESSAGE=$* |
| 631 | |
| 632 | COUNT=$(expr 300 / 15) |
| 633 | bspin $INDENT $MESSAGE |
David Bainbridge | 458bb66 | 2019-08-02 20:04:23 +0000 | [diff] [blame] | 634 | (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] | 635 | SUCCESS=$? |
| 636 | while [ $SUCCESS -ne 0 ]; do |
| 637 | sspin $INDENT |
| 638 | COUNT=$(expr $COUNT - 1) |
| 639 | if [ $COUNT -eq 0 ]; then |
David Bainbridge | 458bb66 | 2019-08-02 20:04:23 +0000 | [diff] [blame] | 640 | (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] | 641 | COUNT=$(expr 300 / 15) |
| 642 | fi |
| 643 | sleep .15 |
| 644 | done |
| 645 | espin $INDENT $VERIFIED |
| 646 | } |
| 647 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 648 | echo "INSTALL TYPE: $TYPE" >> $LOG |
| 649 | |
| 650 | bspin "Verify GOPATH" |
| 651 | export GOPATH=$(pwd) |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 652 | mkdir -p $GOPATH/bin |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 653 | espin $VERIFIED |
| 654 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 655 | STIME=$(date +%s) |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 656 | if [ "$INSTALL_KUBECTL" == "no" ]; then |
| 657 | bspin "Skip kubectl install" |
| 658 | espin $NO_ENTRY |
Test User | c13bdc9 | 2019-07-03 20:57:49 +0000 | [diff] [blame] | 659 | else |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 660 | bspin "Verify kubectl $HELM" |
| 661 | if [ -x $GOPATH/bin/kubectl ]; then |
| 662 | espin $VERIFIED |
| 663 | else |
| 664 | espin $NOT_VERIFIED |
| 665 | bspin - "Download and install Kubernetes/kubectl $DOWNLOAD" |
| 666 | (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 |
| 667 | (set -x; chmod 755 $GOPATH/bin/kubectl >>$LOG 2>&1) >>$LOG 2>&1 |
| 668 | espin - $VERIFIED |
| 669 | fi |
Test User | c13bdc9 | 2019-07-03 20:57:49 +0000 | [diff] [blame] | 670 | fi |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 671 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 672 | timeout $(expr $(date +%s) - $STIME) |
| 673 | fi |
Test User | c13bdc9 | 2019-07-03 20:57:49 +0000 | [diff] [blame] | 674 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 675 | STIME=$(date +%s) |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 676 | if [ "$DEPLOY_K8S" == "no" ]; then |
| 677 | bspin "Skip Kubernetes/Kind Deployment" |
| 678 | espin $NO_ENTRY |
| 679 | else |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 680 | bspin "Verify Kubernetes/Kind $HELM" |
| 681 | if [ -x $GOPATH/bin/kind ]; then |
| 682 | espin $VERIFIED |
| 683 | else |
| 684 | espin $NOT_VERIFIED |
| 685 | bspin - "Download and install Kubernetes/kind $DOWNLOAD" |
David Bainbridge | 9e2a666 | 2019-07-11 17:07:57 +0000 | [diff] [blame] | 686 | (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] | 687 | (set -x; chmod 755 $GOPATH/bin/kind >>$LOG 2>&1) >>$LOG 2>&1 |
| 688 | espin - $VERIFIED |
| 689 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 690 | fi |
| 691 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 692 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 693 | timeout $(expr $(date +%s) - $STIME) |
| 694 | fi |
| 695 | |
| 696 | STIME=$(date +%s) |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 697 | if [ "$INSTALL_HELM" == "no" ]; then |
| 698 | bspin "Skip Helm Install" |
| 699 | espin $NO_ENTRY |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 700 | else |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 701 | bspin "Verify Helm $HELM" |
| 702 | if [ -x $GOPATH/bin/helm ]; then |
| 703 | espin $VERIFIED |
| 704 | else |
| 705 | espin $NOT_VERIFIED |
| 706 | bspin - "Download and install Helm $DOWNLOAD" |
| 707 | (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 |
| 708 | espin - $VERIFIED |
| 709 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 710 | fi |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 711 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 712 | timeout $(expr $(date +%s) - $STIME) |
| 713 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 714 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 715 | STIME=$(date +%s) |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 716 | bspin "Verify voltctl $HIGH_VOLTAGE" |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 717 | if [ -x $GOPATH/bin/voltctl ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 718 | espin $VERIFIED |
| 719 | else |
| 720 | espin $NOT_VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 721 | bspin - "Download and build voltctl $DOWNLOAD" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 722 | (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] | 723 | (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] | 724 | espin - $VERIFIED |
| 725 | fi |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 726 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 727 | timeout $(expr $(date +%s) - $STIME) |
| 728 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 729 | |
| 730 | bspin "Verify command PATH" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 731 | export PATH=$GOPATH/bin:$PATH |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 732 | espin $VERIFIED |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 733 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 734 | STIME=$(date +%s) |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 735 | if [ "$DEPLOY_K8S" == "yes" ]; then |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 736 | HAVE=$(kind get clusters | grep -c voltha-$NAME) |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 737 | bspin "Verify Kubernetes/Kind Cluster" |
| 738 | sspin |
| 739 | if [ $HAVE -eq 0 ]; then |
David Bainbridge | 491b1bd | 2019-07-11 17:53:11 +0000 | [diff] [blame] | 740 | espin $NOT_VERIFIED |
| 741 | bspin - "Verify cluster configuration" |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 742 | if [ ! -r ./$NAME-cluster.cfg ]; then |
David Bainbridge | 491b1bd | 2019-07-11 17:53:11 +0000 | [diff] [blame] | 743 | espin - $NOT_VERIFIED |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 744 | bspin - "Download cluster configuration: $TYPE-cluster.cfg to $NAME-cluster.cfg $DOWNLOAD" |
| 745 | (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] | 746 | espin - $VERIFIED |
| 747 | else |
| 748 | espin - $VERIFIED |
| 749 | fi |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 750 | kind create cluster --name voltha-$NAME --config $NAME-cluster.cfg |
David Bainbridge | 491b1bd | 2019-07-11 17:53:11 +0000 | [diff] [blame] | 751 | else |
| 752 | espin $VERIFIED |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 753 | fi |
| 754 | |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 755 | export KUBECONFIG="$(kind get kubeconfig-path --name="voltha-$NAME")" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 756 | P="coredns-.* \ |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 757 | etcd-voltha-$NAME-control-plane \ |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 758 | kindnet-.* \ |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 759 | kube-apiserver-voltha-$NAME-control-plane \ |
| 760 | kube-controller-manager-voltha-$NAME-control-plane \ |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 761 | kube-proxy-.* \ |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 762 | kube-scheduler-voltha-$NAME-control-plane" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 763 | |
| 764 | EXPECT=$(test "$TYPE" == "minimal" && echo "12" || echo "14") |
| 765 | 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] | 766 | fi |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 767 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 768 | timeout $(expr $(date +%s) - $STIME) |
| 769 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 770 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 771 | STIME=$(date +%s) |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 772 | COUNT=$(count_pods "kube-system" "tiller-deploy-.*") |
| 773 | bspin "Verify Helm" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 774 | if [ $COUNT -ne 1 ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 775 | espin $NOT_VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 776 | echo -e "Configuring Helm $GEAR" |
David K. Bainbridge | 0e89cb9 | 2019-07-17 11:30:10 -0700 | [diff] [blame] | 777 | if [ "$INSTALL_HELM" == "no" ]; then |
| 778 | bspin - "Skip Helm/Tiller Initialization" |
| 779 | espin - $NO_ENTRY |
| 780 | else |
| 781 | bspin - "Initialize Helm" |
| 782 | (set -x; helm init --upgrade >>$LOG 2>&1) >>$LOG 2>&1 |
| 783 | espin - $VERIFIED |
| 784 | wait_for_pods - "kube-system" 1 -1 "Waiting for Tiller POD to start" "tiller-deploy-.*" |
| 785 | fi |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 786 | bspin - "Add Google Incubator repository to Helm" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 787 | (set -x; helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com >>$LOG 2>&1) >>$LOG 2>&1 |
| 788 | espin - $VERIFIED |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 789 | |
| 790 | # HACK (sort-of) - the config for tiller is about to be patched, which will |
| 791 | # cause the tiller pod to be recreated. This can sometimes cause a timing |
| 792 | # issue with the "wait_for_pods" call on tiller as it may incorrectly |
| 793 | # identify the running/ready tiller pod that is soon to be terminated as |
| 794 | # what it is waiting for. To avoid this issue we do a clean scale down and |
| 795 | # scale up of the pod so the script controlls when it should be expecting |
| 796 | # things |
| 797 | (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] | 798 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 799 | bspin - "Add Google Stable repository to Helm" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 800 | (set -x; helm repo add stable https://kubernetes-charts.storage.googleapis.com >>$LOG 2>&1) >>$LOG 2>&1 |
| 801 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 802 | bspin - "Add ONF repository to Helm" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 803 | (set -x; helm repo add onf https://charts.opencord.org >>$LOG 2>&1) >>$LOG 2>&1 |
| 804 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 805 | bspin - "Update Helm repository cache" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 806 | (set -x; helm repo update >>$LOG 2>&1) >>$LOG 2>&1 |
| 807 | espin - $VERIFIED |
| 808 | |
| 809 | # Create and k8s service account so that Helm can create pods |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 810 | bspin - "Create Tiller ServiceAccount" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 811 | (set -x; kubectl create serviceaccount --namespace kube-system tiller >>$LOG 2>&1) >>$LOG 2>&1 |
| 812 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 813 | bspin - "Create Tiller ClusterRoleBinding" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 814 | (set -x; kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller >>$LOG 2>&1) >>$LOG 2>&1 |
| 815 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 816 | bspin - "Update Tiller Manifest" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 817 | (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] | 818 | |
| 819 | # HACK (sort-of) - part to, spin it back up |
| 820 | (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] | 821 | espin - $VERIFIED |
| 822 | else |
| 823 | espin $VERIFIED |
| 824 | fi |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 825 | 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^] | 826 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 827 | timeout $(expr $(date +%s) - $STIME) |
| 828 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 829 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 830 | STIME=$(date +%s) |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 831 | bspin "Verify Helm values file: $NAME-values.yaml" |
| 832 | if [ ! -r "./$NAME-values.yaml" ]; then |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 833 | espin $NOT_VERIFIED |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 834 | bspin - "Download Helm values file: $TYPE-values.yaml to $NAME-values.yaml $DOWNLOAD" |
| 835 | (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] | 836 | espin - $VERIFIED |
| 837 | else |
| 838 | espin $VERIFIED |
| 839 | fi |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 840 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 841 | timeout $(expr $(date +%s) - $STIME) |
| 842 | fi |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 843 | |
| 844 | if [ "$JUST_K8S" == "yes" ]; then |
| 845 | echo "Environment deployed, not deploying VOLTHA artifacts as requested. Good bye." |
| 846 | echo "" |
| 847 | echo "Please issue the following commands in your terminal to ensure that you" | tee -a $LOG |
| 848 | echo "are accessing the correct Kubernetes/Kind cluster as well as have the " | tee -a $LOG |
| 849 | echo "tools required by VOLTHA in your command path. " | tee -a $LOG |
| 850 | echo "" | tee -a $LOG |
| 851 | echo -en $BOLD |
| 852 | if [ $DEPLOY_K8S == "yes" ]; then |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 853 | 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] | 854 | fi |
| 855 | echo "export PATH=$GOPATH/bin:\$PATH" | tee -a $LOG |
| 856 | echo -en $NORMAL |
| 857 | echo "" | tee -a $LOG |
| 858 | echo "Thank you for choosing kind-voltha for you quick cluster needs." | tee -a $LOG |
| 859 | exit 0 |
| 860 | fi |
| 861 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 862 | STIME=$(date +%s) |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 863 | bspin "Verify ETCD Operator $OLD_KEY" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 864 | 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] | 865 | espin $NOT_VERIFIED |
| 866 | helm_install - voltha etcd-operator stable/etcd-operator "Install ETCD Operator" |
| 867 | else |
| 868 | espin $VERIFIED |
| 869 | fi |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 870 | EXPECT=$(test "$TYPE" == "minimal" && echo "1" || echo "3") |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 871 | 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^] | 872 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 873 | timeout $(expr $(date +%s) - $STIME) |
| 874 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 875 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 876 | STIME=$(date +%s) |
David Bainbridge | b270c20 | 2019-07-26 01:44:42 +0000 | [diff] [blame] | 877 | if [ $WITH_ONOS == "yes" ]; then |
| 878 | bspin "Verify ONOS installed $BIRD" |
| 879 | if [ $(helm list --deployed --short --namespace default "^onos\$" | wc -l) -ne 1 ]; then |
| 880 | espin $NOT_VERIFIED |
| 881 | helm_install - default onos onf/onos "Install ONOS" |
| 882 | else |
| 883 | espin $VERIFIED |
| 884 | fi |
| 885 | wait_for_pods - "default" 1 -1 "Waiting for ONOS to start" "onos-.*" |
| 886 | |
| 887 | bspin - "Forward ONOS API port $FORWARD" |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 888 | 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] | 889 | (set -x; screen -X -S $i quit >>$LOG 2>&1) >>$LOG 2>&1 |
| 890 | done |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 891 | (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] | 892 | espin - $VERIFIED |
| 893 | bspin - "Forward ONOS SSH port $FORWARD" |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 894 | 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] | 895 | (set -x; screen -X -S $i quit >>$LOG 2>&1) >>$LOG 2>&1 |
| 896 | done |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 897 | (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] | 898 | espin - $VERIFIED |
| 899 | if [ ! -x ./onos-files/install-onos-applications.sh ]; then |
| 900 | bspin - "Verify or download ONOS configuration support files $DOWNLOAD" |
| 901 | (set -x; mkdir -p ./onos-files >>$LOG 2>&1) >>$LOG 2>&1 |
| 902 | for i in dhcp-to-controller-flow.json install-onos-applications.sh olt-onos-enableExtraneousRules.json olt-onos-netcfg.json olt-onos-olt-settings.json radius-config.json; do |
| 903 | if [ ! -r ./onos-files/$i ]; then |
| 904 | (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 |
| 905 | fi |
| 906 | done |
| 907 | (set -x; chmod 755 ./onos-files/install-onos-applications.sh >>$LOG 2>&1) >>$LOG 2>&1 |
| 908 | espin - $VERIFIED |
| 909 | fi |
| 910 | |
| 911 | bspin - "Install required ONOS applications $INSTALL" |
| 912 | (set -x; ./onos-files/install-onos-applications.sh >>$LOG 2>&1) >>$LOG 2>&1 |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 913 | espin - $VERIFIED |
| 914 | fi |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 915 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 916 | timeout $(expr $(date +%s) - $STIME) |
| 917 | fi |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 918 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 919 | STIME=$(date +%s) |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 920 | bspin "Verify VOLTHA installed $HIGH_VOLTAGE" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 921 | 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] | 922 | espin $NOT_VERIFIED |
David Bainbridge | e10f6d5 | 2019-07-25 00:28:13 +0000 | [diff] [blame] | 923 | helm_install - voltha voltha $VOLTHA_CHART "Install VOLTHA Core" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 924 | else |
| 925 | espin $VERIFIED |
| 926 | fi |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 927 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 928 | VOLTHA="ofagent-.* \ |
| 929 | ro-core.* \ |
| 930 | rw-core.* \ |
| 931 | voltha-api-server-.* \ |
| 932 | voltha-cli-server-.* \ |
| 933 | voltha-etcd-cluster-.* \ |
| 934 | voltha-kafka-.* \ |
| 935 | voltha-zookeeper-.*" |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 936 | EXPECT=$(test "$TYPE" == "minimal" && echo "9" || echo "11") |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 937 | 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^] | 938 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 939 | timeout $(expr $(date +%s) - $STIME) |
| 940 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 941 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 942 | STIME=$(date +%s) |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 943 | echo -e "Verify Adapters $PLUG" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 944 | bspin - "Verify Simulated Adapters installed" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 945 | 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] | 946 | espin - $NOT_VERIFIED |
David Bainbridge | e10f6d5 | 2019-07-25 00:28:13 +0000 | [diff] [blame] | 947 | helm_install - voltha sim $VOLTHA_ADAPTER_SIM_CHART "Install Simulated Adapters" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 948 | else |
| 949 | espin - $VERIFIED |
| 950 | fi |
| 951 | |
| 952 | bspin - "Verify OpenOLT Adapter installed" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 953 | 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] | 954 | espin - $NOT_VERIFIED |
David Bainbridge | e10f6d5 | 2019-07-25 00:28:13 +0000 | [diff] [blame] | 955 | 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] | 956 | else |
| 957 | espin - $VERIFIED |
| 958 | fi |
| 959 | bspin - "Verify OpenONU Adapter installed" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 960 | 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] | 961 | espin - $NOT_VERIFIED |
David Bainbridge | e10f6d5 | 2019-07-25 00:28:13 +0000 | [diff] [blame] | 962 | 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] | 963 | else |
| 964 | espin - $VERIFIED |
| 965 | fi |
| 966 | |
| 967 | ADAPTERS="adapter-.*" |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 968 | wait_for_pods - "voltha" 4 -1 "Waiting for adapters to start" $ADAPTERS |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 969 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 970 | timeout $(expr $(date +%s) - $STIME) |
| 971 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 972 | |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 973 | if [ $WITH_BBSIM == "yes" ]; then |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 974 | STIME=$(date +%s) |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 975 | echo -e "Verify BBSIM $PLUG" |
David Bainbridge | 5b7b96b | 2019-07-25 20:29:13 +0000 | [diff] [blame] | 976 | bspin - "Verify BBSIM Installed" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 977 | if [ $(helm list --deployed --short --namespace voltha "^bbsim\$" | wc -l) -ne 1 ]; then |
| 978 | espin - $NOT_VERIFIED |
| 979 | helm_install - voltha bbsim onf/bbsim "Install BBSIM" |
| 980 | else |
| 981 | espin - $VERIFIED |
| 982 | fi |
| 983 | wait_for_pods - "voltha" 1 -1 "Waiting for BBSIM to start" "bbsim-.*" |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 984 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 985 | timeout $(expr $(date +%s) - $STIME) |
| 986 | fi |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 987 | fi |
| 988 | |
David Bainbridge | 5b7b96b | 2019-07-25 20:29:13 +0000 | [diff] [blame] | 989 | if [ $WITH_RADIUS == "yes" ]; then |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 990 | STIME=$(date +%s) |
David Bainbridge | 5b7b96b | 2019-07-25 20:29:13 +0000 | [diff] [blame] | 991 | echo -e "Verify RADIUS $LOCK" |
| 992 | bspin - "Verify RADIUS Installed" |
| 993 | if [ $(helm list --deployed --short --namespace voltha "^radius\$" | wc -l) -ne 1 ]; then |
| 994 | espin - $NOT_VERIFIED |
| 995 | helm_install - voltha radius onf/freeradius "Install RADIUS" |
| 996 | else |
| 997 | espin - $VERIFIED |
| 998 | fi |
| 999 | wait_for_pods - "voltha" 1 -1 "Waiting for RADIUS to start" "radius-.*" |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 1000 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 1001 | timeout $(expr $(date +%s) - $STIME) |
| 1002 | fi |
David Bainbridge | 5b7b96b | 2019-07-25 20:29:13 +0000 | [diff] [blame] | 1003 | fi |
| 1004 | |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 1005 | STIME=$(date +%s) |
David Bainbridge | e10f6d5 | 2019-07-25 00:28:13 +0000 | [diff] [blame] | 1006 | if [ $SKIP_RESTART_API == "no" ]; then |
| 1007 | echo -e "Restart VOLTHA API $RESTART" |
| 1008 | API="voltha-api-server-.* ofagent-.*" |
| 1009 | (set -x; kubectl scale --replicas=0 deployment -n voltha voltha-api-server ofagent >>$LOG 2>&1) >>$LOG 2>&1 |
| 1010 | wait_for_pods - "voltha" 0 -1 "Wait for API to stop $STOP" $API |
| 1011 | (set -x; kubectl scale --replicas=1 deployment -n voltha voltha-api-server ofagent >>$LOG 2>&1) >>$LOG 2>&1 |
| 1012 | wait_for_pods - "voltha" 2 -1 "Wait for API to re-start $GO" $API |
| 1013 | else |
| 1014 | bspin "Skip VOLTHA API Restart" |
| 1015 | espin $NO_ENTRY |
| 1016 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 1017 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 1018 | bspin - "Forward VOLTHA API port $FORWARD" |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1019 | 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] | 1020 | (set -x; screen -X -S $i quit >>$LOG 2>&1) >>$LOG 2>&1 |
| 1021 | done |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1022 | (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] | 1023 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 1024 | bspin - "Forward VOLTHA SSH port $FORWARD" |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1025 | 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] | 1026 | (set -x; screen -X -S $i quit >>$LOG 2>&1) >>$LOG 2>&1 |
| 1027 | done |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1028 | (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] | 1029 | espin - $VERIFIED |
David Bainbridge | ac7f807 | 2019-08-01 22:15:33 +0000 | [diff] [blame] | 1030 | bspin - "Forward VOLTHA ETCD port $FORWARD" |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1031 | 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] | 1032 | (set -x; screen -X -S $i quit >>$LOG 2>&1) >>$LOG 2>&1 |
| 1033 | done |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1034 | (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] | 1035 | espin - $VERIFIED |
David Bainbridge | e87067b | 2019-08-12 22:00:12 +0000 | [diff] [blame^] | 1036 | if [ "$WITH_TIMINGS" == "yes" ]; then |
| 1037 | timeout $(expr $(date +%s) - $STIME) |
| 1038 | fi |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 1039 | |
David Bainbridge | b270c20 | 2019-07-26 01:44:42 +0000 | [diff] [blame] | 1040 | if [ $WITH_ONOS == "yes" -a $WITH_RADIUS == "yes" ]; then |
David Bainbridge | 5b7b96b | 2019-07-25 20:29:13 +0000 | [diff] [blame] | 1041 | bspin "Configure ONOS RADIUS Connection $GEAR" |
| 1042 | (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 |
| 1043 | espin $VERIFIED |
| 1044 | fi |
| 1045 | |
| 1046 | bspin "Create voltctl configuration file" |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 1047 | (set -x; mkdir -p $HOME/.volt >>$LOG 2>&1) >>$LOG 2>&1 |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1048 | (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] | 1049 | espin $VERIFIED |
Test User | 08ebbd9 | 2019-07-03 17:15:39 +0000 | [diff] [blame] | 1050 | |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1051 | if [ ! -f "$NAME-env.sh" ]; then |
| 1052 | touch $NAME-env.sh |
David Bainbridge | b07fdf7 | 2019-07-29 22:51:40 +0000 | [diff] [blame] | 1053 | fi |
| 1054 | |
David Bainbridge | 596f30d | 2019-07-30 17:07:59 +0000 | [diff] [blame] | 1055 | for O in $ALL_OPTIONS; do |
| 1056 | VAL=$(eval echo \$$O) |
| 1057 | if [ $O == "USE_GO" ]; then |
| 1058 | VAL="$(echo $VAL| test $(grep -c true) -eq 1 && echo yes || echo no)" |
| 1059 | fi |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1060 | if [ ! -z "$VAL" -a $(grep -c "^export $O=" $NAME-env.sh) -eq 0 ]; then |
| 1061 | echo "export $O=\"$(eval echo \$$O)\"" >> $NAME-env.sh |
David Bainbridge | b07fdf7 | 2019-07-29 22:51:40 +0000 | [diff] [blame] | 1062 | fi |
| 1063 | done |
| 1064 | |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1065 | if [ $DEPLOY_K8S == "yes" -a $(grep -c "^export KUBECONFIG=" $NAME-env.sh) -eq 0 ]; then |
| 1066 | 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] | 1067 | fi |
| 1068 | |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1069 | if [ $(grep -c "^export VOLTCONFIG=" $NAME-env.sh) -eq 0 ]; then |
| 1070 | echo "export VOLTCONFIG=\"$HOME/.volt/config-$NAME\"" >> $NAME-env.sh |
David Bainbridge | b07fdf7 | 2019-07-29 22:51:40 +0000 | [diff] [blame] | 1071 | fi |
| 1072 | |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1073 | if [ $(grep -c "^export PATH=" $NAME-env.sh) -eq 0 ]; then |
| 1074 | echo "export PATH=\"$GOPATH/bin:\$PATH\"" >> $NAME-env.sh |
David Bainbridge | b07fdf7 | 2019-07-29 22:51:40 +0000 | [diff] [blame] | 1075 | fi |
| 1076 | |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 1077 | echo "" |
Test User | 08ebbd9 | 2019-07-03 17:15:39 +0000 | [diff] [blame] | 1078 | echo "Please issue the following commands in your terminal to ensure that you" | tee -a $LOG |
| 1079 | echo "are accessing the correct Kubernetes/Kind cluster as well as have the " | tee -a $LOG |
| 1080 | echo "tools required by VOLTHA in your command path. " | tee -a $LOG |
| 1081 | echo "" | tee -a $LOG |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 1082 | echo -en $BOLD |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 1083 | if [ $DEPLOY_K8S == "yes" ]; then |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1084 | 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] | 1085 | fi |
David Bainbridge | 0774b23 | 2019-08-02 06:37:19 +0000 | [diff] [blame] | 1086 | echo "export VOLTCONFIG=\"$HOME/.volt/config-$NAME\"" | tee -a $LOG |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 1087 | echo "export PATH=$GOPATH/bin:\$PATH" | tee -a $LOG |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 1088 | echo -en $NORMAL |
Test User | 08ebbd9 | 2019-07-03 17:15:39 +0000 | [diff] [blame] | 1089 | echo "" | tee -a $LOG |
| 1090 | echo "Thank you for choosing kind-voltha for you quick cluster needs." | tee -a $LOG |
| 1091 | |