-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (41 loc) · 1.45 KB
/
test.yml
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
name: ubuntu/slurm
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
jobs:
test:
name: Test Omnistat client
runs-on: ubuntu-22.04
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install pytest
run: sudo apt-get install -y python3-pytest
- name: Comment out GPU devices (not available in GitHub)
run: sed -i "/devices:/,+2 s/^/#/" test/docker/slurm/compose.yaml
- name: Disable SMI collector (won't work in GitHub)
run: >
sed -i "s/enable_rocm_smi = True/enable_rocm_smi = False/" \
test/docker/slurm/omnistat.slurm
- name: Start containerized environment
run: docker compose -f test/docker/slurm/compose.yaml up -d
- name: Wait for Prometheus
run: >
timeout 1m bash -c \
'until $(curl -o /dev/null --fail -s localhost:9090/metrics); do \
echo "Waiting for Prometheus..."; \
sleep 5; \
done'
- name: Wait for Omnistat
run: >
timeout 15m bash -c \
'until [[ $(curl -s -g "localhost:9090/api/v1/series?match[]={instance=\"node:8000\"}" | jq ".data|length") != 0 ]]; do \
echo "Waiting for Omnistat..."; \
sleep 15; \
done'
- name: Install test dependencies
run: pip3 install prometheus_api_client
- name: Run tests
run: pytest-3 -v test