-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
159 lines (142 loc) · 3.62 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
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
# Continuous Integration Script
# Deformetrica - ARAMIS
stages:
- prepare_env # prepare conda environment defined in environment.yml
- test # run unit tests
- package_and_deploy # package for deployment
- cleanup
############
# TEMPLATES
############
.prepare_env_template: &prepare_env
stage: prepare_env
retry: 2
script:
- id
- pwd
- ls -al
- if [ -f "~/.profile" ]; then . ~/.profile; fi
- source ~/miniconda3/etc/profile.d/conda.sh
- conda create -n deformetrica_env python=3.8
#- conda env create --force --file environment.yml --name deformetrica_env
- conda activate deformetrica_env
- pip install numpy # Workaround for Pykeops installation
- pip install -r requirements.txt
- conda deactivate
.unit_test_template: &unit-test
stage: test
script:
- if [ -f "~/.profile" ]; then . ~/.profile; fi
- source ~/miniconda3/etc/profile.d/conda.sh
- conda activate deformetrica_env
- echo $PYTHONPATH
- PYTHONPATH=$PYTHONPATH:src/:tests/ ./tests/unit_tests/run_unit_tests.py
- conda deactivate
.functional_test_template: &functional-test
stage: test
script:
- if [ -f "~/.profile" ]; then . ~/.profile; fi
- source ~/miniconda3/etc/profile.d/conda.sh
- conda activate deformetrica_env
- echo $PYTHONPATH
- PYTHONPATH=$PYTHONPATH:src/:tests/ ./tests/functional_tests/run_functional_tests.py
- conda deactivate
#.package_and_deploy_template: &package_and_deploy
# stage: package_and_deploy
# retry: 2
# only:
# - tags
# environment:
# name: anaconda
# url: https://anaconda.org/aramislab/deformetrica
# script:
# - id && pwd && ls -alh
# - mkdir deformetrica-build && cd deformetrica-build
# - conda install conda-build==3.16.3 anaconda-client pip && conda update conda anaconda-client
## - export GIT_SSL_NO_VERIFY=1
# - BUILD_GUI=TRUE PACKAGE_NAME=deformetrica conda-build -c pytorch -c anaconda -c conda-forge --output-folder . ../conda
## - BUILD_GUI=FALSE PACKAGE_NAME=deformetrica-nox conda-build --py 3.5 --py 3.6 --py 3.7 -c pytorch -c anaconda -c conda-forge --output-folder . ../conda/meta.yaml # TODO
# - anaconda --token=$ANACONDA_TOKEN --verbose upload --user Aramislab --force --no-progress **/*.tar.bz2
#########
# LINUX
#########
prepare_env:linux:
<<: *prepare_env
tags:
- linux
unit-test:linux:
<<: *unit-test
tags:
- linux
- cuda
functional-test:linux:
<<: *functional-test
tags:
- linux
- cuda
#package_and_deploy:linux:
# <<: *package_and_deploy
# tags:
# - linux
# - package
#########
# MACOS
#########
prepare_env:macos:
<<: *prepare_env
tags:
- macos
unit-test:macos:
<<: *unit-test
tags:
- macos
functional-test:macos:
<<: *functional-test
tags:
- macos
#package_and_deploy:macos:
# <<: *package_and_deploy
# tags:
# - macos
# - package
###################
# EXAMPLE DATASET
###################
package_and_deploy:examples:
stage: package_and_deploy
tags:
- linux
- package
only:
- tags
script:
- zip -r examples.zip examples
- tar -zcvf examples.tar.gz examples
artifacts:
name: examples
paths:
- examples.zip
- examples.tar.gz
###########
# CLEANUP
###########
cleanup:linux:
stage: cleanup
when: always
tags:
- linux
script:
- conda env remove --name deformetrica_env
#- conda-build purge
#- rm -rf deformetrica-build
- conda clean -y -a
cleanup:macos:
stage: cleanup
when: always
tags:
- macos
script:
- conda env remove --name deformetrica_env
#- conda-build purge
#- rm -rf deformetrica-build
- conda clean -y -a