-
Notifications
You must be signed in to change notification settings - Fork 7
176 lines (154 loc) · 5.37 KB
/
experiment-tracker.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: Experiment Tracker
on:
workflow_dispatch:
push:
paths:
- 'experiment-tracker/**'
- '!experiment-tracker/**.md'
jobs:
test-proxy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Lint with flake8
run: |
set -e
cd ./experiment-tracker/experiment-proxy
echo $PWD
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install dependencies
run: |
set -e
cd ./experiment-tracker/experiment-proxy
echo $PWD
pip install --upgrade pip
pip install wheel
pip install -r requirements.txt
- name: Run unit tests with pytest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: experiment-proxy
ON_MASTER: ${{ github.ref == 'refs/heads/master' }}
run: |
set -e
cd ./experiment-tracker/experiment-proxy
echo $PWD
pip install -r requirements-test.txt
pytest -v --cov=proxy tests/
# when on master, pretend to be on branch x-cov-experiment-proxy
$ON_MASTER && export GITHUB_REF="refs/heads/x-cov-experiment-proxy"
$ON_MASTER && export GITHUB_HEAD_REF="x-cov-experiment-proxy"
coveralls --service=github --srcdir=experiment-tracker/experiment-proxy
test-collector:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Lint with flake8
run: |
set -e
cd ./experiment-tracker/data-collector
echo $PWD
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install dependencies
run: |
set -e
cd ./experiment-tracker/data-collector
echo $PWD
pip install --upgrade pip
pip install wheel
pip install -r requirements.txt
- name: Run unit tests with pytest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: data-collector
ON_MASTER: ${{ github.ref == 'refs/heads/master' }}
run: |
set -e
cd ./experiment-tracker/data-collector
echo $PWD
pip install -r requirements-test.txt
pytest -v --cov=collector tests/
# when on master, pretend to be on branch x-cov-data-collector
$ON_MASTER && export GITHUB_REF="refs/heads/x-cov-data-collector"
$ON_MASTER && export GITHUB_HEAD_REF="x-cov-data-collector"
coveralls --service=github --srcdir=experiment-tracker/data-collector
integration-tests:
runs-on: ubuntu-latest
needs:
- test-proxy
- test-collector
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install test dependencies
run: |
cd ./experiment-tracker/tests
pip install -r requirements-test.txt
- name: Spin up experiment tracker
run: |
cd ./experiment-tracker
docker-compose --env-file .env.test up --scale test=3 -d
sleep 30
- name: Run integration tests
run: |
cd ./experiment-tracker/tests
chmod +x run.sh
./run.sh
- name: Shut down experiment tracker
run: |
cd ./experiment-tracker
docker-compose down
build-collector:
runs-on: ubuntu-latest
needs:
- integration-tests
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create data-collector container and publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: xai-demonstrator/data-collector
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: experiment-tracker/data-collector/
build-proxy:
runs-on: ubuntu-latest
needs:
- integration-tests
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Create experiment-proxy container and publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: xai-demonstrator/experiment-proxy
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: experiment-tracker/experiment-proxy/