forked from eth-cscs/COSMA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
70 lines (61 loc) · 1.99 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
include:
- remote: 'https://gitlab.com/cscs-ci/recipes/-/raw/master/templates/v2/.cscs.yml'
stages:
- build
- test
##
## BUILDS
##
.build_common:
extends: .dind
stage: build
only: ['master', 'staging', 'trying']
variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- docker login -u $CSCS_REGISTRY_USER -p $CSCS_REGISTRY_PASSWORD $CSCS_REGISTRY
script:
- docker build --network=host --cache-from $BUILD_IMAGE --build-arg BUILDKIT_INLINE_CACHE=1 -t $BUILD_IMAGE -f $BUILD_DOCKERFILE .
- docker push $BUILD_IMAGE
- docker build -t $DEPLOY_IMAGE --network=host --build-arg BUILDKIT_INLINE_CACHE=1 --build-arg BUILD_ENV=$BUILD_IMAGE -f $DEPLOY_DOCKERFILE .
- docker push $DEPLOY_IMAGE
# Builds a Docker image for the current commit, cpu / gpu
build sanitizer cpu:
extends: .build_common
variables:
BUILD_DOCKERFILE: docker/asan/build-env.Dockerfile
BUILD_IMAGE: $CSCS_REGISTRY_IMAGE/build-env-asan:latest
DEPLOY_DOCKERFILE: docker/asan/deploy.Dockerfile
DEPLOY_IMAGE: $CSCS_REGISTRY_IMAGE/deploy-cpu-asan:$CI_COMMIT_SHA
build cpu:
extends: .build_common
variables:
BUILD_DOCKERFILE: docker/cpu-release/build-env.Dockerfile
BUILD_IMAGE: $CSCS_REGISTRY_IMAGE/build-env-cpu:latest
DEPLOY_DOCKERFILE: docker/cpu-release/deploy.Dockerfile
DEPLOY_IMAGE: $CSCS_REGISTRY_IMAGE/deploy-cpu:$CI_COMMIT_SHA
build gpu:
extends: .build_common
variables:
BUILD_DOCKERFILE: docker/gpu/build-env.Dockerfile
BUILD_IMAGE: $CSCS_REGISTRY_IMAGE/build-env-gpu:latest
DEPLOY_DOCKERFILE: docker/gpu/deploy.Dockerfile
DEPLOY_IMAGE: $CSCS_REGISTRY_IMAGE/deploy-gpu:$CI_COMMIT_SHA
sanitize:
stage: test
only: ['master', 'staging', 'trying']
trigger:
strategy: depend
include: /ci/sanitize.yml
cpu test:
stage: test
only: ['master', 'staging', 'trying']
trigger:
strategy: depend
include: /ci/cpu.yml
gpu test:
stage: test
only: ['master', 'staging', 'trying']
trigger:
strategy: depend
include: /ci/gpu.yml