@@ -46,53 +46,20 @@ jobs:
4646 echo "${{ secrets[format('{0}_CLOUDS_YAML', env.CI_CLOUD)] }}" > ~/.config/openstack/clouds.yaml
4747 shell : bash
4848
49- - name : Find CI clusters
49+ - name : Delete all CI clusters
5050 run : |
5151 . venv/bin/activate
52- CI_CLUSTERS=$(openstack server list | grep --only-matching 'slurmci-RL.-[0-9]\+' | sort | uniq || true)
53- echo "DEBUG: Raw CI clusters: $CI_CLUSTERS"
54-
55- if [[ -z "$CI_CLUSTERS" ]]; then
56- echo "No matching CI clusters found."
57- else
58- # Flatten multiline value so can be passed as env var
59- CI_CLUSTERS_FORMATTED=$(echo "$CI_CLUSTERS" | tr '\n' ' ' | sed 's/ $//')
60- echo "DEBUG : Formatted CI clusters: $CI_CLUSTERS_FORMATTED"
61- echo "ci_clusters=$CI_CLUSTERS_FORMATTED" >> "$GITHUB_ENV"
62- fi
52+ ./dev/delete-cluster.py slurmci-RL --force
6353 shell : bash
64-
65- - name : Delete CI clusters
54+
55+ - name : Delete all CI extra build VMs and volumes
6656 run : |
6757 . venv/bin/activate
68- if [[ -z ${ci_clusters} ]]; then
69- echo "No clusters to delete."
70- exit 0
71- fi
72-
73- for cluster_prefix in ${ci_clusters}
74- do
75- echo "Processing cluster: $cluster_prefix"
76-
77- # Get all servers with the matching name for control node
78- CONTROL_SERVERS=$(openstack server list --name "${cluster_prefix}-control" --format json)
79-
80- # Get unique server names to avoid duplicate cleanup
81- UNIQUE_NAMES=$(echo "$CONTROL_SERVERS" | jq -r '.[].Name' | sort | uniq)
82- for name in $UNIQUE_NAMES; do
83- echo "Deleting cluster with control node: $name"
84-
85- # Get the first matching server ID by name
86- server=$(echo "$CONTROL_SERVERS" | jq -r '.[] | select(.Name=="'"$name"'") | .ID' | head -n1)
87-
88- # Make sure server still exists (wasn't deleted earlier)
89- if ! openstack server show "$server" &>/dev/null; then
90- echo "Server $server no longer exists, skipping $name."
91- continue
92- fi
58+ ./dev/delete-cluster.py openhpc-extra-RL --force
59+ shell : bash
9360
94- echo "Deleting cluster $cluster_prefix (server $server)..."
95- ./dev/delete-cluster.py "$cluster_prefix" --force
96- done
97- done
61+ - name : Delete all fatimage build VMs and volumes
62+ run : |
63+ . venv/bin/activate
64+ ./dev/delete-cluster.py openhpc-RL --force
9865 shell : bash
0 commit comments