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