From 6f9af2e409a9576fa2f2ba7384d4c586292cc427 Mon Sep 17 00:00:00 2001 From: Eesaan Atluri <atlurie@uab.edu> Date: Wed, 21 May 2025 20:32:52 -0500 Subject: [PATCH 1/7] feat: Automate ood knightly build and deploy in a single pipeline --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 25048fe..aedeffe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -210,7 +210,7 @@ build_ood_image: reports: dotenv: image.env rules: - - if: $PIPELINE_TARGET == "build" && $BUILD_TARGET == "ood" + - if: $BUILD_TARGET == "ood" when: always deploy_http_proxy_node: @@ -380,6 +380,7 @@ deploy_ood_node: tags: - build script: + - OOD_IMAGE_ID="${BUILT_OOD_IMAGE_ID:-$OOD_IMAGE_ID}" - openstack image set --accept $OOD_IMAGE_ID || true - FAILED=false - | @@ -424,5 +425,5 @@ deploy_ood_node: openstack server add floating ip $OOD_INSTANCE_ID $OOD_FLOATING_IP done rules: - - if: $PIPELINE_TARGET == "deploy" && $OOD_IMAGE_ID + - if: $DEPLOY_TARGET == "ood" when: always -- GitLab From 3c4256bf981d6ee0376842791e89c8ece511eca1 Mon Sep 17 00:00:00 2001 From: Eesaan Atluri <atlurie@uab.edu> Date: Thu, 22 May 2025 02:44:48 -0500 Subject: [PATCH 2/7] Detach the floating ips to assign to new instance --- .gitlab-ci.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index aedeffe..3035c4a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,6 +26,7 @@ variables: INSTANCE_FLAVOR: "m1.medium-ruffner" HTTP_PROXY_INSTANCE_NAME: "http-proxy" SSH_PROXY_INSTANCE_NAME: "ssh-proxy" + NUM_SERVERS_TO_KEEP: "1" stages: - build @@ -379,6 +380,17 @@ deploy_ood_node: name: $ENV tags: - build + before_script: + - | + for OOD_FLOATING_IP in ${OOD_FLOATING_IP_LIST[@]}; do + OOD_FIXED_IP=$( + openstack floating ip list \ + --floating-ip-address $OOD_FLOATING_IP -c "Fixed IP Address" -f value) + CURRENT_INSTANCE_ID=$( + openstack server list \ + --name $OOD_INSTANCE_NAME --ip $OOD_FIXED_IP -c ID -f value) + openstack server remove floating ip $CURRENT_INSTANCE_ID $OOD_FLOATING_IP + done script: - OOD_IMAGE_ID="${BUILT_OOD_IMAGE_ID:-$OOD_IMAGE_ID}" - openstack image set --accept $OOD_IMAGE_ID || true -- GitLab From ccdbada8847212107073b385bcb35a6165a9b432 Mon Sep 17 00:00:00 2001 From: Eesaan Atluri <atlurie@uab.edu> Date: Fri, 6 Jun 2025 18:58:53 -0500 Subject: [PATCH 3/7] Install NetworkManager required during deploy NetworkManager is restarted during cloud-init final module but it failsbecause the package was not available. So install it during build to make it available during deploy --- openstack-ood/nodeimage.pkr.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openstack-ood/nodeimage.pkr.hcl b/openstack-ood/nodeimage.pkr.hcl index 1a13744..6ade3c0 100644 --- a/openstack-ood/nodeimage.pkr.hcl +++ b/openstack-ood/nodeimage.pkr.hcl @@ -60,7 +60,7 @@ build { provisioner "shell" { inline = [ - "sudo yum install -y libselinux-python3 python3 python3-pip tmux vim git bash-completion curl wget unzip", + "sudo yum install -y libselinux-python3 python3 python3-pip tmux vim git bash-completion curl wget unzip NetworkManager", "sudo python3 -m pip install --upgrade pip", "sudo pip3 install s3cmd==2.3.0 ansible==4.10.0 python-openstackclient==5.8.0" ] -- GitLab From cd18f42afeee7f42a672dd861c125ae6be5fa0f7 Mon Sep 17 00:00:00 2001 From: Eesaan Atluri <atlurie@uab.edu> Date: Fri, 13 Jun 2025 12:38:22 -0500 Subject: [PATCH 4/7] Detach internal port to assign it to new instance --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3035c4a..2a29708 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -391,6 +391,7 @@ deploy_ood_node: --name $OOD_INSTANCE_NAME --ip $OOD_FIXED_IP -c ID -f value) openstack server remove floating ip $CURRENT_INSTANCE_ID $OOD_FLOATING_IP done + openstack server remove port $CURRENT_INSTANCE_ID $OOD_PORT script: - OOD_IMAGE_ID="${BUILT_OOD_IMAGE_ID:-$OOD_IMAGE_ID}" - openstack image set --accept $OOD_IMAGE_ID || true -- GitLab From 066fa7d50d8a043ba3ef069145ac91c02457f9e2 Mon Sep 17 00:00:00 2001 From: Eesaan Atluri <atlurie@uab.edu> Date: Mon, 16 Jun 2025 17:52:00 -0500 Subject: [PATCH 5/7] Conditional to detach port when the port is defined --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2a29708..25bfbdf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -391,7 +391,10 @@ deploy_ood_node: --name $OOD_INSTANCE_NAME --ip $OOD_FIXED_IP -c ID -f value) openstack server remove floating ip $CURRENT_INSTANCE_ID $OOD_FLOATING_IP done + if [ -n "$OOD_PORT" ];then openstack server remove port $CURRENT_INSTANCE_ID $OOD_PORT + fi + script: - OOD_IMAGE_ID="${BUILT_OOD_IMAGE_ID:-$OOD_IMAGE_ID}" - openstack image set --accept $OOD_IMAGE_ID || true -- GitLab From c4a8af697f66f3709cf7492f00f05d255eb88c76 Mon Sep 17 00:00:00 2001 From: Eesaan Atluri <atlurie@uab.edu> Date: Wed, 18 Jun 2025 14:31:56 -0500 Subject: [PATCH 6/7] Remove unused variable from gitlab-ci --- .gitlab-ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 25bfbdf..23ef31e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,6 @@ variables: INSTANCE_FLAVOR: "m1.medium-ruffner" HTTP_PROXY_INSTANCE_NAME: "http-proxy" SSH_PROXY_INSTANCE_NAME: "ssh-proxy" - NUM_SERVERS_TO_KEEP: "1" stages: - build -- GitLab From f7588c2ce81dcae43f9646f6328cd8206103c6db Mon Sep 17 00:00:00 2001 From: Eesaan Atluri <atlurie@uab.edu> Date: Wed, 18 Jun 2025 14:35:15 -0500 Subject: [PATCH 7/7] Format port detachment code into a new block --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 23ef31e..6c2fce7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -390,8 +390,9 @@ deploy_ood_node: --name $OOD_INSTANCE_NAME --ip $OOD_FIXED_IP -c ID -f value) openstack server remove floating ip $CURRENT_INSTANCE_ID $OOD_FLOATING_IP done + - | if [ -n "$OOD_PORT" ];then - openstack server remove port $CURRENT_INSTANCE_ID $OOD_PORT + openstack server remove port $CURRENT_INSTANCE_ID $OOD_PORT fi script: -- GitLab