]> review.fuel-infra Code Review - tools/sustaining.git/commitdiff
Add location self-awareness to nodes 87/41287/3
authorVladimir Khlyunev <vkhlyunev@mirantis.com>
Mon, 6 May 2019 12:24:35 +0000 (16:24 +0400)
committerVladimir Khlyunev <vkhlyunev@mirantis.com>
Mon, 6 May 2019 12:40:49 +0000 (16:40 +0400)
Knowledge about "where this node is" required
for mirror selection

Change-Id: I677f87dc52342deab1545f79f07e7f51bb612e4f

maintenance-ci/common/data/jenkins-slave.yml
maintenance-ci/common/data/mos-dev-slave.yml
maintenance-ci/common/data/mos-slave.yml
maintenance-ci/common/scripts/deploy_heat_stack.sh
maintenance-ci/mos/scripts/guess-mirror.sh

index 61c80cb97608e61fab67c64d0cace8a145491d35..c549726a8d72b96ed523fe0a1d0ccec3c6b42f34 100644 (file)
@@ -30,6 +30,10 @@ parameters:
     type: string
     default: ''
     description: List of labels for jenkins swarm agent separated by whitespace
+  location:
+    type: string
+    default: 'EU'
+    description: Backend cluster location (available "EU" and "US")
 
 resources:
   wait_condition:
@@ -116,6 +120,7 @@ resources:
             echo "FLAVOR LABELS" > /etc/jenkins-agent/labels
             echo "127.0.0.1 $(hostname)" >> /etc/hosts
             echo "FLOATING" > /etc/jenkins-agent/description
+            echo "OPENSTACK_ENVIRONMENT" > /etc/jenkins-agent/location
             systemctl enable jenkins-swarm-agent
             #service jenkins-swarm-agent start
             apt update
@@ -130,6 +135,7 @@ resources:
            LABELS: {get_param: jenkins_labels}
            wc_notify: { get_attr: [wait_handle, curl_cli] }
            FLOATING: { get_attr: [ floating_ip, floating_ip_address ] }
+           OPENSTACK_ENVIRONMENT: {get_param: location}
 
 
 outputs:
index ce0fb7dfc403e5b09c6ddfeb50bb0aa421f08874..36fdb7326043259cc99e863fe65193d3a9492622 100644 (file)
@@ -30,6 +30,10 @@ parameters:
     type: string
     default: ''
     description: List of labels for jenkins swarm agent separated by whitespace
+  location:
+    type: string
+    default: 'EU'
+    description: Backend cluster location (available "EU" and "US")
 
 resources:
   wait_condition:
@@ -116,6 +120,7 @@ resources:
             echo "LABELS" > /etc/jenkins-agent/labels
             echo "127.0.0.1 $(hostname)" >> /etc/hosts
             echo "FLOATING" > /etc/jenkins-agent/description
+            echo "OPENSTACK_ENVIRONMENT" > /etc/jenkins-agent/location
 
             apt update
             sed -i 's/^\(GRUB_CMDLINE_LINUX_DEFAULT=\).*$/\1\"console=tty1 console=ttyS0 noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier\"/g' /etc/default/grub.d/50-cloudimg-settings.cfg
@@ -129,6 +134,7 @@ resources:
            LABELS: {get_param: jenkins_labels}
            wc_notify: { get_attr: [wait_handle, curl_cli] }
            FLOATING: { get_attr: [ floating_ip, floating_ip_address ] }
+           OPENSTACK_ENVIRONMENT: {get_param: location}
 
 
 outputs:
index 91e6621372341ce606ce3a573428e70484bfbfe3..852a53ea4f55457d1e3e03e21dd7db8940daa23c 100644 (file)
@@ -30,6 +30,10 @@ parameters:
     type: string
     default: ''
     description: List of labels for jenkins swarm agent separated by whitespace
+  location:
+    type: string
+    default: 'EU'
+    description: Backend cluster location (available "EU" and "US")
 
 resources:
   wait_condition:
@@ -116,6 +120,7 @@ resources:
             echo "FLAVOR LABELS" > /etc/jenkins-agent/labels
             echo "127.0.0.1 $(hostname)" >> /etc/hosts
             echo "FLOATING" > /etc/jenkins-agent/description
+            echo "OPENSTACK_ENVIRONMENT" > /etc/jenkins-agent/location
 
             apt update
             sed -i 's/^\(GRUB_CMDLINE_LINUX_DEFAULT=\).*$/\1\"console=tty1 console=ttyS0 noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier\"/g' /etc/default/grub.d/50-cloudimg-settings.cfg
@@ -130,6 +135,7 @@ resources:
            LABELS: {get_param: jenkins_labels}
            wc_notify: { get_attr: [wait_handle, curl_cli] }
            FLOATING: { get_attr: [ floating_ip, floating_ip_address ] }
+           OPENSTACK_ENVIRONMENT: {get_param: location}
 
 
 outputs:
index 950ce95d2fb38476390c9f0d02a5137703351a35..ec3e12656d9a00f36fb3e9cc5a07d61cc2215a98 100755 (executable)
@@ -11,7 +11,7 @@ if [[ ! -d "${OPENSTACK_CLIENTS_VENV}" ]] ; then
     deactivate
 fi
 
-parameter_string=""
+parameter_string="location=${OPENSTACK_ENVIRONMENT}"
 if [[ ! -z "${FLAVOR_NAME}" ]] ; then
   parameter_string="flavor=${FLAVOR_NAME};$parameter_string"
 fi
index 609a28031821e4fe79baf878d759d5b4b3407d3d..f6d23811b91f7caa773e0b7eeca01c81f0c2a8ed 100644 (file)
@@ -16,7 +16,8 @@ fi
 if [[ ! -z "${MIRROR_HOST}" ]] ; then
   MIRROR_HOST="${MIRROR_HOST}"
 else
-  MIRROR_HOST="${OPENSTACK_ENVIRONMENT,,}.mirror.fuel-infra.org"
+  location="$(cat /etc/jenkins-agent/location)"
+  MIRROR_HOST="${location,,}.mirror.fuel-infra.org"
 fi
 
 ###################### Get MIRROR_UBUNTU ###############