Cleanup CI clusters #572
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: {} | |
| 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-24.04 | |
| env: | |
| OS_CLOUD: openstack | |
| CI_CLOUD: ${{ matrix.cloud }} | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| persist-credentials: false | |
| - name: Record which cloud CI is running on | |
| run: | | |
| echo "CI_CLOUD: ${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_CLOUD" > ~/.config/openstack/clouds.yaml | |
| shell: bash | |
| env: | |
| SECRETS_CLOUD: ${{ secrets[format('{0}_CLOUDS_YAML', env.CI_CLOUD)] }} # zizmor: ignore[overprovisioned-secrets] | |
| - 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 |