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" |
David Bainbridge | 9e2a666 | 2019-07-11 17:07:57 +0000 | [diff] [blame] | 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 |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 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 |
David Bainbridge | 491b1bd | 2019-07-11 17:53:11 +0000 | [diff] [blame^] | 369 | espin $NOT_VERIFIED |
| 370 | bspin - "Verify cluster configuration" |
| 371 | if [ ! -r ./$TYPE-cluster.cfg ]; then |
| 372 | espin - $NOT_VERIFIED |
| 373 | bspin - "Download cluster configuration: $TYPE-cluster.cfg $DOWNLOAD" |
| 374 | (set -x; curl -o ./$TYPE-cluster.cfg -sSL https://raw.githubusercontent.com/ciena/kind-voltha/master/$TYPE-cluster.cfg >>$LOG 2>&1) >>$LOG 2>&1 |
| 375 | espin - $VERIFIED |
| 376 | else |
| 377 | espin - $VERFIED |
| 378 | fi |
| 379 | kind create cluster --name voltha-$TYPE --config $TYPE-cluster.cfg |
| 380 | else |
| 381 | espin $VERIFIED |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 382 | fi |
| 383 | |
| 384 | export KUBECONFIG="$(kind get kubeconfig-path --name="voltha-$TYPE")" |
| 385 | P="coredns-.* \ |
| 386 | etcd-voltha-$TYPE-control-plane \ |
| 387 | kindnet-.* \ |
| 388 | kube-apiserver-voltha-$TYPE-control-plane \ |
| 389 | kube-controller-manager-voltha-$TYPE-control-plane \ |
| 390 | kube-proxy-.* \ |
| 391 | kube-scheduler-voltha-$TYPE-control-plane" |
| 392 | |
| 393 | EXPECT=$(test "$TYPE" == "minimal" && echo "12" || echo "14") |
| 394 | 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] | 395 | fi |
| 396 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 397 | COUNT=$(count_pods "kube-system" "tiller-deploy-.*") |
| 398 | bspin "Verify Helm" |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 399 | if [ $COUNT -ne 1 ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 400 | espin $NOT_VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 401 | echo -e "Configuring Helm $GEAR" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 402 | bspin - "Initialize Helm" |
| 403 | (set -x; helm init --upgrade >>$LOG 2>&1) >>$LOG 2>&1 |
| 404 | espin - $VERIFIED |
David Bainbridge | 491b1bd | 2019-07-11 17:53:11 +0000 | [diff] [blame^] | 405 | wait_for_pods - "kube-system" 1 -1 "Waiting for Tiller POD to start" "tiller-deploy-.*" |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 406 | bspin - "Add Google Incubator repository to Helm" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 407 | (set -x; helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com >>$LOG 2>&1) >>$LOG 2>&1 |
| 408 | espin - $VERIFIED |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 409 | |
| 410 | # HACK (sort-of) - the config for tiller is about to be patched, which will |
| 411 | # cause the tiller pod to be recreated. This can sometimes cause a timing |
| 412 | # issue with the "wait_for_pods" call on tiller as it may incorrectly |
| 413 | # identify the running/ready tiller pod that is soon to be terminated as |
| 414 | # what it is waiting for. To avoid this issue we do a clean scale down and |
| 415 | # scale up of the pod so the script controlls when it should be expecting |
| 416 | # things |
| 417 | (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] | 418 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 419 | bspin - "Add Google Stable repository to Helm" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 420 | (set -x; helm repo add stable https://kubernetes-charts.storage.googleapis.com >>$LOG 2>&1) >>$LOG 2>&1 |
| 421 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 422 | bspin - "Add ONF repository to Helm" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 423 | (set -x; helm repo add onf https://charts.opencord.org >>$LOG 2>&1) >>$LOG 2>&1 |
| 424 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 425 | bspin - "Update Helm repository cache" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 426 | (set -x; helm repo update >>$LOG 2>&1) >>$LOG 2>&1 |
| 427 | espin - $VERIFIED |
| 428 | |
| 429 | # Create and k8s service account so that Helm can create pods |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 430 | bspin - "Create Tiller ServiceAccount" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 431 | (set -x; kubectl create serviceaccount --namespace kube-system tiller >>$LOG 2>&1) >>$LOG 2>&1 |
| 432 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 433 | bspin - "Create Tiller ClusterRoleBinding" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 434 | (set -x; kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller >>$LOG 2>&1) >>$LOG 2>&1 |
| 435 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 436 | bspin - "Update Tiller Manifest" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 437 | (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] | 438 | |
| 439 | # HACK (sort-of) - part to, spin it back up |
| 440 | (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] | 441 | espin - $VERIFIED |
| 442 | else |
| 443 | espin $VERIFIED |
| 444 | fi |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 445 | 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] | 446 | |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 447 | bspin "Verify Helm values file: $TYPE-values.yaml" |
| 448 | if [ ! -r "./$TYPE-values.yaml" ]; then |
| 449 | espin $NOT_VERIFIED |
| 450 | bspin - "Download Helm values file: $TYPE-values.yaml $DOWNLOAD" |
| 451 | (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 |
| 452 | espin - $VERIFIED |
| 453 | else |
| 454 | espin $VERIFIED |
| 455 | fi |
| 456 | |
| 457 | if [ "$JUST_K8S" == "yes" ]; then |
| 458 | echo "Environment deployed, not deploying VOLTHA artifacts as requested. Good bye." |
| 459 | echo "" |
| 460 | echo "Please issue the following commands in your terminal to ensure that you" | tee -a $LOG |
| 461 | echo "are accessing the correct Kubernetes/Kind cluster as well as have the " | tee -a $LOG |
| 462 | echo "tools required by VOLTHA in your command path. " | tee -a $LOG |
| 463 | echo "" | tee -a $LOG |
| 464 | echo -en $BOLD |
| 465 | if [ $DEPLOY_K8S == "yes" ]; then |
| 466 | echo "export KUBECONFIG=\"\$(./bin/kind get kubeconfig-path --name=\"voltha-$TYPE\")\"" | tee -a $LOG |
| 467 | fi |
| 468 | echo "export PATH=$GOPATH/bin:\$PATH" | tee -a $LOG |
| 469 | echo -en $NORMAL |
| 470 | echo "" | tee -a $LOG |
| 471 | echo "Thank you for choosing kind-voltha for you quick cluster needs." | tee -a $LOG |
| 472 | exit 0 |
| 473 | fi |
| 474 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 475 | bspin "Verify ETCD Operator $OLD_KEY" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 476 | 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] | 477 | espin $NOT_VERIFIED |
| 478 | helm_install - voltha etcd-operator stable/etcd-operator "Install ETCD Operator" |
| 479 | else |
| 480 | espin $VERIFIED |
| 481 | fi |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 482 | EXPECT=$(test "$TYPE" == "minimal" && echo "1" || echo "3") |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 483 | 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] | 484 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 485 | bspin "Verify ONOS installed $BIRD" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 486 | 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] | 487 | espin $NOT_VERIFIED |
| 488 | helm_install - default onos onf/onos "Install ONOS" |
| 489 | else |
| 490 | espin $VERIFIED |
| 491 | fi |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 492 | 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] | 493 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 494 | bspin - "Forward ONOS API port $FORWARD" |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 495 | (set -x; screen -p 0 -X -S onos-ui-$TYPE stuff $'\003' >>$LOG 2>&1) >>$LOG 2>&1 |
| 496 | (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] | 497 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 498 | bspin - "Forward ONOS SSH port $FORWARD" |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 499 | (set -x; screen -p 0 -X -S onos-ssh-$TYPE stuff $'\003' >>$LOG 2>&1) >>$LOG 2>&1 |
| 500 | (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] | 501 | espin - $VERIFIED |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 502 | if [ ! -x ./onos-files/install-onos-applications.sh ]; then |
| 503 | bspin - "Verify or download ONOS configuration support files $DOWNLOAD" |
| 504 | (set -x; mkdir -p ./onos-files >>$LOG 2>&1) >>$LOG 2>&1 |
| 505 | 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 |
| 506 | if [ ! -r ./onos-files/$i ]; then |
| 507 | (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 |
| 508 | fi |
| 509 | done |
| 510 | (set -x; chmod 755 ./onos-files/install-onos-applications.sh >>$LOG 2>&1) >>$LOG 2>&1 |
| 511 | espin - $VERIFIED |
| 512 | fi |
| 513 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 514 | bspin - "Install required ONOS applications $INSTALL" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 515 | (set -x; ./onos-files/install-onos-applications.sh >>$LOG 2>&1) >>$LOG 2>&1 |
| 516 | espin - $VERIFIED |
| 517 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 518 | bspin "Verify VOLTHA installed $HIGH_VOLTAGE" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 519 | 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] | 520 | espin $NOT_VERIFIED |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame] | 521 | helm_install - voltha voltha onf/voltha "Install VOLTHA Core" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 522 | else |
| 523 | espin $VERIFIED |
| 524 | fi |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 525 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 526 | VOLTHA="ofagent-.* \ |
| 527 | ro-core.* \ |
| 528 | rw-core.* \ |
| 529 | voltha-api-server-.* \ |
| 530 | voltha-cli-server-.* \ |
| 531 | voltha-etcd-cluster-.* \ |
| 532 | voltha-kafka-.* \ |
| 533 | voltha-zookeeper-.*" |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 534 | EXPECT=$(test "$TYPE" == "minimal" && echo "9" || echo "11") |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 535 | 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] | 536 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 537 | echo -e "Verify Adapters $PLUG" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 538 | bspin - "Verify Simulated Adapters installed" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 539 | 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] | 540 | espin - $NOT_VERIFIED |
| 541 | helm_install - voltha sim onf/voltha-adapter-simulated "Install Simulated Adapters" |
| 542 | else |
| 543 | espin - $VERIFIED |
| 544 | fi |
| 545 | |
| 546 | bspin - "Verify OpenOLT Adapter installed" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 547 | 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] | 548 | espin - $NOT_VERIFIED |
| 549 | helm_install - voltha open-olt onf/voltha-adapter-openolt "Install OpenOLT Adapter" |
| 550 | else |
| 551 | espin - $VERIFIED |
| 552 | fi |
| 553 | bspin - "Verify OpenONU Adapter installed" |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 554 | 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] | 555 | espin - $NOT_VERIFIED |
| 556 | helm_install - voltha open-onu onf/voltha-adapter-openonu "Install OpenONU Adapter" |
| 557 | else |
| 558 | espin - $VERIFIED |
| 559 | fi |
| 560 | |
| 561 | ADAPTERS="adapter-.*" |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 562 | 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] | 563 | |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 564 | if [ $WITH_BBSIM == "yes" ]; then |
| 565 | echo -e "Verify BBSIM $PLUG" |
| 566 | bspin - "Verify BBSIM Insalled" |
| 567 | if [ $(helm list --deployed --short --namespace voltha "^bbsim\$" | wc -l) -ne 1 ]; then |
| 568 | espin - $NOT_VERIFIED |
| 569 | helm_install - voltha bbsim onf/bbsim "Install BBSIM" |
| 570 | else |
| 571 | espin - $VERIFIED |
| 572 | fi |
| 573 | wait_for_pods - "voltha" 1 -1 "Waiting for BBSIM to start" "bbsim-.*" |
| 574 | fi |
| 575 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 576 | echo -e "Restart VOLTHA API $RESTART" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 577 | API="voltha-api-server-.* ofagent-.*" |
| 578 | (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] | 579 | 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] | 580 | (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] | 581 | 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] | 582 | |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 583 | bspin - "Forward VOLTHA API port $FORWARD" |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 584 | (set -x; screen -p 0 -X -S voltha-api-$TYPE stuff $'\003' >>$LOG 2>&1) >>$LOG 2>&1 |
| 585 | (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] | 586 | espin - $VERIFIED |
Test User | b571237 | 2019-07-03 21:52:17 +0000 | [diff] [blame] | 587 | bspin - "Forward VOLTHA SSH port $FORWARD" |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 588 | (set -x; screen -p 0 -X -S voltha-ssh-$TYPE stuff $'\003' 2>/dev/null >/dev/null >>$LOG 2>&1) >>$LOG 2>&1 |
| 589 | (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] | 590 | espin - $VERIFIED |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 591 | |
| 592 | bspin - "Create voltctl configuration file" |
| 593 | (set -x; mkdir -p $HOME/.volt >>$LOG 2>&1) >>$LOG 2>&1 |
Test User | 01ed064 | 2019-07-03 20:17:06 +0000 | [diff] [blame] | 594 | (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] | 595 | espin - $VERIFIED |
Test User | 08ebbd9 | 2019-07-03 17:15:39 +0000 | [diff] [blame] | 596 | |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 597 | echo "" |
Test User | 08ebbd9 | 2019-07-03 17:15:39 +0000 | [diff] [blame] | 598 | echo "Please issue the following commands in your terminal to ensure that you" | tee -a $LOG |
| 599 | echo "are accessing the correct Kubernetes/Kind cluster as well as have the " | tee -a $LOG |
| 600 | echo "tools required by VOLTHA in your command path. " | tee -a $LOG |
| 601 | echo "" | tee -a $LOG |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 602 | echo -en $BOLD |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 603 | if [ $DEPLOY_K8S == "yes" ]; then |
| 604 | echo "export KUBECONFIG=\"\$(./bin/kind get kubeconfig-path --name=\"voltha-$TYPE\")\"" | tee -a $LOG |
| 605 | fi |
Test User | fa30f7f | 2019-07-03 20:35:19 +0000 | [diff] [blame] | 606 | echo "export VOLTCONFIG=\"$HOME/.volt/config-$TYPE\"" | tee -a $LOG |
Test User | ba1e7e7 | 2019-07-10 22:27:54 +0000 | [diff] [blame] | 607 | echo "export PATH=$GOPATH/bin:\$PATH" | tee -a $LOG |
Test User | 7d86612 | 2019-07-09 17:52:35 +0000 | [diff] [blame] | 608 | echo -en $NORMAL |
Test User | 08ebbd9 | 2019-07-03 17:15:39 +0000 | [diff] [blame] | 609 | echo "" | tee -a $LOG |
| 610 | echo "Thank you for choosing kind-voltha for you quick cluster needs." | tee -a $LOG |
| 611 | |