forked from SeldonIO/cicd-demo-model-source-files
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-image-and-push-using-docksock-wf.json
150 lines (150 loc) · 5.9 KB
/
build-image-and-push-using-docksock-wf.json
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
{
"apiVersion": "argoproj.io/v1alpha1",
"kind": "Workflow",
"metadata": {
"generateName": "build-image-and-push-"
},
"spec": {
"arguments": {
"parameters": [
{
"name": "model-version",
"value": "%MODEL_VERSION%"
},
{
"name": "github-user",
"value": "%GITHUB_USER%"
},
{
"name": "github-token",
"value": "%GITHUB_TOKEN%"
}
]
},
"entrypoint": "build-steps",
"templates": [
{
"name": "build-steps",
"steps": [
[
{
"arguments": {
"parameters": [
{
"name": "cmdargs",
"value": "curl -s activity-monitor.default.svc.cluster.local:80/?'(ARGO) build-image-and-push-using-docksock-wf run for {{workflow.parameters.model-version}}' > /dev/null"
}
]
},
"name": "activity-monitor",
"template": "image-builder"
}
],
[
{
"arguments": {
"parameters": [
{
"name": "cmdargs",
"value": "until docker ps; do sleep 3; done; set -x && cd /work/model-source-files/models/simple-model && make MODEL_VERSION={{workflow.parameters.model-version}} build_model_image && docker images && docker images | grep simple-model && make MODEL_VERSION={{workflow.parameters.model-version}} push_to_registry"
}
]
},
"name": "build-image",
"template": "image-builder"
}
],
[
{
"arguments": {
"parameters": [
{
"name": "cmdargs",
"value": "set -x && cd /work/k8s-manifest-files && make -f Makefile.ci update_model_manifest MODEL_VERSION={{workflow.parameters.model-version}} && git status -s && git config user.email [email protected] && git commit --allow-empty -m 'auto version update ({{workflow.parameters.model-version}})' demo-manifests/model.json && git push"
}
]
},
"name": "update-manifest",
"template": "manifest-updater"
}
]
]
},
{
"container": {
"args": [
"{{inputs.parameters.cmdargs}}"
],
"command": [
"sh",
"-c"
],
"image": "gsunner/s2i-tools:0.1",
"volumeMounts": [
{
"mountPath": "/var/run/docker.sock",
"name": "docker-sock-volume"
}
]
},
"inputs": {
"artifacts": [
{
"git": {
"repo": "https://{{workflow.parameters.github-user}}:{{workflow.parameters.github-token}}@github.com/{{workflow.parameters.github-user}}/cicd-demo-model-source-files.git",
"revision": "master"
},
"name": "model-source-files",
"path": "/work/model-source-files"
}
],
"parameters": [
{
"name": "cmdargs"
}
]
},
"name": "image-builder"
},
{
"container": {
"args": [
"{{inputs.parameters.cmdargs}}"
],
"command": [
"sh",
"-c"
],
"image": "seldonio/k8s-deployer:k8s_v1.9.0"
},
"inputs": {
"artifacts": [
{
"git": {
"repo": "https://{{workflow.parameters.github-user}}:{{workflow.parameters.github-token}}@github.com/{{workflow.parameters.github-user}}/cicd-demo-k8s-manifest-files.git",
"revision": "master"
},
"name": "k8s-manifest-files",
"path": "/work/k8s-manifest-files"
}
],
"parameters": [
{
"name": "cmdargs"
}
]
},
"name": "manifest-updater"
}
],
"volumes": [
{
"hostPath": {
"path": "/var/run/docker.sock",
"type": "File"
},
"name": "docker-sock-volume"
}
]
}
}