-
Notifications
You must be signed in to change notification settings - Fork 41
/
config.yml
423 lines (415 loc) · 13.7 KB
/
config.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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
version: 2.1
variables:
install_conda: &install_conda
run:
name: Install miniconda3
command: |
sudo apt-get update && sudo apt-get install -y build-essential libz-dev libcurl3-dev libarchive-dev gcc && \
wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
/usr/bin/bash ~/miniconda.sh -b && \
rm ~/miniconda.sh && \
~/miniconda3/bin/conda clean -tipsy && \
sudo ln -s ~/miniconda3/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
echo ". ~/miniconda3/etc/profile.d/conda.sh" >> $BASH_ENV && \
echo "conda activate base" >> $BASH_ENV
update_conda: &update_conda
run:
name: Update conda
command: conda update -n base conda
install_mamba_solver: &install_mamba_solver
run:
name: Install mamba solver (experimental)
command: conda install -n base conda-libmamba-solver
install_sys_deps: &install_sys_deps
run:
name: install build-essential
command: apt-get update --allow-releaseinfo-change && apt-get install -y build-essential libz-dev libcurl3-dev libarchive-dev gcc
install_apptainer: &install_apptainer
run:
name: Install Apptainer from source
command: |
echo 'export CI_JOB_PY_YAML="$CI_JOB_PY_YAML"' >> $BASH_ENV
sudo apt-get -q update && sudo apt-get install -y build-essential squashfs-tools libseccomp-dev cryptsetup libhdf5-serial-dev pkg-config
wget https://github.com/apptainer/apptainer/releases/download/v1.0.1/apptainer_1.0.1_amd64.deb
sudo apt install ~/repo/apptainer_1.0.1_amd64.deb
apptainer --version
rm ~/repo/apptainer_1.0.1_amd64.deb
install_kipoi_plugins: &install_kipoi_plugins
run:
name: Install kipoi plugins
command: |
pip install kipoi_interpret
pip install kipoiseq
pip install pyfaidx
conda install --yes -c conda-forge fastparquet zarr numcodecs
export_shortcuts: &export_shortcuts
run:
name: Export shortcuts
command: |
# for no good reason the wrong version of pytest is choosen by default...
echo 'export PYTEST=$(conda info --base)/envs/kipoi-env/bin/pytest' >> $BASH_ENV
install_from_dev_requirements_py36: &install_from_dev_requirements_py36
run:
name: Install from dev-requirements-py36.yml
command: |
echo 'export CI_JOB_PY_YAML="$CI_JOB_PY_YAML"' >> $BASH_ENV
conda env create --name kipoi-env -f dev-requirements-py36.yml --experimental-solver=libmamba
source activate kipoi-env
pip install -e .
git lfs install
# ln -s /opt/conda/bin/python /usr/bin/python
install_from_dev_requirements_py37: &install_from_dev_requirements_py37
run:
name: Install from dev-requirements-py37.yml
command: |
echo 'export CI_JOB_PY_YAML="$CI_JOB_PY_YAML"' >> $BASH_ENV
conda env create --name kipoi-env -f dev-requirements-py37.yml --experimental-solver=libmamba
source activate kipoi-env
pip install -e .
git lfs install
# ln -s /opt/conda/bin/python /usr/bin/python
install_from_dev_requirements: &install_from_dev_requirements
run:
name: Install from dev-requirements.yml
command: |
echo 'export CI_JOB_PY_YAML="$CI_JOB_PY_YAML"' >> $BASH_ENV
conda create --name kipoi-env python=<< parameters.python-version >>
source activate kipoi-env
conda env update --name kipoi-env --file dev-requirements.yml --experimental-solver=libmamba
pip install -e .
git lfs install
no_output_timeout: 30m
install_cyvcf2: &install_cyvcf2
run:
name: Install cyvcf2 (conda package is not yet available for 3.10)
command: |
source activate kipoi-env
git clone --recursive https://github.com/brentp/cyvcf2
cd cyvcf2/htslib
autoheader
autoconf
./configure --enable-libcurl
make
cd ..
pip install -r requirements.txt
CYTHONIZE=1 pip install -e .
install_pybigwig: &install_pybigwig
run:
name: Install pybigwig (conda package is not yet available for 3.10)
command: |
source activate kipoi-env
git clone https://github.com/deeptools/pyBigWig.git
cd pyBigWig
pip install .
install_kipoi: &install_kipoi
run:
name: Install Kipoi
command: pip install '.[develop]'
install_requests: &install_requests
run:
name: Install requirements for requests correctly
command: pip install requests
kipoi_ls1: &kipoi_ls
run:
name: List kipoi packages
command: kipoi ls
kipoi_ls2: &activate_and_kipoi_ls
run:
name: List kipoi packages
command: |
source activate kipoi-env
kipoi ls
activate_and_run_tests_py367: &activate_and_run_tests_py367
run:
name: Run tests
command: |
source activate kipoi-env
mkdir test-reports
$PYTEST --cov=kipoi/ tests/ -p no:sugar --no-cov-on-fail --junitxml=test-reports/junit.xml
no_output_timeout: 30m
activate_and_run_tests: &activate_and_run_tests
run:
name: Run tests
command: |
source activate kipoi-env
mkdir test-reports
$PYTEST --cov=kipoi/ tests/ -k "not legacy" -p no:sugar --no-cov-on-fail --junitxml=test-reports/junit.xml
no_output_timeout: 30m
# Special case for running without concise
# run_coveralls: &run_coveralls
# run:
# name: run coveralls
# command: coveralls || true
activate_and_run_coveralls: &activate_and_run_coveralls
run:
name: activate and run coveralls
command: |
source activate kipoi-env
coveralls
store_test_results: &store_test_results
store_test_results:
path: test-reports
store_test_artifacts: &store_test_artifacts
store_artifacts:
path: test-reports
destination: test-reports
# deployment
build_pypi_package: &build_pypi_package
run:
name: build python packages
command: |
source activate kipoi-env
python setup.py sdist bdist_wheel
conda_install_twine: &conda_install_twine
run:
name: Install twine
command: conda install twine
pypi_create_pypirc: &pypi_create_pypirc
run:
name: init .pypirc
command: |
echo -e "[distutils]" >> ~/.pypirc
echo -e "index-servers = " >> ~/.pypirc
echo -e " pypi" >> ~/.pypirc
echo -e " testpypi" >> ~/.pypirc
echo -e "" >> ~/.pypirc
echo -e "[testpypi]" >> ~/.pypirc
echo -e "repository: https://test.pypi.org/legacy/" >> ~/.pypirc
echo -e "username: $TEST_PYPI_USERNAME" >> ~/.pypirc
echo -e "password: $TEST_PYPI_PASSWORD" >> ~/.pypirc
echo -e "[pypi]" >> ~/.pypirc
echo -e "username: $PYPI_USERNAME" >> ~/.pypirc
echo -e "password: $PYPI_PASSWORD" >> ~/.pypirc
jobs:
test:
parameters:
python-version:
type: string
machine: # executor type
image: ubuntu-2004:current
resource_class: medium
working_directory: ~/repo
steps:
- checkout
- *install_apptainer
- *install_conda
- *update_conda
- *install_mamba_solver
- *install_from_dev_requirements
- *install_cyvcf2
- *install_pybigwig
- *export_shortcuts
- *activate_and_kipoi_ls
- *activate_and_run_tests
# - coveralls/upload
# - *activate_and_run_coveralls
- *store_test_results
- *store_test_artifacts
test-36:
machine: # executor type
image: ubuntu-2004:current
resource_class: medium
working_directory: ~/repo
steps:
- checkout
- *install_apptainer
- *install_conda
- *update_conda
- *install_mamba_solver
# - *install_sys_deps # Installed in install_conda step
- *install_from_dev_requirements_py36
- *export_shortcuts
- *activate_and_kipoi_ls
- *activate_and_run_tests_py367
# - coveralls/upload
# - *activate_and_run_coveralls
- *store_test_results
- *store_test_artifacts
test-37:
machine: # executor type
image: ubuntu-2004:current
resource_class: medium
working_directory: ~/repo
steps:
- checkout
- *install_apptainer
- *install_conda
- *update_conda
- *install_mamba_solver
# - *install_sys_deps # Installed in install_conda step
- *install_from_dev_requirements_py37
- *export_shortcuts
- *activate_and_kipoi_ls
- *activate_and_run_tests_py367
- *activate_and_run_coveralls
- *store_test_results
- *store_test_artifacts
build-deploy-docs:
docker:
# - image: continuumio/miniconda3:4.5.12
- image: continuumio/anaconda3:latest
# - image: circleci/python:3.5
working_directory: ~/repo
steps:
- add_ssh_keys:
fingerprints:
- 60:0f:05:31:12:3d:bc:8b:df:9d:08:da:71:a5:43:b6
- checkout
- run:
name: Install Kipoi in a conda environment
command: |
conda create -n py39 -y python=3.9
source activate py39
pip install -e .
- run:
name: Install build deps
command: |
source activate py39
pip install pandas mistune jinja2 nbconvert tornado mkdocs git+https://github.com/kipoi/pydoc-markdown@master
- run:
name: Build docs
command: |
source activate py39
cd docs/
./render_ipynb.bash
pydocmd build
- run:
name: Deploy docs
command: .circleci/deploy_docs.bash
test-deploy-pypi:
parameters:
python-version:
type: string
default: "3.9"
machine: # executor type
image: ubuntu-2004:current
resource_class: medium
working_directory: ~/repo
steps:
- checkout
- *install_conda
# - *install_mamba
- *update_conda
- *install_mamba_solver
# - *install_sys_deps # Installed in install_conda step
- *install_from_dev_requirements
- *export_shortcuts
- *activate_and_kipoi_ls
- *build_pypi_package
- *conda_install_twine
- *pypi_create_pypirc
- run:
name: check if commit is tagged
command: git describe --exact-match --tags HEAD && echo "commit is tagged; continuing" || circleci step halt
- run:
name: upload to TestPyPI
command: twine upload --repository testpypi dist/* --verbose
- run:
name: pip install from TestPyPI
command: |
source activate kipoi-env
python -m pip install --user --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple kipoi --verbose
python -c "import kipoi; print(kipoi.__version__)"
productive-deploy-pypi:
parameters:
python-version:
type: string
default: "3.9"
machine: # executor type
image: ubuntu-2004:current
resource_class: medium
working_directory: ~/repo
steps:
- checkout
- *install_conda
# - *install_mamba
- *update_conda
- *install_mamba_solver
# - *install_sys_deps # Installed in install_conda step
- *install_from_dev_requirements
- *export_shortcuts
- *activate_and_kipoi_ls
- *build_pypi_package
- *conda_install_twine
- *pypi_create_pypirc
- run:
name: check if commit is tagged
command: git describe --exact-match --tags HEAD && echo "commit is tagged; continuing" || circleci step halt
- run:
name: upload to PyPI
command: twine upload --repository pypi dist/* --verbose
- run:
name: pip install from PyPI
command: |
source activate kipoi-env
python -m pip install --user kipoi --verbose
python -c "import kipoi; print(kipoi.__version__)"
- run:
name: Update all containers with new version of kipoi
command: |
curl -X POST https://api.github.com/repos/kipoi/kipoi-containers/dispatches \
-H 'Accept: application/vnd.github.v3+json' \
-u $SYNC_TOKEN \
--data '{"event_type": "updateall"}'
workflows:
version: 2.1
# TODO - consider running the deploy only on
# tag commits: https://circleci.com/docs/2.0/workflows/#git-tag-job-execution
test-n-deploy:
jobs:
- test:
matrix:
parameters:
python-version: ["3.8", "3.9", "3.10"]
- test-36
- test-37
- build-deploy-docs:
requires:
- test-36
- test-37
- test
filters:
branches:
only:
- master
- test_deployment_script
- test-deploy-pypi:
requires:
- test-36
- test-37
- test
filters:
# tags:
# only: /^v.*/
branches:
only:
- test_deployment_pypi
- test_deployment_script
- productive-deploy-pypi:
requires:
- test-36
- test-37
- test
filters:
# # Trigger only on a tagged commit starting with v.
# # https://circleci.com/docs/2.0/workflows/#executing-workflows-for-a-git-tag
# tags:
# only: /^v.*/
branches:
only:
- master
kipoi-nightly-test:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
- test:
matrix:
parameters:
python-version: ["3.8", "3.9", "3.10"]
- test-36
- test-37