File tree Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Expand file tree Collapse file tree 2 files changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,11 @@ jobs:
170
170
env :
171
171
TESTUSER_PASSWORD : ${{ secrets.TEST_USER_PASSWORD }}
172
172
173
+ - name : Get timestamp in milliseconds before rebuild
174
+ id : timestamp
175
+ run : |
176
+ echo "TIME_BEFORE_REBUILD=$(date +%s%N | cut -b1-13)" >> $GITHUB_OUTPUT
177
+
173
178
# - name: Build environment-specific compute image
174
179
# id: packer_build
175
180
# run: |
@@ -209,6 +214,14 @@ jobs:
209
214
. environments/.stackhpc/activate
210
215
ansible-playbook -vv ansible/ci/check_grafana.yml
211
216
217
+ - name : Check Loki Slurm logs persisted through rebuild
218
+ run : |
219
+ . venv/bin/activate
220
+ . environments/.stackhpc/activate
221
+ ansible-playbook -vv ansible/ci/check_loki.yml -e "end_timestamp=${{ steps.timestamp.outputs.TIME_BEFORE_REBUILD }} testuser_password=$TESTUSER_PASSWORD"
222
+ env :
223
+ TESTUSER_PASSWORD : ${{ secrets.TEST_USER_PASSWORD }}
224
+
212
225
- name : Delete infrastructure
213
226
run : |
214
227
. venv/bin/activate
Original file line number Diff line number Diff line change
1
+ - hosts : control
2
+ gather_facts : no
3
+ become : no
4
+ tasks :
5
+ - name : Get Loki datasource uid
6
+ ansible.builtin.uri :
7
+ url : http://localhost:{{ grafana_port }}/api/datasources/name/Loki
8
+ url_username : ' testuser'
9
+ url_password : " {{ testuser_password }}"
10
+ follow_redirects : all
11
+ register : uid_response
12
+
13
+ - name : Get Loki logs from before rebuild
14
+ vars :
15
+ testuser_password : mypassword
16
+ ansible.builtin.uri :
17
+ url : http://localhost:{{ grafana_port }}/api/ds/query
18
+ follow_redirects : all
19
+ url_username : testuser
20
+ url_password : " {{ testuser_password }}"
21
+ method : POST
22
+ body_format : json
23
+ headers :
24
+ Accept : application/json
25
+ Content-Type : application/json
26
+ # Queries from 20 mins before timestamp to timestamp
27
+ body : |
28
+ {
29
+ "queries":[
30
+ {
31
+ "expr":"{unit=\"slurmd.service\"} |= ``",
32
+ "datasource":{"uid":"{{ uid_response.json.uid }}"},
33
+ "format":"time_series"
34
+ }],
35
+ "from":"{{ end_timestamp | int - 1200000 }}",
36
+ "to":"{{ end_timestamp }}"
37
+ }
38
+ register : log_query_content
39
+
40
+ - name : Check that logs exist
41
+ ansible.builtin.assert :
42
+ that : log_query_content.json.results.A.frames[0].data['values'][2] | length > 0
You can’t perform that action at this time.
0 commit comments