Browse Source

Merge "Print more information on steps once deployment is complete"

Zuul 6 months ago
parent
commit
00d35c441d
2 changed files with 117 additions and 13 deletions
  1. 32
    4
      manifests/common/creds.sh
  2. 85
    9
      manifests/common/deploy-airship.sh

+ 32
- 4
manifests/common/creds.sh View File

@@ -15,14 +15,42 @@
15 15
 # limitations under the License.
16 16
 
17 17
 # Credentials that can be exported to work with Shipyard.
18
-# Note that if the password was changed before the deployment, it will need to
19
-# be changed to match here.
20 18
 # To set your environment variables to the values in this script, run using:
21 19
 # source creds.sh
22 20
 #
21
+
22
+SHIPYARD_KEYSTONE_PASSWORD=$(awk '
23
+## format we are looking for:
24
+#schema: deckhand/Passphrase/v1
25
+#metadata:
26
+#  schema: metadata/Document/v1
27
+#  name: ucp_shipyard_keystone_password
28
+#  layeringDefinition:
29
+#    abstract: false
30
+#    layer: site
31
+#  storagePolicy: cleartext
32
+#data: password18
33
+    /^schema: deckhand\/Passphrase\/v1/ {
34
+        getline
35
+        getline
36
+        getline
37
+        if ($2=="ucp_shipyard_keystone_password") {
38
+            getline
39
+            getline
40
+            getline
41
+            getline
42
+            getline
43
+            print $2
44
+            exit
45
+      }
46
+      else {
47
+          getline
48
+      }
49
+}' deployment_files.yaml)
50
+
23 51
 export OS_USER_DOMAIN_NAME=default
24 52
 export OS_PROJECT_DOMAIN_NAME=default
25 53
 export OS_PROJECT_NAME=service
26 54
 export OS_USERNAME=shipyard
27
-export OS_PASSWORD=password18
28
-export OS_AUTH_URL=http://keystone.ucp.svc.cluster.local:80/v3
55
+export OS_PASSWORD="${SHIPYARD_KEYSTONE_PASSWORD}"
56
+export OS_AUTH_URL=http://keystone.ucp.svc.cluster.local:80/v3

+ 85
- 9
manifests/common/deploy-airship.sh View File

@@ -275,15 +275,22 @@ function genesis_complete() {
275 275
 
276 276
   set +x
277 277
   echo "-----------"
278
-  echo "Waiting ${POST_GENESIS_DELAY} seconds for Genesis process to settle. This is a good time to grab a coffee :)"
278
+  echo "Waiting ${POST_GENESIS_DELAY} seconds for Genesis process to settle. This is a good time to grab one more coffee :)"
279 279
   echo "-----------"
280 280
   sleep ${POST_GENESIS_DELAY}
281
+  echo " "
282
+  echo "Genesis complete. "
283
+  print_shipyard_info1
284
+  set -x
285
+}
281 286
 
287
+function print_shipyard_info1() {
288
+  SHIPYARD_KEYSTONE_PASS=$(awk '/^data:/ {print $2}' ${WORKSPACE}/airship-in-a-bottle/deployment_files/site/${TARGET_SITE}/secrets/passphrases/ucp_shipyard_keystone_password.yaml)
289
+  set +x
282 290
   # signals that genesis completed
283
-  echo "Genesis complete. "
291
+  echo " "
284 292
   echo "The .yaml files in ${WORKSPACE} contain the site design that may be suitable for use with Shipyard. "
285
-  echo "The Shipyard Keystone password may be found in ${WORKSPACE}/airship-in-a-bottle/deployment_files/site/${TARGET_SITE}/secrets/passphrases/ucp_shipyard_keystone_password.yaml"
286
-  cat ${WORKSPACE}/airship-in-a-bottle/deployment_files/site/${TARGET_SITE}/secrets/passphrases/ucp_shipyard_keystone_password.yaml
293
+  echo "The Shipyard Keystone password ${SHIPYARD_KEYSTONE_PASS} may be found in ${WORKSPACE}/airship-in-a-bottle/deployment_files/site/${TARGET_SITE}/secrets/passphrases/ucp_shipyard_keystone_password.yaml"
287 294
   echo " "
288 295
   set -x
289 296
 }
@@ -292,20 +299,19 @@ function setup_deploy_site() {
292 299
   # creates a directory /${WORKSPACE}/site with all the things necessary to run
293 300
   # deploy_site
294 301
   mkdir -p ${WORKSPACE}/site
295
-  # TODO: (bryan-strassner) make creds.sh contain the Shipyard-Keystone
296
-  #     password sourced from the target design used.
297 302
   cp ${WORKSPACE}/airship-in-a-bottle/manifests/common/creds.sh ${WORKSPACE}/site
298 303
   cp ${WORKSPACE}/genesis/*.yaml ${WORKSPACE}/site
299 304
   cp ${WORKSPACE}/airship-shipyard/tools/run_shipyard.sh ${WORKSPACE}/site
300 305
   cp ${WORKSPACE}/airship-shipyard/tools/shipyard_docker_base_command.sh ${WORKSPACE}/site
301 306
   cp ${WORKSPACE}/airship-shipyard/tools/execute_shipyard_action.sh ${WORKSPACE}/site
307
+  print_shipyard_info2
308
+}
309
+function print_shipyard_info2() {
302 310
   set +x
303 311
   echo " "
304
-  echo "${WORKSPACE}/site is now set up with creds.sh which can be sourced to set up credentials for use in running Shipyard"
312
+  echo "${WORKSPACE}/site is set up with creds.sh which can be sourced to set up credentials for use in running Shipyard"
305 313
   echo "${WORKSPACE}/site contains .yaml files that represent the single-node site deployment. (deployment_files.yaml, certificates.yaml)"
306 314
   echo " "
307
-  echo "NOTE: If you changed the Shipyard keystone password (see above printouts), the creds.sh file needs to be updated to match before use."
308
-  echo " "
309 315
   echo "----------------------------------------------------------------------------------"
310 316
   echo "The following commands will execute Shipyard to setup and run a deploy_site action"
311 317
   echo "----------------------------------------------------------------------------------"
@@ -359,10 +365,73 @@ function execute_create_heat_stack() {
359 365
   bash test_create_heat_stack.sh
360 366
 }
361 367
 
368
+function publish_horizon_dashboard() {
369
+  kubectl -n openstack expose service/horizon-int --type=NodePort --name=horizon-dashboard
370
+}
371
+
372
+function print_dashboards() {
373
+  AIRFLOW_PORT=$(kubectl -n ucp get service airflow-web-int -o jsonpath="{.spec.ports[0].nodePort}")
374
+  HORIZON_PORT=$(kubectl -n openstack get service horizon-dashboard -o jsonpath="{.spec.ports[0].nodePort}")
375
+  MAAS_PORT=$(kubectl -n ucp get service maas-region-ui -o jsonpath="{.spec.ports[0].nodePort}")
376
+  MASS_PASS=$(awk '/^data:/ {print $2}' ${WORKSPACE}/airship-in-a-bottle/deployment_files/site/${TARGET_SITE}/secrets/passphrases/ucp_maas_admin_password.yaml)
377
+  set +x
378
+  echo " "
379
+  echo "OpenStack Horizon dashboard is available on this host at the following URL:"
380
+  echo " "
381
+  echo "  http://${HOSTIP}:${HORIZON_PORT}"
382
+  echo " "
383
+  # TODO: (roman_g) can we source it from somewhere?
384
+  echo "Credentials:"
385
+  echo "  Domain: default"
386
+  echo "  Username: admin"
387
+  echo "  Password: password"
388
+  echo " "
389
+  echo "OpenStack CLI commands could be launched via \`./run_openstack_cli.sh\` script, e.g.:"
390
+  echo "  # cd ${WORKSPACE}/airship-in-a-bottle/manifests/dev_single_node"
391
+  echo "  # ./run_openstack_cli.sh stack list"
392
+  echo "  ..."
393
+  echo "  "
394
+  echo "Other dashboards:"
395
+  echo " "
396
+  echo "  MAAS: http://${HOSTIP}:${MAAS_PORT}/MAAS/ admin/${MASS_PASS}"
397
+  echo "  Airship Shipyard Airflow DAG: http://${HOSTIP}:${AIRFLOW_PORT}/"
398
+  echo " "
399
+  echo "Airship itself does not have a dashboard."
400
+  echo " "
401
+  # TODO: (roman_g) endpoints.yaml path below does not seem to be a reliable location
402
+  echo "Other endpoints and credentials are listed in the following locations:"
403
+  echo "  ${WORKSPACE}/airship-in-a-bottle/deployment_files/global/v1.0${TARGET_SITE}/software/config/endpoints.yaml"
404
+  echo "  ${WORKSPACE}/airship-in-a-bottle/deployment_files/site/${TARGET_SITE}/secrets/passphrases/"
405
+  echo "Exposed ports of services can be listed with the following command:"
406
+  echo "  # kubectl get services --all-namespaces | grep -v ClusterIP"
407
+  echo "  ..."
408
+  echo " "
409
+  set -x
410
+}
411
+
412
+function your_next_steps() {
413
+  set +x
414
+  echo " "
415
+  echo "---------------------------------------------------------------"
416
+  echo " "
417
+  echo "Airship has completed deployment of OpenStack (OpenStack-Helm)."
418
+  echo " "
419
+  echo "Explore Airship Treasuremap repository and documentation"
420
+  echo "available at the following URLs:"
421
+  echo " "
422
+  echo "  https://github.com/openstack/airship-treasuremap"
423
+  echo "  https://airship-treasuremap.readthedocs.io/"
424
+  echo " "
425
+  echo "---------------------------------------------------------------"
426
+  echo " "
427
+  set -x
428
+}
429
+
362 430
 function clean() {
363 431
   # Perform any cleanup of temporary or unused artifacts
364 432
   set +x
365 433
   echo "To remove files generated during this script's execution, delete ${WORKSPACE}."
434
+  echo "This VM is disposable. Re-deployment in this same VM will lead to unpredictable results."
366 435
   set -x
367 436
 }
368 437
 
@@ -388,6 +457,7 @@ configure_docker || error "configuring docker behind proxy"
388 457
 
389 458
 # collect
390 459
 if [[ ${STEP_BREAKPOINT} -ge 10 ]]; then
460
+  echo "This is a good time to grab a coffee :)"
391 461
   run_pegleg_collect || error "running pegleg collect"
392 462
 fi
393 463
 
@@ -411,4 +481,10 @@ fi
411 481
 # demo
412 482
 if [[ ${STEP_BREAKPOINT} -ge 40 ]]; then
413 483
   execute_create_heat_stack || error "creating heat stack"
484
+  publish_horizon_dashboard || error "publishing Horizon dashboard"
485
+  print_shipyard_info1
486
+  print_shipyard_info2
487
+  print_dashboards || error "printing dashboards list"
488
+  ## Done
489
+  your_next_steps
414 490
 fi

Loading…
Cancel
Save