From f0688f38789b714cba6f929074d64d602b2f33d0 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Thu, 19 Sep 2024 11:18:09 +0100 Subject: [PATCH 1/4] CI: Clean up periodic multinode instances on CI hosting cloud Uses the same workflow that is used to clean up aio instances. --- .github/workflows/stackhpc-ci-cleanup.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/stackhpc-ci-cleanup.yml b/.github/workflows/stackhpc-ci-cleanup.yml index ed9ec327c..1841c52d2 100644 --- a/.github/workflows/stackhpc-ci-cleanup.yml +++ b/.github/workflows/stackhpc-ci-cleanup.yml @@ -75,3 +75,23 @@ jobs: OS_CLOUD: openstack OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }} OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }} + + - name: Clean up periodic multinode instances over 12 hours old + run: | + result=0 + changes_before=$(date -Imin -d -12hours) + for status in ACTIVE BUILD ERROR SHUTOFF; do + for instance in $(openstack server list --tags skc-multinode-periodic --os-compute-api-version 2.66 --format value --column ID --changes-before $changes_before --status $status); do + echo "Cleaning up $status instance $instance" + openstack server show $instance + if ! openstack server delete $instance; then + echo "Failed to delete $status instance $instance" + result=1 + fi + done + done + exit $result + env: + OS_CLOUD: openstack + OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }} + OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }} From 6e491099dc9d9844a6c42d09e6477cad99bdf51d Mon Sep 17 00:00:00 2001 From: wtripp180901 <78219569+wtripp180901@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:01:04 +0000 Subject: [PATCH 2/4] made tag generic to all CI generated multinodes --- .github/workflows/stackhpc-ci-cleanup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stackhpc-ci-cleanup.yml b/.github/workflows/stackhpc-ci-cleanup.yml index 1841c52d2..4a91ac817 100644 --- a/.github/workflows/stackhpc-ci-cleanup.yml +++ b/.github/workflows/stackhpc-ci-cleanup.yml @@ -81,7 +81,7 @@ jobs: result=0 changes_before=$(date -Imin -d -12hours) for status in ACTIVE BUILD ERROR SHUTOFF; do - for instance in $(openstack server list --tags skc-multinode-periodic --os-compute-api-version 2.66 --format value --column ID --changes-before $changes_before --status $status); do + for instance in $(openstack server list --tags gh-actions-multinode --os-compute-api-version 2.66 --format value --column ID --changes-before $changes_before --status $status); do echo "Cleaning up $status instance $instance" openstack server show $instance if ! openstack server delete $instance; then From fdf440174cc325429bbb45a925e1ab491903dbeb Mon Sep 17 00:00:00 2001 From: wtripp180901 <78219569+wtripp180901@users.noreply.github.com> Date: Mon, 13 Jan 2025 17:27:51 +0000 Subject: [PATCH 3/4] comment update Co-authored-by: Alex-Welsh <112560678+Alex-Welsh@users.noreply.github.com> --- .github/workflows/stackhpc-ci-cleanup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stackhpc-ci-cleanup.yml b/.github/workflows/stackhpc-ci-cleanup.yml index 90012821b..77467e793 100644 --- a/.github/workflows/stackhpc-ci-cleanup.yml +++ b/.github/workflows/stackhpc-ci-cleanup.yml @@ -76,7 +76,7 @@ jobs: OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }} OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }} - - name: Clean up periodic multinode instances over 12 hours old + - name: Clean up GH actions multinode instances over 12 hours old run: | result=0 changes_before=$(date -Imin -d -12hours) From ebc987204333473b4442a5b5c3210fbebb785e80 Mon Sep 17 00:00:00 2001 From: wtripp180901 <78219569+wtripp180901@users.noreply.github.com> Date: Mon, 13 Jan 2025 17:30:44 +0000 Subject: [PATCH 4/4] comment update --- .github/workflows/stackhpc-multinode.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stackhpc-multinode.yml b/.github/workflows/stackhpc-multinode.yml index 321346ec8..2e66e2dca 100644 --- a/.github/workflows/stackhpc-multinode.yml +++ b/.github/workflows/stackhpc-multinode.yml @@ -43,7 +43,7 @@ name: Multinode - never - success break_duration: - description: How long to break execution for (minutes) + description: How long to break execution for (minutes) (note that instances are cleaned up after 12h) type: number default: 60 ssh_key: