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 | |
| 16 | # trap ctrl-c and call ctrl_c() |
| 17 | trap ctrl_c INT |
| 18 | |
| 19 | function ctrl_c() { |
| 20 | tput cnorm |
| 21 | echo "" |
| 22 | echo "ctrl-c trapped" |
| 23 | echo "Thank you for trying 'votlha up'" |
| 24 | exit |
| 25 | } |
| 26 | |
Test User | 08ebbd9 | 2019-07-03 17:15:39 +0000 | [diff] [blame] | 27 | VOLTCTL_VERSION=${VOLTCTL_VERSION:-0.0.5-dev} |
| 28 | KIND_VERSION=${KIND_VERSION:-v0.4.0} |
| 29 | _VOLTCTL_VERSION=$(echo $VOLTCTL_VERSION | sed -e 's/-/_/g') |
| 30 | |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 31 | NOCOLOR="\u001b[0m" |
| 32 | BLACK=$(tput setaf 0) |
| 33 | RED=$(tput setaf 1) |
| 34 | GREEN=$(tput setaf 2) |
| 35 | YELLOW=$(tput setaf 3) |
| 36 | BLUE=$(tput setaf 4) |
| 37 | MAGENTA=$(tput setaf 5) |
| 38 | CYAN=$(tput setaf 6) |
| 39 | WHITE=$(tput setaf 7) |
| 40 | BOLD=$(tput bold) |
| 41 | NORMAL=$(tput sgr0) |
| 42 | ERROR="\xe2\x9c\x97\x20" |
| 43 | |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 44 | TYPE=${TYPE:-minimal} |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 45 | WITH_BBSIM=${WITH_BBSIM:-no} |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 46 | JUST_K8S=${JUST_K8S:-no} |
| 47 | DEPLOY_K8S=${DEPLOY_K8S:-yes} |
| 48 | |
| 49 | HAVE_GO=$(which go >/dev/null 2>&1 && echo "yes" || echo "no") |
| 50 | HOSTOS=$(uname -s | tr "[:upper:]" "[:lower:"]) |
| 51 | HOSTARCH=$(uname -m | tr "[:upper:]" "[:lower:"]) |
| 52 | if [ $HOSTARCH == "x86_64" ]; then |
| 53 | HOSTARCH="amd64" |
| 54 | fi |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 55 | |
| 56 | # Verify TYPE setting |
| 57 | if [ $(echo ":minimal:full:" | grep -ic ":$TYPE:") -eq 0 ]; then |
| 58 | >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$TYPE value of '$TYPE'. Should be 'minimal' or 'full'${NOCOLOR}" |
| 59 | exit 1 |
| 60 | fi |
| 61 | |
| 62 | # Verify WITH_BBSIM settting and convert uniform value of yes or no |
| 63 | if [ $(echo ":y:yes:true:n:no:false:1:0:" | grep -ic ":$WITH_BBSIM:") -eq 0 ]; then |
| 64 | >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$WITH_BBSIM value of '$WITH_BBSIM'. Should be 'yes' or 'no'${NOCOLOR}" |
| 65 | exit 1 |
| 66 | fi |
| 67 | if [ $(echo ":y:yes:true:1:" | grep -ic ":$WITH_BBSIM:") -eq 1 ]; then |
| 68 | WITH_BBSIM=yes |
| 69 | else |
| 70 | WITH_BBSIM=no |
| 71 | fi |
| 72 | |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 73 | # Verify JUST_K8S settting and convert uniform value of yes or no |
| 74 | if [ $(echo ":y:yes:true:n:no:false:1:0:" | grep -ic ":$JUST_K8S:") -eq 0 ]; then |
| 75 | >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$JUST_K8S value of '$JUST_K8S'. Should be 'yes' or 'no'${NOCOLOR}" |
| 76 | exit 1 |
| 77 | fi |
| 78 | if [ $(echo ":y:yes:true:1:" | grep -ic ":$JUST_K8S:") -eq 1 ]; then |
| 79 | JUST_K8S=yes |
| 80 | else |
| 81 | JUST_K8S=no |
| 82 | fi |
| 83 | |
| 84 | # Verify DEPLOY_K8S settting and convert uniform value of yes or no |
| 85 | if [ $(echo ":y:yes:true:n:no:false:1:0:" | grep -ic ":$DEPLOY_K8S:") -eq 0 ]; then |
| 86 | >&2 echo -e "${RED}${BOLD}${ERROR}ERROR:${NORMAL}${RED} Invalid \$DEPLOY_K8S value of '$DEPLOY_K8S'. Should be 'yes' or 'no'${NOCOLOR}" |
| 87 | exit 1 |
| 88 | fi |
| 89 | if [ $(echo ":y:yes:true:1:" | grep -ic ":$DEPLOY_K8S:") -eq 1 ]; then |
| 90 | DEPLOY_K8S=yes |
| 91 | else |
| 92 | DEPLOY_K8S=no |
| 93 | fi |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 94 | |
| 95 | if [ "$TYPE" == "full" ]; then |
| 96 | ONOS_API_PORT=${ONOS_API_PORT:-8182} |
| 97 | ONOS_SSH_PORT=${ONOS_SSH_PORT:-8102} |
| 98 | VOLTHA_API_PORT=${VOLTHA_API_PORT:-55556} |
| 99 | VOLTHA_SSH_PORT=${VOLTHA_SSH_PORT:-5023} |
| 100 | else |
| 101 | ONOS_API_PORT=${ONOS_API_PORT:-8181} |
| 102 | ONOS_SSH_PORT=${ONOS_SSH_PORT:-8101} |
| 103 | VOLTHA_API_PORT=${VOLTHA_API_PORT:-55555} |
| 104 | VOLTHA_SSH_PORT=${VOLTHA_SSH_PORT:-5022} |
| 105 | fi |
| 106 | |
| 107 | if [ "$1" == "get" -a "$2" == "voltconfig" ]; then |
| 108 | echo "$HOME/.volt/config-$TYPE" |
| 109 | exit |
| 110 | fi |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 111 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 112 | if [ $# -ne 1 -o $(echo ":up:down:" | grep -c ":$1:") -ne 1 ]; then |
| 113 | >&2 echo "up or down?" |
| 114 | exit 1 |
| 115 | fi |
| 116 | |
| 117 | if [ "$1" == "down" ]; then |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 118 | if [ $DEPLOY_K8S == "yes" ]; then |
| 119 | if [ -x ./bin/kind ]; then |
| 120 | exec ./bin/kind delete cluster --name voltha-$TYPE |
| 121 | else |
| 122 | >&2 echo "Kind doesn't seem to be installed, so nothing to do. Bye." |
| 123 | fi |
Test User | 08ebbd9 | 2019-07-03 17:15:39 +0000 | [diff] [blame] | 124 | else |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 125 | EXISTS=$(helm list -q) |
| 126 | EXPECT="etcd-operator onos open-olt open-onu sim voltha" |
| 127 | INTERSECT= |
| 128 | for i in $EXISTS; do |
| 129 | if [ $(echo $EXPECT | grep -c $i) -eq 1 ]; then |
| 130 | HAVE="$HAVE $i" |
| 131 | fi |
| 132 | done |
| 133 | ./bin/helm delete --purge $HAVE |
| 134 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 135 | exit |
| 136 | fi |
| 137 | |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 138 | LOG="install-$TYPE.log" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 139 | date > $LOG |
| 140 | |
| 141 | spin() { |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame] | 142 | PARTS="\ |
| 143 | \xe2\xa2\x8e\xe2\xa1\xb0 \ |
| 144 | \xe2\xa2\x8e\xe2\xa1\xa1 \ |
| 145 | \xe2\xa2\x8e\xe2\xa1\x91 \ |
| 146 | \xe2\xa2\x8e\xe2\xa0\xb1 \ |
| 147 | \xe2\xa0\x8e\xe2\xa1\xb1 \ |
| 148 | \xe2\xa2\x8a\xe2\xa1\xb1 \ |
| 149 | \xe2\xa2\x8c\xe2\xa1\xb1 \ |
| 150 | \xe2\xa2\x86\xe2\xa1\xb1 \ |
| 151 | " |
| 152 | IDX=1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 153 | tput civis |
| 154 | while true; do |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame] | 155 | C=$(echo $PARTS | cut '-d ' -f $IDX) |
| 156 | echo -en "$C" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 157 | IDX=$(expr $IDX + 1) |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame] | 158 | if [ $IDX -gt 8 ]; then |
| 159 | IDX=1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 160 | fi |
| 161 | sleep .15 |
| 162 | echo -en "\r" |
| 163 | done |
| 164 | } |
| 165 | |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame] | 166 | SPIN_PARTS="\ |
| 167 | \xe2\xa2\x8e\xe2\xa1\xb0 \ |
| 168 | \xe2\xa2\x8e\xe2\xa1\xa1 \ |
| 169 | \xe2\xa2\x8e\xe2\xa1\x91 \ |
| 170 | \xe2\xa2\x8e\xe2\xa0\xb1 \ |
| 171 | \xe2\xa0\x8e\xe2\xa1\xb1 \ |
| 172 | \xe2\xa2\x8a\xe2\xa1\xb1 \ |
| 173 | \xe2\xa2\x8c\xe2\xa1\xb1 \ |
| 174 | \xe2\xa2\x86\xe2\xa1\xb1 \ |
| 175 | " |
| 176 | IDX=1 |
| 177 | NOT_VERIFIED="\xe2\x9c\x97\x20" |
| 178 | VERIFIED="\xe2\x9c\x93\x20" |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 179 | HELM="\xE2\x8E\x88" |
| 180 | OLD_KEY="\xF0\x9F\x97\x9D" |
| 181 | BIRD="\xF0\x9F\x90\xA6" |
| 182 | HIGH_VOLTAGE="\xE2\x9A\xA1" |
| 183 | PLUG="\xF0\x9F\xa7\xa9" |
| 184 | RESTART="\xf0\x9f\x94\x84" |
| 185 | FORWARD="\xE2\x87\xA8" |
| 186 | INSTALL="\xF0\x9F\x8F\x97" |
| 187 | STOP="\xf0\x9f\x9b\x91" |
| 188 | GO="\xf0\x9f\x9a\x80" |
| 189 | DOWNLOAD="\xf0\x9f\x93\xa5" |
| 190 | GEAR="\xe2\x9a\x99" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 191 | bspin() { |
| 192 | tput civis |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame] | 193 | IDX=1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 194 | local INDENT= |
| 195 | if [ "$1" == "-" ]; then |
| 196 | INDENT=" " |
| 197 | shift |
| 198 | fi |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame] | 199 | echo -en "$INDENT $*" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 200 | } |
| 201 | |
| 202 | sspin() { |
| 203 | local INDENT= |
| 204 | if [ "$1" == "-" ]; then |
| 205 | INDENT=" " |
| 206 | shift |
| 207 | fi |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame] | 208 | C=$(echo $SPIN_PARTS | cut '-d ' -f $IDX) |
| 209 | echo -en "\r$INDENT$C $*" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 210 | IDX=$(expr $IDX + 1) |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame] | 211 | if [ $IDX -gt 8 ]; then |
| 212 | IDX=1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 213 | fi |
| 214 | } |
| 215 | |
| 216 | espin() { |
| 217 | local INDENT= |
| 218 | if [ "$1" == "-" ]; then |
| 219 | INDENT=" " |
| 220 | shift |
| 221 | fi |
| 222 | echo -e "\r$INDENT$*" |
| 223 | tput cnorm |
| 224 | } |
| 225 | |
| 226 | count_pods() { |
| 227 | local NAMESPACE=$1; shift |
| 228 | local PODS=$(kubectl -n $NAMESPACE get pod -o go-template="{{range .items}}{{.metadata.name}}/{{.status.phase}}/_{{range .status.containerStatuses}}{{.ready}}_{{end}} {{end}}") |
| 229 | local COUNT=0 |
| 230 | local PATTERNS=$* |
| 231 | for POD in $PODS; do |
| 232 | local NAME=$(echo $POD | cut -d/ -f 1) |
| 233 | local STATE=$(echo $POD | cut -d/ -f 2) |
| 234 | local CONTAINERS=$(echo $POD | cut -d/ -f 3 | sed -e 's/_/ /g') |
| 235 | if [ "$STATE" == "Running" ]; then |
| 236 | local TOTAL=$(echo $CONTAINERS | wc -w) |
| 237 | local FOUND=$(echo $CONTAINERS | grep -o true | wc -l) |
| 238 | if [ $TOTAL -eq $FOUND ]; then |
| 239 | for PATTERN in $PATTERNS; do |
| 240 | if [[ $NAME =~ $PATTERN ]]; then |
| 241 | COUNT=$(expr $COUNT + 1) |
| 242 | fi |
| 243 | done |
| 244 | fi |
| 245 | fi |
| 246 | done |
| 247 | echo $COUNT |
| 248 | } |
| 249 | |
| 250 | wait_for_pods() { |
| 251 | local INDENT= |
| 252 | if [ "$1" == "-" ]; then |
| 253 | INDENT=$1; shift |
| 254 | fi |
| 255 | local NAMESPACE=$1; shift |
| 256 | local EXPECT=$1; shift |
| 257 | local RETRY=$1; shift |
| 258 | local MESSAGE=$1; shift |
| 259 | local PATTERNS=$* |
| 260 | local HAVE=$(count_pods $NAMESPACE $PATTERNS) |
| 261 | COUNT=$(expr 300 / 15) |
| 262 | bspin $INDENT $MESSAGE |
| 263 | sspin $INDENT |
| 264 | if [ $HAVE -ne $EXPECT ]; then |
| 265 | while [ $HAVE -ne $EXPECT ]; do |
| 266 | sspin $INDENT |
| 267 | COUNT=$(expr $COUNT - 1) |
| 268 | if [ $COUNT -eq 0 ]; then |
| 269 | HAVE=$(count_pods $NAMESPACE $PATTERNS) |
| 270 | COUNT=$(expr 300 / 15) |
| 271 | fi |
| 272 | sleep .15 |
| 273 | done |
| 274 | fi |
| 275 | espin $INDENT $VERIFIED |
| 276 | if [ $HAVE -ne $EXPECT ]; then |
| 277 | return 1 |
| 278 | fi |
| 279 | return 0 |
| 280 | } |
| 281 | |
| 282 | helm_install() { |
| 283 | local INDENT= |
| 284 | if [ "$1" == "-" ]; then |
| 285 | INDENT=$1; shift |
| 286 | fi |
| 287 | local NAMESPACE=$1; shift |
| 288 | local NAME=$1; shift |
| 289 | local CHART=$1; shift |
| 290 | local MESSAGE=$* |
| 291 | |
| 292 | COUNT=$(expr 300 / 15) |
| 293 | bspin $INDENT $MESSAGE |
| 294 | (set -x; helm install -f $TYPE-values.yaml --namespace $NAMESPACE --name $NAME $CHART >>$LOG 2>&1) >>$LOG 2>&1 |
| 295 | SUCCESS=$? |
| 296 | while [ $SUCCESS -ne 0 ]; do |
| 297 | sspin $INDENT |
| 298 | COUNT=$(expr $COUNT - 1) |
| 299 | if [ $COUNT -eq 0 ]; then |
| 300 | (set -x; helm install -f $TYPE-values.yaml --namespace $NAMESPACE --name $NAME $CHART >>$LOG 2>&1) >>$LOG 2>&1 |
| 301 | COUNT=$(expr 300 / 15) |
| 302 | fi |
| 303 | sleep .15 |
| 304 | done |
| 305 | espin $INDENT $VERIFIED |
| 306 | } |
| 307 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 308 | echo "INSTALL TYPE: $TYPE" >> $LOG |
| 309 | |
| 310 | bspin "Verify GOPATH" |
| 311 | export GOPATH=$(pwd) |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 312 | mkdir -p $GOPATH/bin |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 313 | espin $VERIFIED |
| 314 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 315 | bspin "Verify kubectl $HELM" |
Test User | c13bdc9 | 2019-07-03 20:57:49 +0000 | [diff] [blame] | 316 | if [ -x $GOPATH/bin/kubectl ]; then |
| 317 | espin $VERIFIED |
| 318 | else |
| 319 | espin $NOT_VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 320 | bspin - "Download and install Kubernetes/kubectl $DOWNLOAD" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 321 | (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 |
Test User | c13bdc9 | 2019-07-03 20:57:49 +0000 | [diff] [blame] | 322 | (set -x; chmod 755 $GOPATH/bin/kubectl >>$LOG 2>&1) >>$LOG 2>&1 |
| 323 | espin - $VERIFIED |
| 324 | fi |
| 325 | |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 326 | if [ "$DEPLOY_K8S" == "yes" ]; then |
| 327 | bspin "Verify Kubernetes/Kind $HELM" |
| 328 | if [ -x $GOPATH/bin/kind ]; then |
| 329 | espin $VERIFIED |
| 330 | else |
| 331 | espin $NOT_VERIFIED |
| 332 | bspin - "Download and install Kubernetes/kind $DOWNLOAD" |
| 333 | (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 |
| 334 | (set -x; chmod 755 $GOPATH/bin/kind >>$LOG 2>&1) >>$LOG 2>&1 |
| 335 | espin - $VERIFIED |
| 336 | fi |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 337 | fi |
| 338 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 339 | bspin "Verify Helm $HELM" |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 340 | if [ -x $GOPATH/bin/helm ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 341 | espin $VERIFIED |
| 342 | else |
| 343 | espin $NOT_VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 344 | bspin - "Download and install Helm $DOWNLOAD" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 345 | (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 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 346 | espin - $VERIFIED |
| 347 | fi |
| 348 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 349 | bspin "Verify voltctl $HIGH_VOLTAGE" |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 350 | if [ -x $GOPATH/bin/voltctl ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 351 | espin $VERIFIED |
| 352 | else |
| 353 | espin $NOT_VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 354 | bspin - "Download and build voltctl $DOWNLOAD" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 355 | (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] | 356 | (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] | 357 | espin - $VERIFIED |
| 358 | fi |
| 359 | |
| 360 | bspin "Verify command PATH" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 361 | export PATH=$GOPATH/bin:$PATH |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 362 | espin $VERIFIED |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 363 | |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 364 | if [ "$DEPLOY_K8S" == "yes" ]; then |
| 365 | HAVE=$(kind get clusters | grep -c voltha-$TYPE) |
| 366 | bspin "Verify Kubernetes/Kind Cluster" |
| 367 | sspin |
| 368 | if [ $HAVE -eq 0 ]; then |
| 369 | espin $NOT_VERIFIED |
| 370 | kind create cluster --name voltha-$TYPE --config $TYPE-cluster.cfg |
| 371 | else |
| 372 | espin $VERIFIED |
| 373 | fi |
| 374 | |
| 375 | export KUBECONFIG="$(kind get kubeconfig-path --name="voltha-$TYPE")" |
| 376 | P="coredns-.* \ |
| 377 | etcd-voltha-$TYPE-control-plane \ |
| 378 | kindnet-.* \ |
| 379 | kube-apiserver-voltha-$TYPE-control-plane \ |
| 380 | kube-controller-manager-voltha-$TYPE-control-plane \ |
| 381 | kube-proxy-.* \ |
| 382 | kube-scheduler-voltha-$TYPE-control-plane" |
| 383 | |
| 384 | EXPECT=$(test "$TYPE" == "minimal" && echo "12" || echo "14") |
| 385 | 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] | 386 | fi |
| 387 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 388 | COUNT=$(count_pods "kube-system" "tiller-deploy-.*") |
| 389 | bspin "Verify Helm" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 390 | if [ $COUNT -ne 1 ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 391 | espin $NOT_VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 392 | echo -e "Configuring Helm $GEAR" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 393 | bspin - "Initialize Helm" |
| 394 | (set -x; helm init --upgrade >>$LOG 2>&1) >>$LOG 2>&1 |
| 395 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 396 | bspin - "Add Google Incubator repository to Helm" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 397 | (set -x; helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com >>$LOG 2>&1) >>$LOG 2>&1 |
| 398 | espin - $VERIFIED |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 399 | |
| 400 | # HACK (sort-of) - the config for tiller is about to be patched, which will |
| 401 | # cause the tiller pod to be recreated. This can sometimes cause a timing |
| 402 | # issue with the "wait_for_pods" call on tiller as it may incorrectly |
| 403 | # identify the running/ready tiller pod that is soon to be terminated as |
| 404 | # what it is waiting for. To avoid this issue we do a clean scale down and |
| 405 | # scale up of the pod so the script controlls when it should be expecting |
| 406 | # things |
| 407 | (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] | 408 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 409 | bspin - "Add Google Stable repository to Helm" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 410 | (set -x; helm repo add stable https://kubernetes-charts.storage.googleapis.com >>$LOG 2>&1) >>$LOG 2>&1 |
| 411 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 412 | bspin - "Add ONF repository to Helm" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 413 | (set -x; helm repo add onf https://charts.opencord.org >>$LOG 2>&1) >>$LOG 2>&1 |
| 414 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 415 | bspin - "Update Helm repository cache" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 416 | (set -x; helm repo update >>$LOG 2>&1) >>$LOG 2>&1 |
| 417 | espin - $VERIFIED |
| 418 | |
| 419 | # Create and k8s service account so that Helm can create pods |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 420 | bspin - "Create Tiller ServiceAccount" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 421 | (set -x; kubectl create serviceaccount --namespace kube-system tiller >>$LOG 2>&1) >>$LOG 2>&1 |
| 422 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 423 | bspin - "Create Tiller ClusterRoleBinding" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 424 | (set -x; kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller >>$LOG 2>&1) >>$LOG 2>&1 |
| 425 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 426 | bspin - "Update Tiller Manifest" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 427 | (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^] | 428 | |
| 429 | # HACK (sort-of) - part to, spin it back up |
| 430 | (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] | 431 | espin - $VERIFIED |
| 432 | else |
| 433 | espin $VERIFIED |
| 434 | fi |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 435 | wait_for_pods - "kube-system" 1 -1 "Waiting for Tiller POD to start" "tiller-deploy-.*" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 436 | |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 437 | bspin "Verify Helm values file: $TYPE-values.yaml" |
| 438 | if [ ! -r "./$TYPE-values.yaml" ]; then |
| 439 | espin $NOT_VERIFIED |
| 440 | bspin - "Download Helm values file: $TYPE-values.yaml $DOWNLOAD" |
| 441 | (set -x; curl -o ./$TYPE-values.yaml -sSL https://raw.githubusercontent.com/ciena/kind-voltha/master/$TYPE-values.yaml >>$LOG 2>&1) >>$LOG 2>&1 |
| 442 | espin - $VERIFIED |
| 443 | else |
| 444 | espin $VERIFIED |
| 445 | fi |
| 446 | |
| 447 | if [ "$JUST_K8S" == "yes" ]; then |
| 448 | echo "Environment deployed, not deploying VOLTHA artifacts as requested. Good bye." |
| 449 | echo "" |
| 450 | echo "Please issue the following commands in your terminal to ensure that you" | tee -a $LOG |
| 451 | echo "are accessing the correct Kubernetes/Kind cluster as well as have the " | tee -a $LOG |
| 452 | echo "tools required by VOLTHA in your command path. " | tee -a $LOG |
| 453 | echo "" | tee -a $LOG |
| 454 | echo -en $BOLD |
| 455 | if [ $DEPLOY_K8S == "yes" ]; then |
| 456 | echo "export KUBECONFIG=\"\$(./bin/kind get kubeconfig-path --name=\"voltha-$TYPE\")\"" | tee -a $LOG |
| 457 | fi |
| 458 | echo "export PATH=$GOPATH/bin:\$PATH" | tee -a $LOG |
| 459 | echo -en $NORMAL |
| 460 | echo "" | tee -a $LOG |
| 461 | echo "Thank you for choosing kind-voltha for you quick cluster needs." | tee -a $LOG |
| 462 | exit 0 |
| 463 | fi |
| 464 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 465 | bspin "Verify ETCD Operator $OLD_KEY" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 466 | 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] | 467 | espin $NOT_VERIFIED |
| 468 | helm_install - voltha etcd-operator stable/etcd-operator "Install ETCD Operator" |
| 469 | else |
| 470 | espin $VERIFIED |
| 471 | fi |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 472 | EXPECT=$(test "$TYPE" == "minimal" && echo "1" || echo "3") |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 473 | wait_for_pods - "voltha" $EXPECT -1 "Waiting for ETCD Operator to start" "etcd-operator-.*" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 474 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 475 | bspin "Verify ONOS installed $BIRD" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 476 | if [ $(helm list --deployed --short --namespace default "^onos\$" | wc -l) -ne 1 ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 477 | espin $NOT_VERIFIED |
| 478 | helm_install - default onos onf/onos "Install ONOS" |
| 479 | else |
| 480 | espin $VERIFIED |
| 481 | fi |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 482 | wait_for_pods - "default" 1 -1 "Waiting for ONOS to start" "onos-.*" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 483 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 484 | bspin - "Forward ONOS API port $FORWARD" |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 485 | (set -x; screen -p 0 -X -S onos-ui-$TYPE stuff $'\003' >>$LOG 2>&1) >>$LOG 2>&1 |
| 486 | (set -x; screen -dmS onos-ui-$TYPE kubectl port-forward service/onos-ui $ONOS_API_PORT:8181 >>$LOG 2>&1) >>$LOG 2>&1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 487 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 488 | bspin - "Forward ONOS SSH port $FORWARD" |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 489 | (set -x; screen -p 0 -X -S onos-ssh-$TYPE stuff $'\003' >>$LOG 2>&1) >>$LOG 2>&1 |
| 490 | (set -x; screen -dmS onos-ssh-$TYPE kubectl port-forward service/onos-ssh $ONOS_SSH_PORT:8101 >>$LOG 2>&1) >>$LOG 2>&1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 491 | espin - $VERIFIED |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 492 | if [ ! -x ./onos-files/install-onos-applications.sh ]; then |
| 493 | bspin - "Verify or download ONOS configuration support files $DOWNLOAD" |
| 494 | (set -x; mkdir -p ./onos-files >>$LOG 2>&1) >>$LOG 2>&1 |
| 495 | 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; do |
| 496 | if [ ! -r ./onos-files/$i ]; then |
| 497 | (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 |
| 498 | fi |
| 499 | done |
| 500 | (set -x; chmod 755 ./onos-files/install-onos-applications.sh >>$LOG 2>&1) >>$LOG 2>&1 |
| 501 | espin - $VERIFIED |
| 502 | fi |
| 503 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 504 | bspin - "Install required ONOS applications $INSTALL" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 505 | (set -x; ./onos-files/install-onos-applications.sh >>$LOG 2>&1) >>$LOG 2>&1 |
| 506 | espin - $VERIFIED |
| 507 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 508 | bspin "Verify VOLTHA installed $HIGH_VOLTAGE" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 509 | 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] | 510 | espin $NOT_VERIFIED |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame] | 511 | helm_install - voltha voltha onf/voltha "Install VOLTHA Core" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 512 | else |
| 513 | espin $VERIFIED |
| 514 | fi |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 515 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 516 | VOLTHA="ofagent-.* \ |
| 517 | ro-core.* \ |
| 518 | rw-core.* \ |
| 519 | voltha-api-server-.* \ |
| 520 | voltha-cli-server-.* \ |
| 521 | voltha-etcd-cluster-.* \ |
| 522 | voltha-kafka-.* \ |
| 523 | voltha-zookeeper-.*" |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 524 | EXPECT=$(test "$TYPE" == "minimal" && echo "9" || echo "11") |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 525 | wait_for_pods - "voltha" $EXPECT -1 "Waiting for VOLTHA Core to start" $VOLTHA |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 526 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 527 | echo -e "Verify Adapters $PLUG" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 528 | bspin - "Verify Simulated Adapters installed" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 529 | 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] | 530 | espin - $NOT_VERIFIED |
| 531 | helm_install - voltha sim onf/voltha-adapter-simulated "Install Simulated Adapters" |
| 532 | else |
| 533 | espin - $VERIFIED |
| 534 | fi |
| 535 | |
| 536 | bspin - "Verify OpenOLT Adapter installed" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 537 | 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] | 538 | espin - $NOT_VERIFIED |
| 539 | helm_install - voltha open-olt onf/voltha-adapter-openolt "Install OpenOLT Adapter" |
| 540 | else |
| 541 | espin - $VERIFIED |
| 542 | fi |
| 543 | bspin - "Verify OpenONU Adapter installed" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 544 | 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] | 545 | espin - $NOT_VERIFIED |
| 546 | helm_install - voltha open-onu onf/voltha-adapter-openonu "Install OpenONU Adapter" |
| 547 | else |
| 548 | espin - $VERIFIED |
| 549 | fi |
| 550 | |
| 551 | ADAPTERS="adapter-.*" |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 552 | wait_for_pods - "voltha" 4 -1 "Waiting for adapters to start" $ADAPTERS |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 553 | |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 554 | if [ $WITH_BBSIM == "yes" ]; then |
| 555 | echo -e "Verify BBSIM $PLUG" |
| 556 | bspin - "Verify BBSIM Insalled" |
| 557 | if [ $(helm list --deployed --short --namespace voltha "^bbsim\$" | wc -l) -ne 1 ]; then |
| 558 | espin - $NOT_VERIFIED |
| 559 | helm_install - voltha bbsim onf/bbsim "Install BBSIM" |
| 560 | else |
| 561 | espin - $VERIFIED |
| 562 | fi |
| 563 | wait_for_pods - "voltha" 1 -1 "Waiting for BBSIM to start" "bbsim-.*" |
| 564 | fi |
| 565 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 566 | echo -e "Restart VOLTHA API $RESTART" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 567 | API="voltha-api-server-.* ofagent-.*" |
| 568 | (set -x; kubectl scale --replicas=0 deployment -n voltha voltha-api-server ofagent >>$LOG 2>&1) >>$LOG 2>&1 |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 569 | wait_for_pods - "voltha" 0 -1 "Wait for API to stop $STOP" $API |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 570 | (set -x; kubectl scale --replicas=1 deployment -n voltha voltha-api-server ofagent >>$LOG 2>&1) >>$LOG 2>&1 |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 571 | wait_for_pods - "voltha" 2 -1 "Wait for API to re-start $GO" $API |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 572 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 573 | bspin - "Forward VOLTHA API port $FORWARD" |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 574 | (set -x; screen -p 0 -X -S voltha-api-$TYPE stuff $'\003' >>$LOG 2>&1) >>$LOG 2>&1 |
| 575 | (set -x; screen -dmS voltha-api-$TYPE kubectl port-forward -n voltha service/voltha-api $VOLTHA_API_PORT:55555 >>$LOG 2>&1) >>$LOG 2>&1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 576 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 577 | bspin - "Forward VOLTHA SSH port $FORWARD" |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 578 | (set -x; screen -p 0 -X -S voltha-ssh-$TYPE stuff $'\003' 2>/dev/null >/dev/null >>$LOG 2>&1) >>$LOG 2>&1 |
| 579 | (set -x; screen -dmS voltha-ssh-$TYPE kubectl port-forward -n voltha service/voltha-cli $VOLTHA_SSH_PORT:5022 >>$LOG 2>&1) >>$LOG 2>&1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 580 | espin - $VERIFIED |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 581 | |
| 582 | bspin - "Create voltctl configuration file" |
| 583 | (set -x; mkdir -p $HOME/.volt >>$LOG 2>&1) >>$LOG 2>&1 |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 584 | (set -x; voltctl -a v2 -s localhost:$VOLTHA_API_PORT config > $HOME/.volt/config-$TYPE 2>>$LOG) >>$LOG 2>&1 |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 585 | espin - $VERIFIED |
Test User | 08ebbd9 | 2019-07-03 17:15:39 +0000 | [diff] [blame] | 586 | |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 587 | echo "" |
Test User | 08ebbd9 | 2019-07-03 17:15:39 +0000 | [diff] [blame] | 588 | echo "Please issue the following commands in your terminal to ensure that you" | tee -a $LOG |
| 589 | echo "are accessing the correct Kubernetes/Kind cluster as well as have the " | tee -a $LOG |
| 590 | echo "tools required by VOLTHA in your command path. " | tee -a $LOG |
| 591 | echo "" | tee -a $LOG |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 592 | echo -en $BOLD |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 593 | if [ $DEPLOY_K8S == "yes" ]; then |
| 594 | echo "export KUBECONFIG=\"\$(./bin/kind get kubeconfig-path --name=\"voltha-$TYPE\")\"" | tee -a $LOG |
| 595 | fi |
Test User | fa30f7f | 2019-07-03 20:35:19 +0000 | [diff] [blame] | 596 | echo "export VOLTCONFIG=\"$HOME/.volt/config-$TYPE\"" | tee -a $LOG |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame^] | 597 | echo "export PATH=$GOPATH/bin:\$PATH" | tee -a $LOG |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 598 | echo -en $NORMAL |
Test User | 08ebbd9 | 2019-07-03 17:15:39 +0000 | [diff] [blame] | 599 | echo "" | tee -a $LOG |
| 600 | echo "Thank you for choosing kind-voltha for you quick cluster needs." | tee -a $LOG |
| 601 | |