summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaspars Skels <kaspars.skels@gmail.com>2019-02-11 17:43:31 -0600
committerKaspars Skels <kaspars.skels@gmail.com>2019-02-15 16:28:54 +0000
commite6586077b9f56a319fa43be3cfde6713d02942cb (patch)
tree2092f1fd9629b57cc9cbb0a50157568f1dd18c36
parentf475f40246b52fa40da0859c15acc88dab52ea12 (diff)
Run shipyard from build VM (instead of Genesis)
Notes
Notes (review): Code-Review+1: Stas Egorov <segorov@mirantis.com> Code-Review+1: Sirajudeen <sirajudeen.yasin@gmail.com> Code-Review+1: Vladyslav Drok <vdrok@mirantis.com> Code-Review+1: Dimitrios Markou <dimitrios.markou@att.com> Code-Review+1: Robert Boyd <rb422w@att.com> Code-Review+1: Ahmad Mahmoudi <am495p@att.com> Code-Review+2: Roman Gorshunov <roman.gorshunov@att.com> Code-Review+2: Bryan Strassner <strassner.bryan@gmail.com> Workflow+1: Kaspars Skels <kaspars.skels@gmail.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 15 Feb 2019 17:00:42 +0000 Reviewed-on: https://review.openstack.org/636239 Project: openstack/airship-in-a-bottle Branch: refs/heads/master
-rw-r--r--tools/multi_nodes_gate/airship_gate/lib/airship.sh19
-rw-r--r--tools/multi_nodes_gate/airship_gate/lib/config.sh6
-rw-r--r--tools/multi_nodes_gate/airship_gate/lib/const.sh1
-rwxr-xr-xtools/multi_nodes_gate/airship_gate/stages/shipyard-load-design.sh18
4 files changed, 26 insertions, 18 deletions
diff --git a/tools/multi_nodes_gate/airship_gate/lib/airship.sh b/tools/multi_nodes_gate/airship_gate/lib/airship.sh
index 35fa938..a0b2a43 100644
--- a/tools/multi_nodes_gate/airship_gate/lib/airship.sh
+++ b/tools/multi_nodes_gate/airship_gate/lib/airship.sh
@@ -8,17 +8,20 @@ install_ingress_ca() {
8 return 8 return
9 fi 9 fi
10 local_file="${TEMP_DIR}/ingress_ca.pem" 10 local_file="${TEMP_DIR}/ingress_ca.pem"
11 remote_file="${GENESIS_WORK_DIR}/ingress_ca.pem" 11 remote_file="${BUILD_WORK_DIR}/ingress_ca.pem"
12 cat <<< "$ingress_ca" > "$local_file" 12 cat <<< "$ingress_ca" > "$local_file"
13 rsync_cmd "$local_file" "${GENESIS_NAME}":"$remote_file" 13 rsync_cmd "$local_file" "${BUILD_NAME}":"$remote_file"
14} 14}
15 15
16shipard_cmd_stdout() { 16shipard_cmd_stdout() {
17 # needed to reach airship endpoints
18 dns_server=$(config_vm_ip "${BUILD_NAME}")
17 install_ingress_ca 19 install_ingress_ca
18 ssh_cmd "${GENESIS_NAME}" \ 20 ssh_cmd "${BUILD_NAME}" \
19 docker run -t --network=host \ 21 docker run -t --network=host \
20 -v "${GENESIS_WORK_DIR}:/work" \ 22 --dns ${dns_server} \
21 -e OS_AUTH_URL=http://keystone.ucp.svc.cluster.local:80/v3 \ 23 -v "${BUILD_WORK_DIR}:/work" \
24 -e OS_AUTH_URL=${AIRSHIP_KEYSTONE_URL} \
22 -e OS_USERNAME=shipyard \ 25 -e OS_USERNAME=shipyard \
23 -e OS_USER_DOMAIN_NAME=default \ 26 -e OS_USER_DOMAIN_NAME=default \
24 -e OS_PASSWORD="${SHIPYARD_PASSWORD}" \ 27 -e OS_PASSWORD="${SHIPYARD_PASSWORD}" \
@@ -40,10 +43,12 @@ shipyard_cmd() {
40} 43}
41 44
42drydock_cmd_stdout() { 45drydock_cmd_stdout() {
46 dns_server=$(config_vm_ip "${BUILD_NAME}")
43 install_ingress_ca 47 install_ingress_ca
44 ssh_cmd "${GENESIS_NAME}" \ 48 ssh_cmd "${BUILD_NAME}" \
45 docker run -t --network=host \ 49 docker run -t --network=host \
46 -v "${GENESIS_WORK_DIR}:/work" \ 50 --dns ${dns_server} \
51 -v "${BUILD_WORK_DIR}:/work" \
47 -e DD_URL=http://drydock-api.ucp.svc.cluster.local:9000 \ 52 -e DD_URL=http://drydock-api.ucp.svc.cluster.local:9000 \
48 -e OS_AUTH_URL=http://keystone.ucp.svc.cluster.local:80/v3 \ 53 -e OS_AUTH_URL=http://keystone.ucp.svc.cluster.local:80/v3 \
49 -e OS_USERNAME=shipyard \ 54 -e OS_USERNAME=shipyard \
diff --git a/tools/multi_nodes_gate/airship_gate/lib/config.sh b/tools/multi_nodes_gate/airship_gate/lib/config.sh
index d42d064..98f6dcc 100644
--- a/tools/multi_nodes_gate/airship_gate/lib/config.sh
+++ b/tools/multi_nodes_gate/airship_gate/lib/config.sh
@@ -3,7 +3,7 @@ export DEFINITION_DEPOT="${TEMP_DIR}/site_yaml/"
3export CERT_DEPOT="${TEMP_DIR}/cert_yaml/" 3export CERT_DEPOT="${TEMP_DIR}/cert_yaml/"
4export GATE_DEPOT="${TEMP_DIR}/gate_yaml/" 4export GATE_DEPOT="${TEMP_DIR}/gate_yaml/"
5export SCRIPT_DEPOT="${TEMP_DIR}/scripts/" 5export SCRIPT_DEPOT="${TEMP_DIR}/scripts/"
6export GENESIS_WORK_DIR=${GENESIS_WORK_DIR:-/work} 6export BUILD_WORK_DIR=${BUILD_WORK_DIR:-/work}
7export BASE_IMAGE_SIZE=${BASE_IMAGE_SIZE:-68719476736} 7export BASE_IMAGE_SIZE=${BASE_IMAGE_SIZE:-68719476736}
8export BASE_IMAGE_URL=${BASE_IMAGE_URL:-https://cloud-images.ubuntu.com/releases/xenial/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img} 8export BASE_IMAGE_URL=${BASE_IMAGE_URL:-https://cloud-images.ubuntu.com/releases/xenial/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img}
9export IMAGE_PROMENADE_CLI=${IMAGE_PROMENADE_CLI:-quay.io/airshipit/promenade:cfb8aa498c294c2adbc369ba5aaee19b49550d22} 9export IMAGE_PROMENADE_CLI=${IMAGE_PROMENADE_CLI:-quay.io/airshipit/promenade:cfb8aa498c294c2adbc369ba5aaee19b49550d22}
@@ -12,13 +12,15 @@ export IMAGE_SHIPYARD_CLI=${IMAGE_SHIPYARD_CLI:-quay.io/airshipit/shipyard:4dd6b
12export IMAGE_COREDNS=${IMAGE_COREDNS:-docker.io/coredns/coredns:1.2.2} 12export IMAGE_COREDNS=${IMAGE_COREDNS:-docker.io/coredns/coredns:1.2.2}
13export IMAGE_DRYDOCK_CLI=${IMAGE_DRYDOCK_CLI:-quay.io/airshipit/drydock:d93d6d5a0a370ced536180612d1ade708e29cd47} 13export IMAGE_DRYDOCK_CLI=${IMAGE_DRYDOCK_CLI:-quay.io/airshipit/drydock:d93d6d5a0a370ced536180612d1ade708e29cd47}
14export PROMENADE_DEBUG=${PROMENADE_DEBUG:-0} 14export PROMENADE_DEBUG=${PROMENADE_DEBUG:-0}
15export SHIPYARD_PASSWORD=${SHIPYARD_OS_PASSWORD:-password18}
16export REGISTRY_DATA_DIR=${REGISTRY_DATA_DIR:-/mnt/registry} 15export REGISTRY_DATA_DIR=${REGISTRY_DATA_DIR:-/mnt/registry}
17export VIRSH_POOL=${VIRSH_POOL:-airship} 16export VIRSH_POOL=${VIRSH_POOL:-airship}
18export VIRSH_POOL_PATH=${VIRSH_POOL_PATH:-/var/lib/libvirt/airship} 17export VIRSH_POOL_PATH=${VIRSH_POOL_PATH:-/var/lib/libvirt/airship}
19export VIRSH_CPU_OPTS=${VIRSH_CPU_OPTS:-host} 18export VIRSH_CPU_OPTS=${VIRSH_CPU_OPTS:-host}
20export UPSTREAM_DNS=${UPSTREAM_DNS:-"8.8.8.8 8.8.4.4"} 19export UPSTREAM_DNS=${UPSTREAM_DNS:-"8.8.8.8 8.8.4.4"}
21 20
21export SHIPYARD_PASSWORD=${SHIPYARD_OS_PASSWORD:-'password18'}
22export AIRSHIP_KEYSTONE_URL=${AIRSHIP_KEYSTONE_URL:-'http://keystone.gate.local:80/v3'}
23
22config_vm_memory() { 24config_vm_memory() {
23 nodename=${1} 25 nodename=${1}
24 jq -cr ".vm.${nodename}.memory" < "${GATE_MANIFEST}" 26 jq -cr ".vm.${nodename}.memory" < "${GATE_MANIFEST}"
diff --git a/tools/multi_nodes_gate/airship_gate/lib/const.sh b/tools/multi_nodes_gate/airship_gate/lib/const.sh
index 5555f87..7dc50a9 100644
--- a/tools/multi_nodes_gate/airship_gate/lib/const.sh
+++ b/tools/multi_nodes_gate/airship_gate/lib/const.sh
@@ -1,4 +1,5 @@
1export GENESIS_NAME=n0 1export GENESIS_NAME=n0
2export BUILD_NAME=build
2export SSH_CONFIG_DIR=${WORKSPACE}/multi_nodes_gate/airship_gate/config-ssh 3export SSH_CONFIG_DIR=${WORKSPACE}/multi_nodes_gate/airship_gate/config-ssh
3export TEMPLATE_DIR=${WORKSPACE}/multi_nodes_gate/airship_gate/templates 4export TEMPLATE_DIR=${WORKSPACE}/multi_nodes_gate/airship_gate/templates
4export XML_DIR=${WORKSPACE}/multi_nodes_gate/airship_gate/xml 5export XML_DIR=${WORKSPACE}/multi_nodes_gate/airship_gate/xml
diff --git a/tools/multi_nodes_gate/airship_gate/stages/shipyard-load-design.sh b/tools/multi_nodes_gate/airship_gate/stages/shipyard-load-design.sh
index 407c47a..9356876 100755
--- a/tools/multi_nodes_gate/airship_gate/stages/shipyard-load-design.sh
+++ b/tools/multi_nodes_gate/airship_gate/stages/shipyard-load-design.sh
@@ -53,25 +53,25 @@ check_configdocs_result(){
53} 53}
54 54
55# Copy site design to genesis node 55# Copy site design to genesis node
56ssh_cmd "${GENESIS_NAME}" mkdir -p "${GENESIS_WORK_DIR}/site" 56ssh_cmd "${BUILD_NAME}" mkdir -p "${BUILD_WORK_DIR}/site"
57rsync_cmd "${DEFINITION_DEPOT}"/*.yaml "${GENESIS_NAME}:${GENESIS_WORK_DIR}/site/" 57rsync_cmd "${DEFINITION_DEPOT}"/*.yaml "${BUILD_NAME}:${BUILD_WORK_DIR}/site/"
58 58
59sleep 120 59sleep 120
60 60
61check_configdocs_result "$(shipyard_cmd create configdocs design --directory=${GENESIS_WORK_DIR}/site --replace)" 61check_configdocs_result "$(shipyard_cmd create configdocs design --directory=${BUILD_WORK_DIR}/site --replace)"
62 62
63if [[ "${OMIT_CERTS}" == "0" ]] 63if [[ "${OMIT_CERTS}" == "0" ]]
64then 64then
65 ssh_cmd "${GENESIS_NAME}" mkdir -p "${GENESIS_WORK_DIR}/certs" 65 ssh_cmd "${BUILD_NAME}" mkdir -p "${BUILD_WORK_DIR}/certs"
66 rsync_cmd "${CERT_DEPOT}"/*.yaml "${GENESIS_NAME}:${GENESIS_WORK_DIR}/certs/" 66 rsync_cmd "${CERT_DEPOT}"/*.yaml "${BUILD_NAME}:${BUILD_WORK_DIR}/certs/"
67 check_configdocs_result "$(shipyard_cmd create configdocs certs --directory=${GENESIS_WORK_DIR}/certs --append)" 67 check_configdocs_result "$(shipyard_cmd create configdocs certs --directory=${BUILD_WORK_DIR}/certs --append)"
68fi 68fi
69 69
70if [[ "${OMIT_GATE}" == "0" ]] 70if [[ "${OMIT_GATE}" == "0" ]]
71then 71then
72 ssh_cmd "${GENESIS_NAME}" mkdir -p "${GENESIS_WORK_DIR}/gate" 72 ssh_cmd "${BUILD_NAME}" mkdir -p "${BUILD_WORK_DIR}/gate"
73 rsync_cmd "${GATE_DEPOT}"/*.yaml "${GENESIS_NAME}:${GENESIS_WORK_DIR}/gate/" 73 rsync_cmd "${GATE_DEPOT}"/*.yaml "${BUILD_NAME}:${BUILD_WORK_DIR}/gate/"
74 check_configdocs_result "$(shipyard_cmd create configdocs gate --directory=${GENESIS_WORK_DIR}/gate --append)" 74 check_configdocs_result "$(shipyard_cmd create configdocs gate --directory=${BUILD_WORK_DIR}/gate --append)"
75fi 75fi
76 76
77check_configdocs_result "$(shipyard_cmd commit configdocs)" 77check_configdocs_result "$(shipyard_cmd commit configdocs)"