Browse Source

Run shipyard from build VM (instead of Genesis)

Change-Id: I63126cbeaf95050f82bae2d1c6e8a7b3e49ed5b8
changes/39/636239/6
Kaspars Skels 3 months ago
parent
commit
e6586077b9

+ 12
- 7
tools/multi_nodes_gate/airship_gate/lib/airship.sh View File

@@ -8,17 +8,20 @@ install_ingress_ca() {
8 8
     return
9 9
   fi
10 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 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
 
16 16
 shipard_cmd_stdout() {
17
+  # needed to reach airship endpoints
18
+  dns_server=$(config_vm_ip "${BUILD_NAME}")
17 19
   install_ingress_ca
18
-  ssh_cmd "${GENESIS_NAME}" \
20
+  ssh_cmd "${BUILD_NAME}" \
19 21
     docker run -t --network=host \
20
-    -v "${GENESIS_WORK_DIR}:/work" \
21
-    -e OS_AUTH_URL=http://keystone.ucp.svc.cluster.local:80/v3 \
22
+    --dns ${dns_server} \
23
+    -v "${BUILD_WORK_DIR}:/work" \
24
+    -e OS_AUTH_URL=${AIRSHIP_KEYSTONE_URL} \
22 25
     -e OS_USERNAME=shipyard \
23 26
     -e OS_USER_DOMAIN_NAME=default \
24 27
     -e OS_PASSWORD="${SHIPYARD_PASSWORD}" \
@@ -40,10 +43,12 @@ shipyard_cmd() {
40 43
 }
41 44
 
42 45
 drydock_cmd_stdout() {
46
+  dns_server=$(config_vm_ip "${BUILD_NAME}")
43 47
   install_ingress_ca
44
-  ssh_cmd "${GENESIS_NAME}" \
48
+  ssh_cmd "${BUILD_NAME}" \
45 49
     docker run -t --network=host \
46
-    -v "${GENESIS_WORK_DIR}:/work" \
50
+    --dns ${dns_server} \
51
+    -v "${BUILD_WORK_DIR}:/work" \
47 52
     -e DD_URL=http://drydock-api.ucp.svc.cluster.local:9000 \
48 53
     -e OS_AUTH_URL=http://keystone.ucp.svc.cluster.local:80/v3 \
49 54
     -e OS_USERNAME=shipyard \

+ 4
- 2
tools/multi_nodes_gate/airship_gate/lib/config.sh View File

@@ -3,7 +3,7 @@ export DEFINITION_DEPOT="${TEMP_DIR}/site_yaml/"
3 3
 export CERT_DEPOT="${TEMP_DIR}/cert_yaml/"
4 4
 export GATE_DEPOT="${TEMP_DIR}/gate_yaml/"
5 5
 export SCRIPT_DEPOT="${TEMP_DIR}/scripts/"
6
-export GENESIS_WORK_DIR=${GENESIS_WORK_DIR:-/work}
6
+export BUILD_WORK_DIR=${BUILD_WORK_DIR:-/work}
7 7
 export BASE_IMAGE_SIZE=${BASE_IMAGE_SIZE:-68719476736}
8 8
 export BASE_IMAGE_URL=${BASE_IMAGE_URL:-https://cloud-images.ubuntu.com/releases/xenial/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img}
9 9
 export 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
12 12
 export IMAGE_COREDNS=${IMAGE_COREDNS:-docker.io/coredns/coredns:1.2.2}
13 13
 export IMAGE_DRYDOCK_CLI=${IMAGE_DRYDOCK_CLI:-quay.io/airshipit/drydock:d93d6d5a0a370ced536180612d1ade708e29cd47}
14 14
 export PROMENADE_DEBUG=${PROMENADE_DEBUG:-0}
15
-export SHIPYARD_PASSWORD=${SHIPYARD_OS_PASSWORD:-password18}
16 15
 export REGISTRY_DATA_DIR=${REGISTRY_DATA_DIR:-/mnt/registry}
17 16
 export VIRSH_POOL=${VIRSH_POOL:-airship}
18 17
 export VIRSH_POOL_PATH=${VIRSH_POOL_PATH:-/var/lib/libvirt/airship}
19 18
 export VIRSH_CPU_OPTS=${VIRSH_CPU_OPTS:-host}
20 19
 export UPSTREAM_DNS=${UPSTREAM_DNS:-"8.8.8.8 8.8.4.4"}
21 20
 
21
+export SHIPYARD_PASSWORD=${SHIPYARD_OS_PASSWORD:-'password18'}
22
+export AIRSHIP_KEYSTONE_URL=${AIRSHIP_KEYSTONE_URL:-'http://keystone.gate.local:80/v3'}
23
+
22 24
 config_vm_memory() {
23 25
     nodename=${1}
24 26
     jq -cr ".vm.${nodename}.memory" < "${GATE_MANIFEST}"

+ 1
- 0
tools/multi_nodes_gate/airship_gate/lib/const.sh View File

@@ -1,4 +1,5 @@
1 1
 export GENESIS_NAME=n0
2
+export BUILD_NAME=build
2 3
 export SSH_CONFIG_DIR=${WORKSPACE}/multi_nodes_gate/airship_gate/config-ssh
3 4
 export TEMPLATE_DIR=${WORKSPACE}/multi_nodes_gate/airship_gate/templates
4 5
 export XML_DIR=${WORKSPACE}/multi_nodes_gate/airship_gate/xml

+ 9
- 9
tools/multi_nodes_gate/airship_gate/stages/shipyard-load-design.sh View File

@@ -53,25 +53,25 @@ check_configdocs_result(){
53 53
 }
54 54
 
55 55
 # Copy site design to genesis node
56
-ssh_cmd "${GENESIS_NAME}" mkdir -p "${GENESIS_WORK_DIR}/site"
57
-rsync_cmd "${DEFINITION_DEPOT}"/*.yaml "${GENESIS_NAME}:${GENESIS_WORK_DIR}/site/"
56
+ssh_cmd "${BUILD_NAME}" mkdir -p "${BUILD_WORK_DIR}/site"
57
+rsync_cmd "${DEFINITION_DEPOT}"/*.yaml "${BUILD_NAME}:${BUILD_WORK_DIR}/site/"
58 58
 
59 59
 sleep 120
60 60
 
61
-check_configdocs_result "$(shipyard_cmd create configdocs design --directory=${GENESIS_WORK_DIR}/site --replace)"
61
+check_configdocs_result "$(shipyard_cmd create configdocs design --directory=${BUILD_WORK_DIR}/site --replace)"
62 62
 
63 63
 if [[ "${OMIT_CERTS}" == "0" ]]
64 64
 then
65
-  ssh_cmd "${GENESIS_NAME}" mkdir -p "${GENESIS_WORK_DIR}/certs"
66
-  rsync_cmd "${CERT_DEPOT}"/*.yaml "${GENESIS_NAME}:${GENESIS_WORK_DIR}/certs/"
67
-  check_configdocs_result "$(shipyard_cmd create configdocs certs --directory=${GENESIS_WORK_DIR}/certs --append)"
65
+  ssh_cmd "${BUILD_NAME}" mkdir -p "${BUILD_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=${BUILD_WORK_DIR}/certs --append)"
68 68
 fi
69 69
 
70 70
 if [[ "${OMIT_GATE}" == "0" ]]
71 71
 then
72
-  ssh_cmd "${GENESIS_NAME}" mkdir -p "${GENESIS_WORK_DIR}/gate"
73
-  rsync_cmd "${GATE_DEPOT}"/*.yaml "${GENESIS_NAME}:${GENESIS_WORK_DIR}/gate/"
74
-  check_configdocs_result "$(shipyard_cmd create configdocs gate --directory=${GENESIS_WORK_DIR}/gate --append)"
72
+  ssh_cmd "${BUILD_NAME}" mkdir -p "${BUILD_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=${BUILD_WORK_DIR}/gate --append)"
75 75
 fi
76 76
 
77 77
 check_configdocs_result "$(shipyard_cmd commit configdocs)"

Loading…
Cancel
Save