-
Notifications
You must be signed in to change notification settings - Fork 93
/
.gitlab-ci.yml
87 lines (78 loc) · 1.74 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
stages:
- build_image
- deploy
variables:
IMAGE_NAME: k8s-vgpu
.build_image:
stage: build_image
image: '${DIND_IMAGE}'
script:
- IMAGE_FULL_NAME=${IMAGE_REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}
- >
docker build -t ${IMAGE_FULL_NAME}
--build-arg GOLANG_IMAGE=${GOLANG_IMAGE}
--build-arg NVIDIA_IMAGE=${NVIDIA_IMAGE}
--build-arg VERSION=${VERSION}
--build-arg GOPROXY=${GOPROXY} -f ./docker/Dockerfile .
- docker push ${IMAGE_FULL_NAME}
build_dev_image:
extends: .build_image
variables:
IMAGE_TAG: ${CI_COMMIT_SHA}
VERSION: ${CI_COMMIT_SHA}
only:
- master
build_release_image:
extends: .build_image
variables:
IMAGE_TAG: ${CI_COMMIT_TAG}
VERSION: ${CI_COMMIT_TAG}-${CI_COMMIT_SHA}
only:
- tags
.deploy:
stage: deploy
image: '${HELM_IMAGE}'
variables:
RELEASE_NAME: vgpu
RELEASE_NAMESPACE: vgpu
EXTRA_ARGS: ''
script:
- IMAGE_FULL_NAME=${IMAGE_REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}
- >
helm upgrade --install ${RELEASE_NAME} ./charts/4pd-vgpu
-n ${RELEASE_NAMESPACE}
--set scheduler.extender.image=${IMAGE_FULL_NAME}
--set devicePlugin.image=${IMAGE_FULL_NAME}
${EXTRA_ARGS}
deploy_develop:
extends: .deploy
variables:
IMAGE_TAG: ${CI_COMMIT_SHA}
environment:
name: vgpu-develop
only:
- master
tags:
- deploy-test
deploy_pre_product:
extends: .deploy
variables:
IMAGE_TAG: ${CI_COMMIT_TAG}
EXTRA_ARGS: "--wait --timeout=30m"
environment:
name: vgpu-develop
only:
- tags
tags:
- deploy-test
deploy_product:
extends: .deploy
variables:
IMAGE_TAG: ${CI_COMMIT_TAG}
environment:
name: vgpu-product
only:
- tags
tags:
- deploy-product
when: manual