-
Notifications
You must be signed in to change notification settings - Fork 26
207 lines (181 loc) · 6.93 KB
/
Copy pathtests.yml
File metadata and controls
207 lines (181 loc) · 6.93 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
name: CI
on:
push:
branches:
- main
- master
pull_request:
permissions:
contents: read
jobs:
quality:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev,pepsickle]"
- name: Run lint checks
run: ./lint.sh
- name: Build distribution artifacts
run: python -m build --sdist --wheel --no-isolation
- name: Run public pytest subset
run: |
pytest -ra \
tests/test_binding_prediction.py \
tests/test_binding_prediction_collection.py \
tests/test_cli_parsing_helpers.py \
tests/test_cli_registry.py \
tests/test_class2_allele_formats.py \
tests/test_cli_filters.py \
tests/test_mhc_formats.py \
tests/test_netchop_parse.py \
tests/test_process_helpers.py \
tests/test_pred.py \
tests/test_annotate_table.py \
tests/test_prime.py \
tests/test_mixmhc2pred2.py \
tests/test_deeptap.py \
tests/test_calis.py \
tests/test_eramer.py \
tests/test_wrapper_base.py \
tests/test_deepimmuno.py \
tests/test_tlimmuno2.py \
tests/test_processing_predictor.py \
tests/test_pepsickle.py \
tests/test_bigmhc.py \
tests/test_unparseable_alleles.py \
tests/test_nettcr.py \
tests/test_tulip.py \
tests/test_random.py
integration-netmhc:
if: github.repository == 'openvax/mhctools'
runs-on: ubuntu-22.04
env:
# Deterministic, cacheable location for MHCflurry model weights, shared
# by the fetch step and the test run.
MHCFLURRY_DATA_DIR: ${{ github.workspace }}/mhcflurry-data
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Checkout private netmhc-bundle repo
uses: actions/checkout@v4
with:
repository: openvax/netmhc-bundle
ref: v1.0.0
token: ${{ secrets.NETMHC_BUNDLE_ACCESS_TOKEN }}
path: netmhc-bundle
- name: Install netmhc-bundle dependencies
run: |
sudo apt-get update
sudo apt-get install -y tcsh gawk python2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
python -m pip install 'setuptools<81'
- name: Resolve MHCflurry version for the cache key
id: mhcflurry
run: |
echo "version=$(python -c 'import mhcflurry; print(mhcflurry.__version__)')" >> "$GITHUB_OUTPUT"
- name: Cache MHCflurry model weights
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/mhcflurry-data
key: mhcflurry-${{ runner.os }}-${{ steps.mhcflurry.outputs.version }}
- name: Install MHCflurry data
run: |
# On a cache hit this is a no-op; on a miss, retry so a transient
# download failure (e.g. the HTTP 504 that flaked a prior run)
# doesn't fail the whole job.
for attempt in 1 2 3; do
if mhcflurry-downloads fetch; then exit 0; fi
echo "mhcflurry-downloads fetch failed (attempt ${attempt}/3); retrying in 15s" >&2
sleep 15
done
echo "mhcflurry-downloads fetch failed after 3 attempts" >&2
exit 1
- name: Configure netMHC tool paths
env:
NETMHC_BUNDLE_HOME: ${{ github.workspace }}/netmhc-bundle
run: |
# Wrapper scripts have hardcoded /tools/src paths; symlink so they resolve
sudo mkdir -p /tools
sudo ln -s "$NETMHC_BUNDLE_HOME" /tools/src
- name: Run full test suite
env:
NETMHC_BUNDLE_HOME: ${{ github.workspace }}/netmhc-bundle
NETMHC_BUNDLE_TMPDIR: ${{ github.workspace }}/netmhc-bundle-tmp
run: |
mkdir -p "$NETMHC_BUNDLE_TMPDIR"
export PATH="$PATH:$NETMHC_BUNDLE_HOME/bin"
./test.sh
integration-tulip:
# Exercises the TULIP wrapper end-to-end: mhctools runs in one interpreter
# and shells out to an ISOLATED sidecar env (torch + transformers==4.32.1)
# holding a public TULIP-TCR checkout. TULIP is GPLv3; we clone (not vendor)
# it here, same as running any user-provided external tool.
runs-on: ubuntu-22.04
env:
# Cacheable uv wheel cache (torch/transformers are large downloads).
UV_CACHE_DIR: ${{ github.workspace }}/.uv-cache
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Python 3.11 so transformers==4.32.1's tokenizers install from a
# prebuilt wheel (no cp312 wheel exists; a Rust build would be needed).
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: pip
- name: Install mhctools
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
# Cache the uv wheel downloads (torch, transformers==4.32.1, ...). Keyed
# on the setup script, which pins the dependency set, so a change there
# busts the cache.
- name: Cache uv sidecar downloads
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.uv-cache
key: uv-${{ runner.os }}-py311-${{ hashFiles('scripts/setup_tulip_env.sh') }}
# Cache the public TULIP-TCR checkout (~100 MB with weights + data). The
# setup script skips cloning when predict.py is already present. Bump the
# -v1 suffix to force a fresh clone.
- name: Cache TULIP-TCR checkout
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/TULIP-TCR
key: tulip-tcr-${{ runner.os }}-v1
- name: Build isolated TULIP sidecar env + clone TULIP-TCR
env:
# This job's `python` is already 3.11; use it for the sidecar env.
TULIP_SETUP_PYTHON: python
run: |
python -m pip install uv
scripts/setup_tulip_env.sh "${{ github.workspace }}/tulip-env" \
"${{ github.workspace }}/TULIP-TCR"
- name: Run TULIP wrapper tests (incl. end-to-end)
env:
TULIP_HOME: ${{ github.workspace }}/TULIP-TCR
TULIP_PYTHON: ${{ github.workspace }}/tulip-env/bin/python
run: |
python -m pytest tests/test_tulip.py -ra