summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-10-15 08:33:31 +0000
committerGerrit Code Review <review@openstack.org>2018-10-15 08:33:31 +0000
commit00d35c441dec5a34788ef2a06d79f0e9d7f51551 (patch)
tree348d5707837ca9f9498f98418d9fea6249123348
parentfa01d6c2ab0f46567a24f79a6b8cddb2b25e654a (diff)
parent31872020503ea6b2cb68a13a29986bfd44a5b05f (diff)
Merge "Print more information on steps once deployment is complete"
-rw-r--r--manifests/common/creds.sh36
-rwxr-xr-xmanifests/common/deploy-airship.sh94
2 files changed, 117 insertions, 13 deletions
diff --git a/manifests/common/creds.sh b/manifests/common/creds.sh
index bc6de66..1550a19 100644
--- a/manifests/common/creds.sh
+++ b/manifests/common/creds.sh
@@ -15,14 +15,42 @@
15# limitations under the License. 15# limitations under the License.
16 16
17# Credentials that can be exported to work with Shipyard. 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# To set your environment variables to the values in this script, run using: 18# To set your environment variables to the values in this script, run using:
21# source creds.sh 19# source creds.sh
22# 20#
21
22SHIPYARD_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
23export OS_USER_DOMAIN_NAME=default 51export OS_USER_DOMAIN_NAME=default
24export OS_PROJECT_DOMAIN_NAME=default 52export OS_PROJECT_DOMAIN_NAME=default
25export OS_PROJECT_NAME=service 53export OS_PROJECT_NAME=service
26export OS_USERNAME=shipyard 54export OS_USERNAME=shipyard
27export OS_PASSWORD=password18 55export OS_PASSWORD="${SHIPYARD_KEYSTONE_PASSWORD}"
28export OS_AUTH_URL=http://keystone.ucp.svc.cluster.local:80/v3 \ No newline at end of file 56export OS_AUTH_URL=http://keystone.ucp.svc.cluster.local:80/v3
diff --git a/manifests/common/deploy-airship.sh b/manifests/common/deploy-airship.sh
index 64437df..a2991e5 100755
--- a/manifests/common/deploy-airship.sh
+++ b/manifests/common/deploy-airship.sh
@@ -275,15 +275,22 @@ function genesis_complete() {
275 275
276 set +x 276 set +x
277 echo "-----------" 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 echo "-----------" 279 echo "-----------"
280 sleep ${POST_GENESIS_DELAY} 280 sleep ${POST_GENESIS_DELAY}
281 echo " "
282 echo "Genesis complete. "
283 print_shipyard_info1
284 set -x
285}
281 286
287function 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 # signals that genesis completed 290 # signals that genesis completed
283 echo "Genesis complete. " 291 echo " "
284 echo "The .yaml files in ${WORKSPACE} contain the site design that may be suitable for use with Shipyard. " 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" 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"
286 cat ${WORKSPACE}/airship-in-a-bottle/deployment_files/site/${TARGET_SITE}/secrets/passphrases/ucp_shipyard_keystone_password.yaml
287 echo " " 294 echo " "
288 set -x 295 set -x
289} 296}
@@ -292,20 +299,19 @@ function setup_deploy_site() {
292 # creates a directory /${WORKSPACE}/site with all the things necessary to run 299 # creates a directory /${WORKSPACE}/site with all the things necessary to run
293 # deploy_site 300 # deploy_site
294 mkdir -p ${WORKSPACE}/site 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 cp ${WORKSPACE}/airship-in-a-bottle/manifests/common/creds.sh ${WORKSPACE}/site 302 cp ${WORKSPACE}/airship-in-a-bottle/manifests/common/creds.sh ${WORKSPACE}/site
298 cp ${WORKSPACE}/genesis/*.yaml ${WORKSPACE}/site 303 cp ${WORKSPACE}/genesis/*.yaml ${WORKSPACE}/site
299 cp ${WORKSPACE}/airship-shipyard/tools/run_shipyard.sh ${WORKSPACE}/site 304 cp ${WORKSPACE}/airship-shipyard/tools/run_shipyard.sh ${WORKSPACE}/site
300 cp ${WORKSPACE}/airship-shipyard/tools/shipyard_docker_base_command.sh ${WORKSPACE}/site 305 cp ${WORKSPACE}/airship-shipyard/tools/shipyard_docker_base_command.sh ${WORKSPACE}/site
301 cp ${WORKSPACE}/airship-shipyard/tools/execute_shipyard_action.sh ${WORKSPACE}/site 306 cp ${WORKSPACE}/airship-shipyard/tools/execute_shipyard_action.sh ${WORKSPACE}/site
307 print_shipyard_info2
308}
309function print_shipyard_info2() {
302 set +x 310 set +x
303 echo " " 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 echo "${WORKSPACE}/site contains .yaml files that represent the single-node site deployment. (deployment_files.yaml, certificates.yaml)" 313 echo "${WORKSPACE}/site contains .yaml files that represent the single-node site deployment. (deployment_files.yaml, certificates.yaml)"
306 echo " " 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 echo "----------------------------------------------------------------------------------" 315 echo "----------------------------------------------------------------------------------"
310 echo "The following commands will execute Shipyard to setup and run a deploy_site action" 316 echo "The following commands will execute Shipyard to setup and run a deploy_site action"
311 echo "----------------------------------------------------------------------------------" 317 echo "----------------------------------------------------------------------------------"
@@ -359,10 +365,73 @@ function execute_create_heat_stack() {
359 bash test_create_heat_stack.sh 365 bash test_create_heat_stack.sh
360} 366}
361 367
368function publish_horizon_dashboard() {
369 kubectl -n openstack expose service/horizon-int --type=NodePort --name=horizon-dashboard
370}
371
372function 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
412function 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
362function clean() { 430function clean() {
363 # Perform any cleanup of temporary or unused artifacts 431 # Perform any cleanup of temporary or unused artifacts
364 set +x 432 set +x
365 echo "To remove files generated during this script's execution, delete ${WORKSPACE}." 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 set -x 435 set -x
367} 436}
368 437
@@ -388,6 +457,7 @@ configure_docker || error "configuring docker behind proxy"
388 457
389# collect 458# collect
390if [[ ${STEP_BREAKPOINT} -ge 10 ]]; then 459if [[ ${STEP_BREAKPOINT} -ge 10 ]]; then
460 echo "This is a good time to grab a coffee :)"
391 run_pegleg_collect || error "running pegleg collect" 461 run_pegleg_collect || error "running pegleg collect"
392fi 462fi
393 463
@@ -411,4 +481,10 @@ fi
411# demo 481# demo
412if [[ ${STEP_BREAKPOINT} -ge 40 ]]; then 482if [[ ${STEP_BREAKPOINT} -ge 40 ]]; then
413 execute_create_heat_stack || error "creating heat stack" 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
414fi 490fi