-
Notifications
You must be signed in to change notification settings - Fork 39
60 lines (53 loc) · 1.71 KB
/
workflow-cleanup.yml
File metadata and controls
60 lines (53 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Workflow Cleanup
on:
workflow_dispatch:
# 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. "
inputs:
ci_cloud:
description: 'Select the CI_CLOUD'
required: true
type: choice
options:
- LEAFCLOUD
- SMS
- ARCUS
cluster_name:
description: 'Cluster to delete (RL*-***)'
type: string
required: true
permissions:
contents: read
packages: write
# To report GitHub Actions status checks
statuses: write
jobs:
ci_cluster_cleanup:
name: ci-cluster-cleanup
runs-on: ubuntu-22.04
env:
OS_CLOUD: openstack
CI_CLOUD: ${{ github.event.inputs.ci_cloud }}
CLUSTER_NAME: ${{ github.event.inputs.cluster_name }}
steps:
- uses: actions/checkout@v4
- name: Input Variables
run: |
echo CI_CLOUD: ${{ env.CI_CLOUD }}
echo CLUSTER_NAME: ${{ env.CLUSTER_NAME }}
- 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 CI cluster
run: |
. venv/bin/activate
./dev/delete-cluster.py slurmci-${{ env.CLUSTER_NAME }} --force
shell: bash