David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 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 | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 27 | TYPE=${TYPE:-minimal} |
| 28 | # Only minimal cluster works in this script currently |
| 29 | TYPE=minimal |
| 30 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 31 | if [ $# -ne 1 -o $(echo ":up:down:" | grep -c ":$1:") -ne 1 ]; then |
| 32 | >&2 echo "up or down?" |
| 33 | exit 1 |
| 34 | fi |
| 35 | |
| 36 | if [ "$1" == "down" ]; then |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame^] | 37 | exec ./bin/kind delete cluster --name voltha-$TYPE |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 38 | exit |
| 39 | fi |
| 40 | |
| 41 | LOG="install.log" |
| 42 | date > $LOG |
| 43 | |
| 44 | spin() { |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame^] | 45 | PARTS="\ |
| 46 | \xe2\xa2\x8e\xe2\xa1\xb0 \ |
| 47 | \xe2\xa2\x8e\xe2\xa1\xa1 \ |
| 48 | \xe2\xa2\x8e\xe2\xa1\x91 \ |
| 49 | \xe2\xa2\x8e\xe2\xa0\xb1 \ |
| 50 | \xe2\xa0\x8e\xe2\xa1\xb1 \ |
| 51 | \xe2\xa2\x8a\xe2\xa1\xb1 \ |
| 52 | \xe2\xa2\x8c\xe2\xa1\xb1 \ |
| 53 | \xe2\xa2\x86\xe2\xa1\xb1 \ |
| 54 | " |
| 55 | IDX=1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 56 | tput civis |
| 57 | while true; do |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame^] | 58 | C=$(echo $PARTS | cut '-d ' -f $IDX) |
| 59 | echo -en "$C" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 60 | IDX=$(expr $IDX + 1) |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame^] | 61 | if [ $IDX -gt 8 ]; then |
| 62 | IDX=1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 63 | fi |
| 64 | sleep .15 |
| 65 | echo -en "\r" |
| 66 | done |
| 67 | } |
| 68 | |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame^] | 69 | SPIN_PARTS="\ |
| 70 | \xe2\xa2\x8e\xe2\xa1\xb0 \ |
| 71 | \xe2\xa2\x8e\xe2\xa1\xa1 \ |
| 72 | \xe2\xa2\x8e\xe2\xa1\x91 \ |
| 73 | \xe2\xa2\x8e\xe2\xa0\xb1 \ |
| 74 | \xe2\xa0\x8e\xe2\xa1\xb1 \ |
| 75 | \xe2\xa2\x8a\xe2\xa1\xb1 \ |
| 76 | \xe2\xa2\x8c\xe2\xa1\xb1 \ |
| 77 | \xe2\xa2\x86\xe2\xa1\xb1 \ |
| 78 | " |
| 79 | IDX=1 |
| 80 | NOT_VERIFIED="\xe2\x9c\x97\x20" |
| 81 | VERIFIED="\xe2\x9c\x93\x20" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 82 | bspin() { |
| 83 | tput civis |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame^] | 84 | IDX=1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 85 | local INDENT= |
| 86 | if [ "$1" == "-" ]; then |
| 87 | INDENT=" " |
| 88 | shift |
| 89 | fi |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame^] | 90 | echo -en "$INDENT $*" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 91 | } |
| 92 | |
| 93 | sspin() { |
| 94 | local INDENT= |
| 95 | if [ "$1" == "-" ]; then |
| 96 | INDENT=" " |
| 97 | shift |
| 98 | fi |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame^] | 99 | C=$(echo $SPIN_PARTS | cut '-d ' -f $IDX) |
| 100 | echo -en "\r$INDENT$C $*" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 101 | IDX=$(expr $IDX + 1) |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame^] | 102 | if [ $IDX -gt 8 ]; then |
| 103 | IDX=1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 104 | fi |
| 105 | } |
| 106 | |
| 107 | espin() { |
| 108 | local INDENT= |
| 109 | if [ "$1" == "-" ]; then |
| 110 | INDENT=" " |
| 111 | shift |
| 112 | fi |
| 113 | echo -e "\r$INDENT$*" |
| 114 | tput cnorm |
| 115 | } |
| 116 | |
| 117 | count_pods() { |
| 118 | local NAMESPACE=$1; shift |
| 119 | local PODS=$(kubectl -n $NAMESPACE get pod -o go-template="{{range .items}}{{.metadata.name}}/{{.status.phase}}/_{{range .status.containerStatuses}}{{.ready}}_{{end}} {{end}}") |
| 120 | local COUNT=0 |
| 121 | local PATTERNS=$* |
| 122 | for POD in $PODS; do |
| 123 | local NAME=$(echo $POD | cut -d/ -f 1) |
| 124 | local STATE=$(echo $POD | cut -d/ -f 2) |
| 125 | local CONTAINERS=$(echo $POD | cut -d/ -f 3 | sed -e 's/_/ /g') |
| 126 | if [ "$STATE" == "Running" ]; then |
| 127 | local TOTAL=$(echo $CONTAINERS | wc -w) |
| 128 | local FOUND=$(echo $CONTAINERS | grep -o true | wc -l) |
| 129 | if [ $TOTAL -eq $FOUND ]; then |
| 130 | for PATTERN in $PATTERNS; do |
| 131 | if [[ $NAME =~ $PATTERN ]]; then |
| 132 | COUNT=$(expr $COUNT + 1) |
| 133 | fi |
| 134 | done |
| 135 | fi |
| 136 | fi |
| 137 | done |
| 138 | echo $COUNT |
| 139 | } |
| 140 | |
| 141 | wait_for_pods() { |
| 142 | local INDENT= |
| 143 | if [ "$1" == "-" ]; then |
| 144 | INDENT=$1; shift |
| 145 | fi |
| 146 | local NAMESPACE=$1; shift |
| 147 | local EXPECT=$1; shift |
| 148 | local RETRY=$1; shift |
| 149 | local MESSAGE=$1; shift |
| 150 | local PATTERNS=$* |
| 151 | local HAVE=$(count_pods $NAMESPACE $PATTERNS) |
| 152 | COUNT=$(expr 300 / 15) |
| 153 | bspin $INDENT $MESSAGE |
| 154 | sspin $INDENT |
| 155 | if [ $HAVE -ne $EXPECT ]; then |
| 156 | while [ $HAVE -ne $EXPECT ]; do |
| 157 | sspin $INDENT |
| 158 | COUNT=$(expr $COUNT - 1) |
| 159 | if [ $COUNT -eq 0 ]; then |
| 160 | HAVE=$(count_pods $NAMESPACE $PATTERNS) |
| 161 | COUNT=$(expr 300 / 15) |
| 162 | fi |
| 163 | sleep .15 |
| 164 | done |
| 165 | fi |
| 166 | espin $INDENT $VERIFIED |
| 167 | if [ $HAVE -ne $EXPECT ]; then |
| 168 | return 1 |
| 169 | fi |
| 170 | return 0 |
| 171 | } |
| 172 | |
| 173 | helm_install() { |
| 174 | local INDENT= |
| 175 | if [ "$1" == "-" ]; then |
| 176 | INDENT=$1; shift |
| 177 | fi |
| 178 | local NAMESPACE=$1; shift |
| 179 | local NAME=$1; shift |
| 180 | local CHART=$1; shift |
| 181 | local MESSAGE=$* |
| 182 | |
| 183 | COUNT=$(expr 300 / 15) |
| 184 | bspin $INDENT $MESSAGE |
| 185 | (set -x; helm install -f $TYPE-values.yaml --namespace $NAMESPACE --name $NAME $CHART >>$LOG 2>&1) >>$LOG 2>&1 |
| 186 | SUCCESS=$? |
| 187 | while [ $SUCCESS -ne 0 ]; do |
| 188 | sspin $INDENT |
| 189 | COUNT=$(expr $COUNT - 1) |
| 190 | if [ $COUNT -eq 0 ]; then |
| 191 | (set -x; helm install -f $TYPE-values.yaml --namespace $NAMESPACE --name $NAME $CHART >>$LOG 2>&1) >>$LOG 2>&1 |
| 192 | COUNT=$(expr 300 / 15) |
| 193 | fi |
| 194 | sleep .15 |
| 195 | done |
| 196 | espin $INDENT $VERIFIED |
| 197 | } |
| 198 | |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 199 | echo "INSTALL TYPE: $TYPE" >> $LOG |
| 200 | |
| 201 | bspin "Verify GOPATH" |
| 202 | export GOPATH=$(pwd) |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 203 | mkdir -p $GOPATH/bin |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 204 | espin $VERIFIED |
| 205 | |
| 206 | bspin "Verify Kubernetes/Kind" |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 207 | if [ -x $GOPATH/bin/kind ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 208 | espin $VERIFIED |
| 209 | else |
| 210 | espin $NOT_VERIFIED |
| 211 | bspin - "Download and build Kubernetes/Kind" |
| 212 | (set -x; rm -rf $GOPATH/go.mod $GOPATH/go.sum >>$LOG 2>&1) >>$LOG 2>&1 |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 213 | (set -x; curl -o $GOPATH/bin/kind -sSL https://github.com/kubernetes-sigs/kind/releases/download/v0.4.0/kind-$(go env GOHOSTOS)-$(go env GOARCH) >>$LOG 2>&1) >>$LOG 2>&1 |
Test User | 7c2be41 | 2019-07-03 06:20:30 +0000 | [diff] [blame] | 214 | (set -x; chmod 755 $GOPATH/bin/kind >>$LOG 2>&1) >>$LOG 2>&1 |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 215 | espin - $VERIFIED |
| 216 | fi |
| 217 | |
| 218 | bspin "Verify Helm" |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 219 | if [ -x $GOPATH/bin/helm ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 220 | espin $VERIFIED |
| 221 | else |
| 222 | espin $NOT_VERIFIED |
| 223 | bspin - "Download and install Helm" |
| 224 | (set -x; rm -rf $GOPATH/go.mod $GOPATH/go.sum >>$LOG 2>&1) >>$LOG 2>&1 |
| 225 | (set -x; curl -L https://git.io/get_helm.sh | HELM_INSTALL_DIR=$(go env GOPATH)/bin bash >>$LOG 2>&1) >>$LOG 2>&1 |
| 226 | espin - $VERIFIED |
| 227 | fi |
| 228 | |
| 229 | bspin "Verify voltctl" |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 230 | if [ -x $GOPATH/bin/voltctl ]; then |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 231 | espin $VERIFIED |
| 232 | else |
| 233 | espin $NOT_VERIFIED |
| 234 | bspin - "Download and build voltctl" |
| 235 | (set -x; rm -rf $GOPATH/go.mod $GOPATH/go.sum >>$LOG 2>&1) >>$LOG 2>&1 |
| 236 | (set -x; go get github.com/ciena/voltctl/cmd/voltctl >>$LOG 2>&1) >>$LOG 2>&1 |
| 237 | espin - $VERIFIED |
| 238 | fi |
| 239 | |
| 240 | bspin "Verify command PATH" |
| 241 | export PATH=$(go env GOPATH)/bin:$PATH |
| 242 | espin $VERIFIED |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 243 | |
| 244 | HAVE=$(kind get clusters | grep -c voltha-$TYPE) |
| 245 | bspin "Verify Kubernetes/Kind Cluster" |
| 246 | sspin |
| 247 | if [ $HAVE -eq 0 ]; then |
| 248 | espin $NOT_VERIFIED |
| 249 | kind create cluster --name voltha-$TYPE --config $TYPE-cluster.cfg |
| 250 | else |
| 251 | espin $VERIFIED |
| 252 | fi |
| 253 | |
| 254 | export KUBECONFIG="$(kind get kubeconfig-path --name="voltha-$TYPE")" |
| 255 | P="coredns-.* \ |
| 256 | etcd-voltha-$TYPE-control-plane \ |
| 257 | kindnet-.* \ |
| 258 | kube-apiserver-voltha-$TYPE-control-plane \ |
| 259 | kube-controller-manager-voltha-$TYPE-control-plane \ |
| 260 | kube-proxy-.* \ |
| 261 | kube-scheduler-voltha-$TYPE-control-plane" |
| 262 | |
| 263 | wait_for_pods - "kube-system" 12 -1 "Waiting for system PODs to start..." $P |
| 264 | |
| 265 | COUNT=$(count_pods "kube-system" "tiller-deploy-.*") |
| 266 | bspin "Verify Helm" |
| 267 | if [ $(count_pods "kube-system" "tiller-deploy-.*") -ne 1 ]; then |
| 268 | espin $NOT_VERIFIED |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame^] | 269 | echo "Configuring Helm ..." |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 270 | bspin - "Initialize Helm" |
| 271 | (set -x; helm init --upgrade >>$LOG 2>&1) >>$LOG 2>&1 |
| 272 | espin - $VERIFIED |
| 273 | bspin - "Add Google Incubator repository to Helm ..." |
| 274 | (set -x; helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com >>$LOG 2>&1) >>$LOG 2>&1 |
| 275 | espin - $VERIFIED |
| 276 | |
| 277 | bspin - "Add Google Stable repository to Helm ..." |
| 278 | (set -x; helm repo add stable https://kubernetes-charts.storage.googleapis.com >>$LOG 2>&1) >>$LOG 2>&1 |
| 279 | espin - $VERIFIED |
| 280 | bspin - "Add ONF repository to Helm ..." |
| 281 | (set -x; helm repo add onf https://charts.opencord.org >>$LOG 2>&1) >>$LOG 2>&1 |
| 282 | espin - $VERIFIED |
| 283 | bspin - "Update Helm repository cache ..." |
| 284 | (set -x; helm repo update >>$LOG 2>&1) >>$LOG 2>&1 |
| 285 | espin - $VERIFIED |
| 286 | |
| 287 | # Create and k8s service account so that Helm can create pods |
| 288 | bspin - "Create Tiller ServiceAccount ..." |
| 289 | (set -x; kubectl create serviceaccount --namespace kube-system tiller >>$LOG 2>&1) >>$LOG 2>&1 |
| 290 | espin - $VERIFIED |
| 291 | bspin - "Create Tiller ClusterRoleBinding ..." |
| 292 | (set -x; kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller >>$LOG 2>&1) >>$LOG 2>&1 |
| 293 | espin - $VERIFIED |
| 294 | bspin - "Update Tiller Manifest ..." |
| 295 | (set -x; kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}' >>$LOG 2>&1) >>$LOG 2>&1 |
| 296 | espin - $VERIFIED |
| 297 | else |
| 298 | espin $VERIFIED |
| 299 | fi |
| 300 | wait_for_pods - "kube-system" 1 -1 "Waiting for Tiller POD to start..." "tiller-deploy-.*" |
| 301 | |
| 302 | bspin "Verify ETCD Operator" |
| 303 | if [ $(helm list etcd-operator | grep -c DEPLOYED) -ne 1 ]; then |
| 304 | espin $NOT_VERIFIED |
| 305 | helm_install - voltha etcd-operator stable/etcd-operator "Install ETCD Operator" |
| 306 | else |
| 307 | espin $VERIFIED |
| 308 | fi |
| 309 | wait_for_pods - "voltha" 1 -1 "Waiting for ETCD Operator to start..." "etcd-operator-.*" |
| 310 | |
| 311 | bspin "Verify ONOS installed" |
| 312 | if [ $(helm list onos | grep -c DEPLOYED) -ne 1 ]; then |
| 313 | espin $NOT_VERIFIED |
| 314 | helm_install - default onos onf/onos "Install ONOS" |
| 315 | else |
| 316 | espin $VERIFIED |
| 317 | fi |
| 318 | wait_for_pods - "default" 1 -1 "Waiting for ONOS to start..." "onos-.*" |
| 319 | |
| 320 | bspin - "Forward ONOS API port" |
| 321 | (set -x; screen -p 0 -X -S onos-ui stuff $'\003' >>$LOG 2>&1) >>$LOG 2>&1 |
| 322 | (set -x; screen -dmS onos-ui kubectl port-forward service/onos-ui 8181:8181 >>$LOG 2>&1) >>$LOG 2>&1 |
| 323 | espin - $VERIFIED |
| 324 | bspin - "Forward ONOS SSH port" |
| 325 | (set -x; screen -p 0 -X -S onos-ssh stuff $'\003' >>$LOG 2>&1) >>$LOG 2>&1 |
| 326 | (set -x; screen -dmS onos-ssh kubectl port-forward service/onos-ssh 8101:8101 >>$LOG 2>&1) >>$LOG 2>&1 |
| 327 | espin - $VERIFIED |
| 328 | bspin - "Install required ONOS applications" |
| 329 | (set -x; ./onos-files/install-onos-applications.sh >>$LOG 2>&1) >>$LOG 2>&1 |
| 330 | espin - $VERIFIED |
| 331 | |
| 332 | bspin "Verify VOLTHA installed" |
| 333 | if [ $(helm list voltha | grep -c DEPLOYED) -ne 1 ]; then |
| 334 | espin $NOT_VERIFIED |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame^] | 335 | helm_install - voltha voltha onf/voltha "Install VOLTHA Core" |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 336 | else |
| 337 | espin $VERIFIED |
| 338 | fi |
| 339 | VOLTHA="ofagent-.* \ |
| 340 | ro-core.* \ |
| 341 | rw-core.* \ |
| 342 | voltha-api-server-.* \ |
| 343 | voltha-cli-server-.* \ |
| 344 | voltha-etcd-cluster-.* \ |
| 345 | voltha-kafka-.* \ |
| 346 | voltha-zookeeper-.*" |
Test User | d87942b | 2019-07-03 07:20:24 +0000 | [diff] [blame^] | 347 | wait_for_pods - "voltha" 9 -1 "Waiting for VOLTHA Core to start..." $VOLTHA |
David K. Bainbridge | b728543 | 2019-07-02 22:05:24 -0700 | [diff] [blame] | 348 | |
| 349 | echo "Verify Adapters" |
| 350 | bspin - "Verify Simulated Adapters installed" |
| 351 | if [ $(helm list sim | grep -c DEPLOYED) -ne 1 ]; then |
| 352 | espin - $NOT_VERIFIED |
| 353 | helm_install - voltha sim onf/voltha-adapter-simulated "Install Simulated Adapters" |
| 354 | else |
| 355 | espin - $VERIFIED |
| 356 | fi |
| 357 | |
| 358 | bspin - "Verify OpenOLT Adapter installed" |
| 359 | if [ $(helm list open-olt | grep -c DEPLOYED) -ne 1 ]; then |
| 360 | espin - $NOT_VERIFIED |
| 361 | helm_install - voltha open-olt onf/voltha-adapter-openolt "Install OpenOLT Adapter" |
| 362 | else |
| 363 | espin - $VERIFIED |
| 364 | fi |
| 365 | bspin - "Verify OpenONU Adapter installed" |
| 366 | if [ $(helm list open-onu | grep -c DEPLOYED) -ne 1 ]; then |
| 367 | espin - $NOT_VERIFIED |
| 368 | helm_install - voltha open-onu onf/voltha-adapter-openonu "Install OpenONU Adapter" |
| 369 | else |
| 370 | espin - $VERIFIED |
| 371 | fi |
| 372 | |
| 373 | ADAPTERS="adapter-.*" |
| 374 | wait_for_pods - "voltha" 4 -1 "Waiting for adapters to start..." $ADAPTERS |
| 375 | |
| 376 | echo "Restart VOLTHA API" |
| 377 | API="voltha-api-server-.* ofagent-.*" |
| 378 | (set -x; kubectl scale --replicas=0 deployment -n voltha voltha-api-server ofagent >>$LOG 2>&1) >>$LOG 2>&1 |
| 379 | wait_for_pods - "voltha" 0 -1 "Wait for API to stop" $API |
| 380 | (set -x; kubectl scale --replicas=1 deployment -n voltha voltha-api-server ofagent >>$LOG 2>&1) >>$LOG 2>&1 |
| 381 | wait_for_pods - "voltha" 2 -1 "Wait for API to re-start ..." $API |
| 382 | |
| 383 | bspin - "Forward VOLTHA API port" |
| 384 | (set -x; screen -p 0 -X -S voltha-api stuff $'\003' >>$LOG 2>&1) >>$LOG 2>&1 |
| 385 | (set -x; screen -dmS voltha-api kubectl port-forward -n voltha service/voltha-api 55555:55555 >>$LOG 2>&1) >>$LOG 2>&1 |
| 386 | espin - $VERIFIED |
| 387 | bspin - "Forward VOLTHA SSH port" |
| 388 | (set -x; screen -p 0 -X -S voltha-ssh stuff $'\003' 2>/dev/null >/dev/null >>$LOG 2>&1) >>$LOG 2>&1 |
| 389 | (set -x; screen -dmS voltha-ssh kubectl port-forward -n voltha service/voltha-cli 5022:5022 >>$LOG 2>&1) >>$LOG 2>&1 |
| 390 | espin - $VERIFIED |
Test User | 3d7ad8e | 2019-07-03 06:15:44 +0000 | [diff] [blame] | 391 | |
| 392 | bspin - "Create voltctl configuration file" |
| 393 | (set -x; mkdir -p $HOME/.volt >>$LOG 2>&1) >>$LOG 2>&1 |
| 394 | (set -x; voltctl -a v2 -s localhost:55555 config > $HOME/.volt/config 2>>$LOG) >>$LOG 2>&1 |
| 395 | espin - $VERIFIED |