File tree Expand file tree Collapse file tree 1 file changed +37
-5
lines changed
Expand file tree Collapse file tree 1 file changed +37
-5
lines changed Original file line number Diff line number Diff line change 1212 - SMS
1313 - ARCUS
1414 cluster_name :
15- description : ' Cluster to delete'
15+ description : ' Cluster to delete (workflow run number) '
1616 type : string
1717 required : true
1818
@@ -24,15 +24,47 @@ permissions:
2424 statuses : write
2525
2626jobs :
27- dummy :
28- name : dummy-job1
27+ ci_cluster_cleanup :
28+ name : ci-cluster-cleanup
2929 runs-on : ubuntu-22.04
3030 env :
31+ OS_CLOUD : openstack
3132 CI_CLOUD : ${{ github.event.inputs.ci_cloud }}
3233 CLUSTER_NAME : ${{ github.event.inputs.cluster_name }}
33-
3434 steps :
35- - name : print input vars
35+ - uses : actions/checkout@v4
36+
37+ - name : Input Variables
3638 run : |
3739 echo CI_CLOUD: ${{ env.CI_CLOUD }}
3840 echo CLUSTER_NAME: ${{ env.CLUSTER_NAME }}
41+
42+ - name : Check Cluster Name not empty
43+ run : |
44+ if [ -z ${{ env.CLUSTER_NAME }} ]; then
45+ echo "Cluster name is empty"
46+ exit 1
47+ else
48+ echo "Cluster name is not empty"
49+ fi
50+
51+ - name : Setup environment
52+ run : |
53+ python3 -m venv venv
54+ . venv/bin/activate
55+ pip install -U pip
56+ pip install "$(grep -o 'python-openstackclient[><=0-9\.]*' requirements.txt)"
57+ shell : bash
58+
59+ - name : Write clouds.yaml
60+ run : |
61+ mkdir -p ~/.config/openstack
62+ echo "${{ secrets[format('{0}_CLOUDS_YAML', env.CI_CLOUD)] }}" > ~/.config/openstack/clouds.yaml
63+ shell : bash
64+
65+ - name : Delete CI cluster
66+ run : |
67+ . venv/bin/activate
68+ ./dev/delete-cluster.py slurmci-RL8-${{ env.CLUSTER_NAME }} --force
69+ ./dev/delete-cluster.py slurmci-RL9-${{ env.CLUSTER_NAME }} --force
70+ shell : bash
You can’t perform that action at this time.
0 commit comments