44
44
CI_CLOUD : ${{ vars.CI_CLOUD }} # default from repo settings
45
45
TF_VAR_os_version : ${{ matrix.os_version }}
46
46
steps :
47
- - uses : actions/checkout@v2
47
+ - uses : actions/checkout@v4
48
+ with :
49
+ fetch-depth : 0
50
+ fetch-tags : true
48
51
49
52
- name : Override CI_CLOUD if PR label is present
50
53
if : ${{ github.event_name == 'pull_request' }}
76
79
run : cat environments/.stackhpc/bastion_fingerprints >> ~/.ssh/known_hosts
77
80
shell : bash
78
81
82
+ - name : Find the latest release
83
+ run : |
84
+ echo LATEST_RELEASE_TAG=$(curl -s https://api.github.com/repos/stackhpc/ansible-slurm-appliance/releases/latest | jq -r .tag_name) >> "$GITHUB_ENV"
85
+ echo LATEST_RELEASE_TAG: $LATEST_RELEASE_TAG
86
+
87
+ - name : Checkout latest release
88
+ run : git checkout $LATEST_RELEASE_TAG
89
+
79
90
- name : Install ansible etc
80
91
run : dev/setup-env.sh
81
92
@@ -103,7 +114,7 @@ jobs:
103
114
env :
104
115
DEMO_USER_PASSWORD : ${{ secrets.TEST_USER_PASSWORD }}
105
116
106
- - name : Provision nodes using fat image
117
+ - name : Provision nodes using latest release image
107
118
id : provision_servers
108
119
run : |
109
120
. venv/bin/activate
@@ -119,15 +130,15 @@ jobs:
119
130
tofu destroy -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
120
131
if : failure() && steps.provision_servers.outcome == 'failure'
121
132
122
- - name : Configure cluster
133
+ - name : Configure cluster at latest release
123
134
run : |
124
135
. venv/bin/activate
125
136
. environments/.stackhpc/activate
126
137
ansible all -m wait_for_connection
127
138
ansible-playbook -v ansible/site.yml
128
139
ansible-playbook -v ansible/ci/check_slurm.yml
129
140
130
- - name : Run MPI-based tests
141
+ - name : Run MPI-based tests at latest release
131
142
run : |
132
143
. venv/bin/activate
133
144
. environments/.stackhpc/activate
@@ -170,23 +181,33 @@ jobs:
170
181
env :
171
182
DEMO_USER_PASSWORD : ${{ secrets.TEST_USER_PASSWORD }}
172
183
173
- - name : Test reimage of login and control nodes (via rebuild adhoc)
184
+ - name : Switch to current branch
185
+ run : git checkout -
186
+
187
+ - name : Reimage login and control nodes to image in current branch
188
+ id : reimage_non_compute
189
+ run : |
190
+ . venv/bin/activate
191
+ . environments/.stackhpc/activate
192
+ cd $APPLIANCES_ENVIRONMENT_ROOT/tofu
193
+ tofu apply -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars" -var-file=cluster_image.latest.tfvars.json
194
+
195
+ - name : Configure cluster using current branch
174
196
run : |
175
197
. venv/bin/activate
176
198
. environments/.stackhpc/activate
177
- ansible-playbook -v --limit control,login ansible/adhoc/rebuild.yml
199
+ ansible all -m wait_for_connection
178
200
ansible-playbook -v ansible/site.yml
179
201
ansible-playbook -v ansible/ci/check_slurm.yml
180
202
181
- - name : Test compute node reboot and compute-init
203
+ - name : Reimage compute nodes to image in current branch using slurm - tests compute-init
182
204
run : |
183
205
. venv/bin/activate
184
206
. environments/.stackhpc/activate
185
- ansible-playbook -v --limit compute ansible/adhoc/rebuild.yml
186
- ansible-playbook -v ansible/ci/check_slurm.yml
187
207
ansible-playbook -v ansible/adhoc/reboot_via_slurm.yml
208
+ ansible-playbook -v ansible/ci/check_slurm.yml
188
209
189
- - name : Check sacct state survived reimage
210
+ - name : Check sacct state survived reimage to current branch
190
211
run : |
191
212
. venv/bin/activate
192
213
. environments/.stackhpc/activate
@@ -198,16 +219,16 @@ jobs:
198
219
. environments/.stackhpc/activate
199
220
ansible-playbook -vv ansible/ci/check_grafana.yml
200
221
222
+ - name : Run MPI-based tests again in current branch
223
+ run : |
224
+ . venv/bin/activate
225
+ . environments/.stackhpc/activate
226
+ ansible-playbook -vv ansible/adhoc/hpctests.yml
227
+
201
228
- name : Delete infrastructure
202
229
run : |
203
230
. venv/bin/activate
204
231
. environments/.stackhpc/activate
205
232
cd $APPLIANCES_ENVIRONMENT_ROOT/tofu
206
233
tofu destroy -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
207
234
if : ${{ success() || cancelled() }}
208
-
209
- # - name: Delete images
210
- # run: |
211
- # . venv/bin/activate
212
- # . environments/.stackhpc/activate
213
- # ansible-playbook -vv ansible/ci/delete_images.yml
0 commit comments