Repository navigation
219 lines (208 loc) · 6.6 KB
/
Copy pathrefresh.yml
File metadata and controls
219 lines (208 loc) · 6.6 KB
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
defaults:
run:
shell: bash -el {0}
name: refresh
jobs:
metadata:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Configure Poetry
run: poetry env use python3.12
- name: Install package
run: poetry install --with test
- name: Generate metadata
run: poetry run ./bin/generate_metadata.py
- name: Upload metadata
uses: actions/upload-artifact@v4
with:
name: saps-metadata
path: metadata.json
trace:
needs: metadata
runs-on: ubuntu-latest
env:
REMOTE_STORAGE_BACKEND: s3
REMOTE_STORAGE_BUCKET: sparse-array-programming-suite
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }}
AWS_DEFAULT_REGION: us-east-1
AWS_REGION: us-east-1
strategy:
fail-fast: false
matrix:
chunk: [0, 1, 2, 3]
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Download metadata
uses: actions/download-artifact@v4
with:
name: saps-metadata
path: .
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Configure Poetry
run: poetry env use python3.12
- name: Install package
run: poetry install --with test
- name: Trace statistics chunk
run: |
poetry run ./bin/run_benchmark.py \
--trace-statistics \
--tag trace \
--chunk-count 4 \
--chunk-index ${{ matrix.chunk }} \
--timeout 30 \
--show-stderr \
--remote-storage-backend "$REMOTE_STORAGE_BACKEND" \
--remote-storage-bucket "$REMOTE_STORAGE_BUCKET"
- name: Upload trace chunk
uses: actions/upload-artifact@v4
with:
name: saps-trace-${{ matrix.chunk }}
path: |
statistics.json
.saps/outputs/tagger_stats
.saps/outputs/results
data:
needs: metadata
runs-on: ubuntu-latest
env:
REMOTE_STORAGE_BACKEND: s3
REMOTE_STORAGE_BUCKET: sparse-array-programming-suite
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_SESSION_TOKEN: ${{ secrets.AWS_SESSION_TOKEN }}
AWS_DEFAULT_REGION: us-east-1
AWS_REGION: us-east-1
strategy:
fail-fast: false
matrix:
chunk: [0, 1, 2, 3]
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Download metadata
uses: actions/download-artifact@v4
with:
name: saps-metadata
path: .
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Configure Poetry
run: poetry env use python3.12
- name: Install package
run: poetry install --with test
- name: Cache datasets chunk
run: |
poetry run ./bin/run_benchmark.py \
--cache-datasets \
--chunk-count 4 \
--chunk-index ${{ matrix.chunk }} \
--remote-storage-backend "$REMOTE_STORAGE_BACKEND" \
--remote-storage-bucket "$REMOTE_STORAGE_BUCKET"
- name: Upload data chunk
uses: actions/upload-artifact@v4
with:
name: saps-data-${{ matrix.chunk }}
path: |
manifest.json
.saps/outputs/cache
merge-statistics:
needs: trace
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Download trace chunks
uses: actions/download-artifact@v4
with:
pattern: saps-trace-*
path: artifacts/trace
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Configure Poetry
run: poetry env use python3.12
- name: Install package
run: poetry install --with test
- name: Merge statistics
run: |
poetry run ./bin/merge_statistics.py \
--output merged/statistics.json \
artifacts/trace/*/statistics.json
- name: Generate final metadata
run: poetry run ./bin/generate_metadata.py --statistics merged/statistics.json
- name: Upload merged statistics
uses: actions/upload-artifact@v4
with:
name: saps-statistics-final
path: merged/statistics.json
- name: Upload final metadata
uses: actions/upload-artifact@v4
with:
name: saps-metadata-final
path: metadata.json
merge-manifest:
needs: data
runs-on: ubuntu-latest
steps:
- name: Download data chunks
uses: actions/download-artifact@v4
with:
pattern: saps-data-*
path: artifacts/data
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Merge manifest
run: |
python - <<'PY'
import json
from pathlib import Path
root = Path("artifacts")
out = Path("merged")
out.mkdir(exist_ok=True)
def load_json(path):
return json.loads(path.read_text(encoding="utf-8"))
def write_json(path, data):
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(
json.dumps(data, indent=2, sort_keys=True) + "\n",
encoding="utf-8",
)
manifest = {}
for manifest_path in sorted((root / "data").glob("*/manifest.json")):
fragment = load_json(manifest_path)
for key, value in fragment.items():
if key in manifest and manifest[key] != value:
raise RuntimeError(
f"Conflicting manifest entry for {key}: "
f"{manifest[key]} != {value}"
)
manifest[key] = value
write_json(out / "manifest.json", manifest)
PY
- name: Upload merged manifest
uses: actions/upload-artifact@v4
with:
name: saps-manifest-final
path: merged/manifest.json
on:
workflow_dispatch: