.gitlab-ci.yml 4.78 KB
Newer Older
Philipp Arras's avatar
Philipp Arras committed
1
image: $CONTAINER_TEST_IMAGE
Jait Dixit's avatar
Jait Dixit committed
2

Philipp Arras's avatar
Philipp Arras committed
3
variables:
Philipp Arras's avatar
Fix CI  
Philipp Arras committed
4
  CONTAINER_TEST_IMAGE: gitlab-registry.mpcdf.mpg.de/ift/nifty-dev:$CI_BUILD_REF_NAME
Martin Reinecke's avatar
Martin Reinecke committed
5
  OMP_NUM_THREADS: 1
Philipp Arras's avatar
Philipp Arras committed
6

Martin Reinecke's avatar
Martin Reinecke committed
7
stages:
Philipp Arras's avatar
Philipp Arras committed
8
  - build_docker
Philipp Arras's avatar
Philipp Arras committed
9
  - test
Philipp Arras's avatar
Philipp Arras committed
10
  - release
Philipp Arras's avatar
Philipp Arras committed
11
  - demo_runs
Philipp Arras's avatar
Change  
Philipp Arras committed
12

13 14 15 16 17 18 19 20 21 22 23 24 25
build_docker_from_scratch:
  only:
    - schedules
  image: docker:stable
  stage: build_docker
  script:
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab-registry.mpcdf.mpg.de
    - docker build -t $CONTAINER_TEST_IMAGE --no-cache .
    - docker push $CONTAINER_TEST_IMAGE

build_docker_from_cache:
  except:
    - schedules
Philipp Arras's avatar
Philipp Arras committed
26
  image: docker:stable
Philipp Arras's avatar
Philipp Arras committed
27 28 29 30 31
  stage: build_docker
  script:
    - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab-registry.mpcdf.mpg.de
    - docker build -t $CONTAINER_TEST_IMAGE .
    - docker push $CONTAINER_TEST_IMAGE
Philipp Arras's avatar
Philipp Arras committed
32

Martin Reinecke's avatar
Martin Reinecke committed
33
test_python2_with_coverage:
Philipp Arras's avatar
Philipp Arras committed
34 35 36
  stage: test
  script:
    - python setup.py install --user -f
Martin Reinecke's avatar
Martin Reinecke committed
37
    - mpiexec -n 2 --bind-to none nosetests -q 2> /dev/null
Philipp Arras's avatar
Philipp Arras committed
38
    - nosetests -q --with-coverage --cover-package=nifty5 --cover-erase
Martin Reinecke's avatar
Martin Reinecke committed
39
    - >
Martin Reinecke's avatar
Martin Reinecke committed
40
      coverage report --omit "*plotting*,*distributed_do*"
Martin Reinecke's avatar
Martin Reinecke committed
41
    - >
Martin Reinecke's avatar
Martin Reinecke committed
42
      coverage report --omit "*plotting*,*distributed_do*" | grep TOTAL | awk '{ print "TOTAL: "$4; }'
Philipp Arras's avatar
Philipp Arras committed
43

Martin Reinecke's avatar
Martin Reinecke committed
44
test_python3:
Philipp Arras's avatar
Philipp Arras committed
45 46 47
  stage: test
  script:
    - python3 setup.py install --user -f
Martin Reinecke's avatar
Martin Reinecke committed
48
    - mpiexec -n 2 --bind-to none nosetests3 -q 2> /dev/null
Martin Reinecke's avatar
Martin Reinecke committed
49
    - nosetests3 -q
Martin Reinecke's avatar
Martin Reinecke committed
50

Philipp Arras's avatar
Philipp Arras committed
51 52 53 54 55 56 57 58 59 60
pages:
  stage: release
  script:
    - python setup.py install --user -f
    - sh docs/generate.sh
    - mv docs/build/ public/
  artifacts:
    paths:
    - public
  only:
Philipp Arras's avatar
Philipp Arras committed
61
  - NIFTy_4
Philipp Arras's avatar
Philipp Arras committed
62 63 64 65 66

before_script:
  - export MPLBACKEND="agg"

run_critical_filtering:
Philipp Arras's avatar
Philipp Arras committed
67
  stage: demo_runs
Philipp Arras's avatar
Philipp Arras committed
68 69 70 71 72 73
  script:
    - ls
    - python setup.py install --user -f
    - python3 setup.py install --user -f
    - python demos/critical_filtering.py
    - python3 demos/critical_filtering.py
Philipp Arras's avatar
Philipp Arras committed
74 75 76
  artifacts:
    paths:
      - '*.png'
Philipp Arras's avatar
Philipp Arras committed
77 78

run_nonlinear_critical_filter:
Philipp Arras's avatar
Philipp Arras committed
79
  stage: demo_runs
Philipp Arras's avatar
Philipp Arras committed
80 81 82 83 84
  script:
    - python setup.py install --user -f
    - python3 setup.py install --user -f
    - python demos/nonlinear_critical_filter.py
    - python3 demos/nonlinear_critical_filter.py
Philipp Arras's avatar
Philipp Arras committed
85 86 87
  artifacts:
    paths:
      - '*.png'
Philipp Arras's avatar
Philipp Arras committed
88 89

run_nonlinear_wiener_filter:
Philipp Arras's avatar
Philipp Arras committed
90
  stage: demo_runs
