Skip to content

Commit cdcc66a

Browse files
committed
created workflow tasks to delete given CI cluster
1 parent bffb611 commit cdcc66a

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

.github/workflows/workflow-cleanup.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Workflow Cleanup
22
on:
33
workflow_dispatch:
4-
# checkov:skip=CKV_GHA_7: "The build output cannot be affected by user parameters other than the build entry point and the top-level source location. GitHub Actions workflow_dispatch inputs MUST be empty. "
54
inputs:
65
ci_cloud:
76
description: 'Select the CI_CLOUD'
@@ -12,7 +11,7 @@ on:
1211
- SMS
1312
- ARCUS
1413
cluster_name:
15-
description: 'Cluster to delete'
14+
description: 'Cluster to delete (RL*-***)'
1615
type: string
1716
required: true
1817

@@ -24,15 +23,37 @@ permissions:
2423
statuses: write
2524

2625
jobs:
27-
dummy:
28-
name: dummy-job1
26+
ci_cleanup:
27+
name: ci-cleanup
2928
runs-on: ubuntu-22.04
3029
env:
30+
OS_CLOUD: openstack
3131
CI_CLOUD: ${{ github.event.inputs.ci_cloud }}
3232
CLUSTER_NAME: ${{ github.event.inputs.cluster_name }}
33-
3433
steps:
34+
- uses: actions/checkout@v4
35+
3536
- name: print input vars
3637
run: |
3738
echo CI_CLOUD: ${{ env.CI_CLOUD }}
3839
echo CLUSTER_NAME: ${{ env.CLUSTER_NAME }}
40+
41+
- name: Setup environment
42+
run: |
43+
python3 -m venv venv
44+
. venv/bin/activate
45+
pip install -U pip
46+
pip install "$(grep -o 'python-openstackclient[><=0-9\.]*' requirements.txt)"
47+
shell: bash
48+
49+
- name: Write clouds.yaml
50+
run: |
51+
mkdir -p ~/.config/openstack
52+
echo "${{ secrets[format('{0}_CLOUDS_YAML', env.CI_CLOUD)] }}" > ~/.config/openstack/clouds.yaml
53+
shell: bash
54+
55+
- name: Delete CI cluster
56+
run: |
57+
. venv/bin/activate
58+
./dev/delete-cluster.py slurmci-${{ env.CLUSTER_NAME }}
59+
shell: bash

0 commit comments

Comments
 (0)