Cleanup CI clusters #372
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cleanup CI clusters | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 21 * * *' # Run at 9PM - image sync runs at midnight | |
permissions: | |
contents: read | |
packages: write | |
# To report GitHub Actions status checks | |
statuses: write | |
jobs: | |
ci_cleanup: | |
name: ci-cleanup | |
concurrency: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.cloud }} | |
strategy: | |
fail-fast: false | |
matrix: | |
cloud: | |
- LEAFCLOUD | |
- SMS | |
- ARCUS | |
runs-on: ubuntu-22.04 | |
env: | |
OS_CLOUD: openstack | |
CI_CLOUD: ${{ matrix.cloud }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Record which cloud CI is running on | |
run: | | |
echo CI_CLOUD: ${{ env.CI_CLOUD }} | |
- name: Setup environment | |
run: | | |
python3 -m venv venv | |
. venv/bin/activate | |
pip install -U pip | |
pip install "$(grep -o 'python-openstackclient[><=0-9\.]*' requirements.txt)" | |
shell: bash | |
- name: Write clouds.yaml | |
run: | | |
mkdir -p ~/.config/openstack/ | |
echo "${{ secrets[format('{0}_CLOUDS_YAML', env.CI_CLOUD)] }}" > ~/.config/openstack/clouds.yaml | |
shell: bash | |
- name: Delete all CI clusters | |
run: | | |
. venv/bin/activate | |
./dev/delete-cluster.py slurmci-RL --force | |
shell: bash | |
- name: Delete all CI extra build VMs and volumes | |
run: | | |
. venv/bin/activate | |
./dev/delete-cluster.py openhpc-extra-RL --force | |
shell: bash | |
- name: Delete all fatimage build VMs and volumes | |
run: | | |
. venv/bin/activate | |
./dev/delete-cluster.py openhpc-RL --force | |
shell: bash |