-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
180 lines (147 loc) · 4.66 KB
/
.gitlab-ci.yml
File metadata and controls
180 lines (147 loc) · 4.66 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
include:
- remote: 'https://raw.githubusercontent.com/pnnl-miscscripts/gitlab-lib/v1/gitlab-lib.yaml'
services:
- postgres:13
variables:
POSTGRES_DB: molformula
POSTGRES_USER: coremsdb
POSTGRES_PASSWORD: coremsmolform
POSTGRES_HOST_AUTH_METHOD: trust
COREMS_DATABASE_URL: postgresql://coremsdb:coremsmolform@postgres:5432/molformula
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
stages:
- Pytest
- Test Notebooks
- Build Python Package
- Push to PyPi
- Push to Gitlab Registry
# - Push to Docker Hub
test-source:
image: code-registry.emsl.pnl.gov/mass-spectrometry/corems/corems-base-310-dotnet6:2.5.3-1005
stage: Pytest
tags:
- k8s
- rzr
- codebuilds
script:
- python3 -V # Print out python version for debugging
- python3 -m pip install --upgrade pip
- python3 -m pip install -r requirements.txt
- python3 -m pip install pytest pytest-cov
- python3 -m pip install psycopg2
- export COREMS_LIPIDOMICS_SQLITE_PATH="$CI_PROJECT_DIR/tests/tests_data/lcms/202412_lipid_ref.sqlite"
- make download-lipidomics-db LIPIDOMICS_SQLITE_PATH="$COREMS_LIPIDOMICS_SQLITE_PATH"
- python3 -c "import pathlib; [p.unlink() for p in pathlib.Path('.').rglob('tests/win_only/__init__.py')]"
- export PYTHONNET_RUNTIME=coreclr
- pytest --cache-clear
artifacts:
paths:
- doc/coverage_html_report
test-notebooks:
image: code-registry.emsl.pnl.gov/mass-spectrometry/corems/corems-base-310-dotnet6:2.5.3-1005
stage: Test Notebooks
tags:
- k8s
- rzr
- codebuilds
script:
- python3 -V # Print out python version for debugging
- python3 -m pip install --upgrade pip
- python3 -m pip install -r requirements.txt
- python3 -m pip install jupyter nbconvert
- python3 -m pip install psycopg2
- python3 -m pip install -e .
- export PYTHONNET_RUNTIME=coreclr
- cd examples && python3 test_notebooks.py
artifacts:
when: on_failure
paths:
- /tmp/*_test.ipynb
build:
stage: Build Python Package
image: code-registry.emsl.pnl.gov/mass-spectrometry/corems/corems-base-310-dotnet6:2.5.3-1005
tags:
- k8s
- rzr
- codebuilds
script:
- apt-get install libpq-dev -y
- python3 -V # Print out python version for debugging
- python3 -m pip install twine
- python3 setup.py sdist
- python3 -m pip install dist/*
# run the command here
artifacts:
paths:
- dist/*
#pypi:
# stage: Push to PyPi
# tags:
# - corems
# - k8s
# - rzr
# script:
# - twine upload dist/*
# only:
# - tags
# build-base-image:
# extends: .pnnllib-gitlab-build-container-image
# stage: Push to Gitlab Registry
# image: gcr.io/kaniko-project/executor:debug@sha256:71d8cf6012b67979960f5b15b85408438132d87eef599926d8931f348d045957
# tags:
# - k8s
# - rzr
# - codebuilds
# only:
# - master
# variables:
# KANIKO_EXTRA_ARGS: "--cache=true --cache-copy-layers=true --destination $CI_REGISTRY_IMAGE:latest"
# CONTEXT: $CI_PROJECT_DIR
# DOCKERFILE: Dockerfile_py310_dotnet_base_clean
# KUBERNETES_CPU_REQUEST: 100m
# KUBERNETES_CPU_LIMIT: "2"
# KUBERNETES_MEMORY_REQUEST: 2Gi
# KUBERNETES_MEMORY_LIMIT: 8Gi
# CONTAINER_TAG: "2.0.0-1005"
# deployment:
# stage: Push to Gitlab Registry
# tags:
# - k8s
# - rzr
# - codebuilds
# image:
# name: gcr.io/kaniko-project/executor:debug
# entrypoint: [""]
# script:
# - export DOCKER_CONFIG=/kaniko/.docker/
# - export GOOGLE_APPLICATION_CREDENTIALS=/kaniko/.docker/config.json
# - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
# - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile_py310_dotnet_base --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
# only:
# - master
#docker push:
# stage: Push to Docker Hub
# tags:
# - corems
# - k8s
# - rzr
# image:
# name: gcr.io/kaniko-project/executor:debug
# entrypoint: [""]
# script:
# - export DOCKER_CONFIG=/kaniko/.docker/
# - export GOOGLE_APPLICATION_CREDENTIALS=/kaniko/.docker/config.json
# - echo "{\"auths\":{\"$DOCKER_HUB_REGISTRY\":{\"username\":\"$DOCKER_HUB_USER\",\"password\":\"$DOCKER_HUB_PASSWORD\"}}}" > /kaniko/.docker/config.json
# - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $MAJOR_VER
# only:
# - master
#pages:
# script:
# - pip install sphinx sphinx-rtd-theme
# - cd doc ; make html
# - mv build/html/ ../public/
# artifacts:
# paths:
# - public
# only:
# - master