Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Clean up periodic multinode instances on CI hosting cloud #1295

Open
wants to merge 1 commit into
base: stackhpc/2024.1
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/stackhpc-ci-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: add this tag to multinode instances.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to add this before merging this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt I'll have time

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But probably better to keep this open as a reminder to do it

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 }}