-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
62 lines (58 loc) · 2.02 KB
/
.gitlab-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
# Configuration to run TVO CI on our workstations
# It assumes conda is installed, in path, and the tvem environment has been created from our repo's environment.yml file.
# The special environment python/3.6.4-ompi (pytorch+CUDA+MPI) is loaded to run parallelization tests.
# Documentation generation with sphinx additionally requires
# `conda install -c conda-forge sphinx sphinx_rtd_theme sphinx-autodoc-typehints`
# FIXME switch back when we go back to self-hosted runners
image: registry.gitlab.com/mloldenburg/tvem
before_script:
- source /opt/conda/etc/profile.d/conda.sh
- conda activate tvem
test:
stage: test
only:
- master
- tags
- merge_requests
script:
# static checkers
- black --check -q . || { black --diff -q . && false; }
- pylama
- mypy tvo test
# compile extension modules
- python setup.py build_ext --inplace
# CPU tests
- pytest --cov=tvo -v test
# GPU tests
# FIXME: re-enable when we go back to self-hosted runners
#- env TVO_GPU=0 pytest --cov=tvo --cov-append -v -m gpu test
# mpi tests (force a timeout because mpi might hang in case of python runtime errors)
# FIXME: re-enable when we have a working pytorch+MPI environment
# - module load python/3.6.4-ompi
# - timeout 5m mpirun -n 4 bash .ci_scripts/run_mpi_tests.sh 0 # coverage of rank 0
# - timeout 5m mpirun -n 4 bash .ci_scripts/run_mpi_tests.sh 3 # coverage of rank 3
artifacts:
paths:
- .coverage
conda:
stage: deploy
only:
- tags
script:
- anaconda login --username $ANACONDA_USER --password $ANACONDA_PASSWORD
- conda build -c pytorch -c conda-forge .
- anaconda upload -u mloldenburg $(conda build --output .)
- anaconda logout
pages:
stage: deploy
only:
- master
- tags
script:
- python setup.py build_ext --inplace
- sphinx-build docs public
- python .ci_scripts/make_coverage_badge.py public/cov_badge.svg
- python .ci_scripts/make_coverage_html_report.py public/htmlcov
artifacts:
paths:
- public