forked from zenml-io/zenml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudbuild.yaml
80 lines (70 loc) · 2.56 KB
/
cloudbuild.yaml
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
steps:
# login to dockerhub
- name: 'gcr.io/cloud-builders/docker'
id: 'docker-login'
entrypoint: 'bash'
args: ['-c', 'docker login --username=$$USERNAME --password=$$PASSWORD']
secretEnv: ['USERNAME', 'PASSWORD']
# build base development image with tag
- name : 'gcr.io/cloud-builders/docker'
id: 'build-base-dev'
waitFor: ['docker-login']
entrypoint: 'bash'
args: ['-c', 'docker build -t $$USERNAME/zenml:$TAG_NAME-dev -f docker/base-dev.Dockerfile .']
secretEnv: ['USERNAME']
# push base development image
- name: 'gcr.io/cloud-builders/docker'
id: 'push-base-dev'
waitFor: ['build-base-dev']
entrypoint: 'bash'
args: ['-c', 'docker push $$USERNAME/zenml:$TAG_NAME-dev']
secretEnv: ['USERNAME']
# build CUDA development image with tag
- name : 'gcr.io/cloud-builders/docker'
id: 'build-cuda-dev'
waitFor: [ 'docker-login' ]
entrypoint: 'bash'
args: ['-c', 'docker build -t $$USERNAME/zenml:$TAG_NAME-cuda-dev -f docker/cuda-dev.Dockerfile .']
secretEnv: ['USERNAME']
# push CUDA development image
- name: 'gcr.io/cloud-builders/docker'
id: 'push-cuda-dev'
waitFor: [ 'build-cuda-dev' ]
entrypoint: 'bash'
args: ['-c', 'docker push $$USERNAME/zenml:$TAG_NAME-cuda-dev']
secretEnv: ['USERNAME']
# build base image with tag
- name : 'gcr.io/cloud-builders/docker'
id: 'build-base'
waitFor: ['build-base-dev']
entrypoint: 'bash'
args: ['-c', 'docker build --build-arg ZENML_VERSION=$TAG_NAME -t $$USERNAME/zenml:$TAG_NAME -f docker/base.Dockerfile .']
secretEnv: ['USERNAME']
# push base image
- name: 'gcr.io/cloud-builders/docker'
id: 'push-base'
waitFor: ['build-base']
entrypoint: 'bash'
args: ['-c', 'docker push $$USERNAME/zenml:$TAG_NAME']
secretEnv: ['USERNAME']
# build CUDA image with tag
- name : 'gcr.io/cloud-builders/docker'
id: 'build-cuda'
waitFor: [ 'build-cuda-dev' ]
entrypoint: 'bash'
args: ['-c', 'docker build --build-arg ZENML_VERSION=$TAG_NAME -t $$USERNAME/zenml:$TAG_NAME-cuda -f docker/cuda.Dockerfile .']
secretEnv: ['USERNAME']
# push CUDA image
- name: 'gcr.io/cloud-builders/docker'
id: 'push-cuda'
waitFor: ['build-cuda']
entrypoint: 'bash'
args: ['-c', 'docker push $$USERNAME/zenml:$TAG_NAME-cuda']
secretEnv: ['USERNAME']
availableSecrets:
secretManager:
- versionName: projects/$PROJECT_ID/secrets/docker-password/versions/1
env: 'PASSWORD'
- versionName: projects/$PROJECT_ID/secrets/docker-username/versions/1
env: 'USERNAME'
timeout: 3600s