Philipp Arras's avatar
Philipp Arras committed
91 92 93 94 95 96 97
  script:
    - python setup.py install --user -f
    - python3 setup.py install --user -f
    - python demos/nonlinear_wiener_filter.py
    - python3 demos/nonlinear_wiener_filter.py
  only:
    - run_demos
Philipp Arras's avatar
Philipp Arras committed
98 99 100
  artifacts:
    paths:
      - '*.png'
Philipp Arras's avatar
Philipp Arras committed
101

Martin Reinecke's avatar
Martin Reinecke committed
102 103 104 105 106 107 108 109 110 111 112
# FIXME: disable for now. Fixing it is part of issue #244.
#run_poisson_demo:
#  stage: demo_runs
#  script:
#    - python setup.py install --user -f
#    - python3 setup.py install --user -f
#    - python demos/poisson_demo.py
#    - python3 demos/poisson_demo.py
#  artifacts:
#    paths:
#      - '*.png'
Philipp Arras's avatar
Philipp Arras committed
113 114

run_probing:
Philipp Arras's avatar
Philipp Arras committed
115
  stage: demo_runs
Philipp Arras's avatar
Philipp Arras committed
116 117 118 119 120
  script:
    - python setup.py install --user -f
    - python3 setup.py install --user -f
    - python demos/probing.py
    - python3 demos/probing.py
Philipp Arras's avatar
Philipp Arras committed
121 122 123
  artifacts:
    paths:
      - '*.png'
Philipp Arras's avatar
Philipp Arras committed
124 125

run_sampling:
Philipp Arras's avatar
Philipp Arras committed
126
  stage: demo_runs
Philipp Arras's avatar
Philipp Arras committed
127 128 129 130 131
  script:
    - python setup.py install --user -f
    - python3 setup.py install --user -f
    - python demos/sampling.py
    - python3 demos/sampling.py
Philipp Arras's avatar
Philipp Arras committed
132 133 134
  artifacts:
    paths:
      - '*.png'
Philipp Arras's avatar
Philipp Arras committed
135 136

run_tomography:
Philipp Arras's avatar
Philipp Arras committed
137
  stage: demo_runs
Philipp Arras's avatar
Philipp Arras committed
138 139 140 141 142
  script:
    - python setup.py install --user -f
    - python3 setup.py install --user -f
    - python demos/tomography.py
    - python3 demos/tomography.py
Philipp Arras's avatar
Philipp Arras committed
143 144 145
  artifacts:
    paths:
      - '*.png'
Philipp Arras's avatar
Philipp Arras committed
146 147

run_wiener_filter_data_space_noiseless:
Philipp Arras's avatar
Philipp Arras committed
148
  stage: demo_runs
Philipp Arras's avatar
Philipp Arras committed
149 150 151 152 153
  script:
    - python setup.py install --user -f
    - python3 setup.py install --user -f
    - python demos/wiener_filter_data_space_noiseless.py
    - python3 demos/wiener_filter_data_space_noiseless.py
Philipp Arras's avatar
Philipp Arras committed
154 155 156
  artifacts:
    paths:
      - '*.png'
Philipp Arras's avatar
Philipp Arras committed
157 158

run_wiener_filter_easy.py:
Philipp Arras's avatar
Philipp Arras committed
159
  stage: demo_runs
Philipp Arras's avatar
Philipp Arras committed
160 161 162 163 164
  script:
    - python setup.py install --user -f
    - python3 setup.py install --user -f
    - python demos/wiener_filter_easy.py
    - python3 demos/wiener_filter_easy.py
Philipp Arras's avatar
Philipp Arras committed
165 166 167
  artifacts:
    paths:
      - '*.png'
Philipp Arras's avatar
Philipp Arras committed
168 169

run_wiener_filter_via_curvature.py:
Philipp Arras's avatar
Philipp Arras committed
170
  stage: demo_runs
Philipp Arras's avatar
Philipp Arras committed
171 172 173 174 175 176 177
  script:
    - pip install --user numericalunits
    - pip3 install --user numericalunits
    - python setup.py install --user -f
    - python3 setup.py install --user -f
    - python demos/wiener_filter_via_curvature.py
    - python3 demos/wiener_filter_via_curvature.py
Philipp Arras's avatar
Philipp Arras committed
178 179 180
  artifacts:
    paths:
      - '*.png'
Philipp Arras's avatar
Philipp Arras committed
181 182

run_wiener_filter_via_hamiltonian.py:
Philipp Arras's avatar
Philipp Arras committed
183
  stage: demo_runs
Philipp Arras's avatar
Philipp Arras committed
184 185 186 187 188
  script:
    - python setup.py install --user -f
    - python3 setup.py install --user -f
    - python demos/wiener_filter_via_hamiltonian.py
    - python3 demos/wiener_filter_via_hamiltonian.py
Philipp Arras's avatar
Philipp Arras committed
189 190 191
  artifacts:
    paths:
      - '*.png'
Philipp Arras's avatar
Philipp Arras committed
192 193

run_ipynb:
Philipp Arras's avatar
Philipp Arras committed
194
  stage: demo_runs
Philipp Arras's avatar
Philipp Arras committed
195 196 197
  script:
    - python setup.py install --user -f
    - python3 setup.py install --user -f
Philipp Arras's avatar
Philipp Arras committed
198
    - jupyter nbconvert --execute --ExecutePreprocessor.timeout=None demos/Wiener_Filter.ipynb
Philipp Arras's avatar
Philipp Arras committed
199 200 201
  artifacts:
    paths:
      - '*.png'