-
Notifications
You must be signed in to change notification settings - Fork 129
226 lines (210 loc) · 7.18 KB
/
ci.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
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
220
221
222
223
224
225
226
name: CI/CD
on:
push:
branches:
- master
- backports-v0.7.x
- backports-v0.6.x
tags:
- v*.*.*
pull_request:
branches:
- master
- backports-v0.7.x
- backports-v0.6.x
# Run daily at 0:01 UTC
schedule:
- cron: '1 0 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
name: pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- uses: pre-commit/[email protected]
with:
extra_args: --hook-stage manual --all-files
test:
runs-on: ${{ matrix.os }}
needs: pre-commit
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
java-version: [17]
java-distribution: ["corretto"]
python-version: ["3.9", "3.12"]
name: test coffea (${{ matrix.os }}) - python ${{ matrix.python-version }}, JDK${{ matrix.java-version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up JDK ${{ matrix.java-distribution }}/${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java-version }}
distribution: ${{ matrix.java-distribution }}
- name: Set python test settings
run: |
echo "INSTALL_EXTRAS='[dev,parsl,dask]'" >> $GITHUB_ENV
- name: Install uv
run: python -m pip install --upgrade uv
- name: Install dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
uv pip install --system --upgrade pip setuptools wheel
# mltool installs
# c.f. https://github.com/astral-sh/uv/issues/3437
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
uv pip install --system xgboost
uv pip install --system 'tritonclient[grpc,http]!=2.41.0'
# install checked out coffea
uv pip install --system -q '.[dev,parsl,dask,spark]' --upgrade
uv pip list --system
java -version
- name: Install dependencies (MacOS)
if: matrix.os == 'macOS-latest'
run: |
uv pip install --system --upgrade pip setuptools wheel
# mltool installs
# c.f. https://github.com/astral-sh/uv/issues/3437
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
uv pip install --system xgboost
# install checked out coffea
uv pip install --system -q '.[dev,dask,spark]' --upgrade
uv pip list --system
java -version
- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
uv pip install --system --upgrade pip setuptools wheel
# mltool installs
# c.f. https://github.com/astral-sh/uv/issues/3437
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
uv pip install --system xgboost
# install checked out coffea
uv pip install --system -q '.[dev,dask]' 'numpy<2' --upgrade
uv pip list --system
java -version
- name: Start triton server with example model
if: matrix.os == 'ubuntu-latest'
run: |
docker run -d --rm -p 8000:8000 -p 8001:8001 -p 8002:8002 -v ${{ github.workspace }}/tests/samples/triton_models_test:/models nvcr.io/nvidia/tritonserver:23.04-pyt-python-py3 tritonserver --model-repository=/models
- name: Test with pytest
run: |
python -m pytest --cov-report=xml --cov=coffea --deselect=test_taskvine
- name: Upload codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12
uses: codecov/codecov-action@v5
- name: Install graphviz
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12
uses: ts-graphviz/setup-graphviz@v2
- name: Install pandoc
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12
uses: r-lib/actions/setup-pandoc@v2
- name: Build documentation
if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12
run: |
cd docs && make html
touch build/html/.nojekyll
- name: Deploy documentation
if: github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.python-version == 3.12
uses: crazy-max/ghaction-github-pages@v4
with:
target_branch: gh-pages
build_dir: docs/build/html
env:
GH_PAT: ${{ secrets.GITHUB_OAUTH }}
test-vine:
runs-on: ubuntu-latest
needs: pre-commit
strategy:
matrix:
python-version: ["3.11"]
name: test coffea-taskvine
steps:
- uses: actions/checkout@v4
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v3
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
channels: conda-forge
- name: Construct conda environment
shell: bash -l {0}
run: |
conda create --yes --prefix ./coffea-conda-test-env -c conda-forge python=${{ matrix.python-version }} ndcctools uv
conda activate ./coffea-conda-test-env
uv pip install --system .
uv pip install --system pytest
- name: Test with pytest
run: |
conda run --prefix ./coffea-conda-test-env pytest tests/test_taskvine.py
# testskyhookjob:
# runs-on: ubuntu-latest
# needs: pre-commit
# name: test coffea-skyhook-job
#
# steps:
# - uses: actions/checkout@3
# - name: Test Coffea Skyhook Bindings
# shell: bash -l {0}
# run: |
# docker build -t coffea-skyhook-test \
# --file docker/skyhook/Dockerfile \
# .
# docker run \
# -v $(pwd):/w \
# -w /w \
# -e IS_CI=true \
# --privileged \
# coffea-skyhook-test \
# ./docker/skyhook/script.sh
release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [test, test-vine]
permissions:
id-token: write
attestations: write
contents: read
strategy:
matrix:
python-version: ["3.12"]
name: deploy release
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build package for PyPI
run: |
pipx run hatch build -t sdist -t wheel
- name: Verify the distribution
run: pipx run twine check --strict dist/*
- name: Generate artifact attestation for sdist and wheel
uses: actions/attest-build-provenance@ef244123eb79f2f7a7e75d99086184180e6d0018 # v1.4.4
with:
subject-path: "dist/coffea-*"
- name: Publish package to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
pass:
needs: [test, test-vine]
runs-on: ubuntu-latest
steps:
- run: echo "All jobs passed"