forked from leaf-ai/studio-go-runner
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ci_keel.yaml
420 lines (420 loc) · 19 KB
/
ci_keel.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
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
---
apiVersion: v1
kind: Namespace
metadata:
name: {{ default "ci-go-runner" .Namespace }}
---
# The following role allows the runner under test to interact with the working state config map
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: run-cluster-admin
subjects:
- kind: ServiceAccount
name: default
namespace: {{ default "ci-go-runner" .Namespace }}
roleRef:
kind: ClusterRole
name: studioml-role
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: studioml-role
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
---
# This secret is an open abitrary secret used to confirm the functional encryption and
# MUST never be used for a production system.
apiVersion: v1
kind: Secret
metadata:
name: studioml-runner-passphrase-secret
namespace: {{ default "ci-go-runner" .Namespace }}
type: Opaque
data:
ssh-passphrase: UGFzc1BocmFzZQ==
---
# This secret is an open abitrary secret used to confirm the functional encryption and
# MUST never be used for a production system.
apiVersion: v1
kind: Secret
metadata:
name: studioml-runner-key-secret
namespace: {{ default "ci-go-runner" .Namespace }}
type: Opaque
data:
ssh-privatekey: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpQcm9jLVR5cGU6IDQsRU5DUllQVEVECkRFSy1JbmZvOiBBRVMtMTI4LUNCQyw5MjVGMkVCOTgwNjM4OTFENUM0Q0U4MzhFNUEzODdERQoKOG1UOFlNY2RxS2o5M0F6TmRrUGd0R25LQkhwMzB1NlFENWUydC9FbXRLQ2dtQzcyVUVyR1N1a3dJamMvRENPNgptWWRIaU5BYnAxVEloY0ZyNms4eDVFUHRMRjlsUlhnV1FQT1lIUFh5K3NDTXpnNmRDSDZqVXNIQzUrbFFtRGY5ClRvUTdYdVdpUUVFbVhVdUcwNS9kMjYyWHFocktIR0hGOEMwUGdBQ0xoV1g0MW1mMEhpY05DY015WXJ1eURySWkKcDg5SjUrSEZRYzA1QkxuYnBHMDUyNWhyZDhuYWwyTHNUVjExaVpZaGxHVDlUWWM1b3dOUmEvWjlldml6QWdSOApkSkRoR2Q1bkVvN0NjaGI4VzczYVdPbjVrRmtscVk0NzRQMnZzOE13RDFXMjZCYTF2Z25ydWlHeWhoanorWXJsCnZ5MD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0o3c0NmZUFZeElaMC9YUkphZVIKa2RwM1lmMi94WFlZdytpcExUQmQ2cFBRWUF5NFcyMHVFOTBRR1JMRHV0eGJnM3NySzRYbWRFWGF0ZmE5MGFvagpscUJXOVcwTFV2djZHYlNydWE5TzBrVWdVN2NqdGpxRWd3ZmJBbHR5MUF3UjFGTzhjUTYyTVp5Wk50bVVsSm1lCmZrTjYzRThuR0FsMkRFU1hrL2xCN3lsTXloOXNwTjFCbVlXOTcxU2ZzZVVsK1dmajZJZzNuZFQ4US9ReWd5dFAKdnV0ZnBpZXEyRWpWdnlBSnF1QzRkQlAxZ0FMMExRNTZmYWY5WjEwa2x1S3duUnJUZEZSMHUxci9UYldVZmZJTApIeU4zZWdzb3Nqd1RhZTRPUW51SjQ2ck8wM1dnNEc0UStZTEYrRWRBeUFWOVNNWlZhSTR0ZlhQMlYwR2dVWkhUCmNnbk1WZFAxTmVvS252aEgwQ0hvTzF1NDZGVGxWOTQ4VTZ5a3ZKSlVSUG5GVXo3T09qKzJqb3ppWkVkLzdqZWsKMCtRb0dzY2h5SXpxRmJDQUtQS3FLMnZKQ1pPUHRRWVR3VVc3bGgrQXFpUU9mdE1xbk1mWXhJRUNBd0VBQVE9PQotLS0tLUVORCBSU0EgUFVCTElDIEtFWS0tLS0tCg==
---
apiVersion: v1
kind: Secret
metadata:
name: studioml-signing
namespace: {{ default "ci-go-runner" .Namespace }}
type: Opaque
data:
info: RHVtbXkgU2VjcmV0IHNvIHJlc291cmNlIHJlbWFpbnMgcHJlc2VudA==
rmq_cpu_andrei_: c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUZJVG8wNlBrOHNxQ01vTUhQYVFpUTdCWTNwamY3T0U4QkRjc25Zb3ptSUcga211dGNoQGF3c2Rldgo=
---
apiVersion: v1
kind: Secret
metadata:
name: studioml-report-keys
namespace: {{ default "ci-go-runner" .Namespace }}
type: Opaque
data:
info: RHVtbXkgU2VjcmV0IHNvIHJlc291cmNlIH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ElDIEtFWS0tLS0tCg==
---
apiVersion: v1
kind: Secret
metadata:
name: docker-registry-config
namespace: {{ default "ci-go-runner" .Namespace }}
type: Opaque
data:
registry.yaml: '{{ .Registry | b64enc }}'
---
apiVersion: v1
kind: Secret
metadata:
name: release-github-token
namespace: {{ default "ci-go-runner" .Namespace }}
type: Opaque
data:
github_token: '{{ expandenv "$GITHUB_TOKEN" | b64enc }}'
---
apiVersion: v1
kind: ConfigMap
metadata:
name: build-env
namespace: {{ default "ci-go-runner" .Namespace }}
data:
KeelCI: "KeelCI"
LOGXI: "*=INF"
RABBITMQ_DEFAULT_USER: "UserUser"
RABBITMQ_DEFAULT_PASS: "PasswordPassword"
MINIO_ACCESS_KEY: "UserUser"
MINIO_SECRET_KEY: "PasswordPassword"
MINIO_TEST_SERVER: "${MINIO_SERVICE_SERVICE_HOST}:${MINIO_SERVICE_SERVICE_PORT}"
AMQP_URL: "amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@${RABBITMQ_SERVICE_SERVICE_HOST}:${RABBITMQ_SERVICE_SERVICE_PORT}/%2f?connection_attempts=2&retry_delay=.5&socket_timeout=5"
CLEAR_TEXT_MESSAGES: "true"
# REQUEST_SIGNATURES_DIR: "/runner/certs/queues/signing"
# RESPONSE_SIGNATURES_DIR: "/runner/certs/queues/response-encrypt"
---
# This service exposes rabbit MQ to the cluster members
apiVersion: v1
kind: Service
metadata:
labels:
component: rabbitmq
name: rabbitmq-service
namespace: {{ default "ci-go-runner" .Namespace }}
spec:
ports:
- name: rmq-client
port: 5672
- name: rmq-admin
port: 15672
selector:
app: taskQueue
component: rabbitmq
---
# The replication controller encapsulates the pod(s) used to run RabbitMQ
apiVersion: v1
kind: ReplicationController
metadata:
labels:
component: rabbitmq
name: rabbitmq-controller
namespace: {{ default "ci-go-runner" .Namespace }}
spec:
replicas: 1
template:
metadata:
labels:
app: taskQueue
component: rabbitmq
spec:
containers:
- image: rabbitmq
name: rabbitmq
ports:
- containerPort: 5672
- containerPort: 15672
resources:
limits:
cpu: 1
ephemeral-storage: "4Gi"
requests:
ephemeral-storage: "4Gi"
envFrom:
- configMapRef:
name: build-env
lifecycle:
postStart:
exec:
command:
- "/bin/bash"
- "-c"
- >
set -euo pipefail ;
IFS=$'\n\t' ;
echo "Starting the install of the management plugin" ;
sleep 30 ;
rabbitmq-plugins enable rabbitmq_management ;
apt-get -y update ; apt-get install -y wget python ;
wget -q -O /usr/local/bin/rabbitmqadmin http://localhost:15672/cli/rabbitmqadmin ;
chmod +x /usr/local/bin/rabbitmqadmin
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
# This name uniquely identifies the PVC. Will be used in deployment below.
name: minio-pv-claim
namespace: {{ default "ci-go-runner" .Namespace }}
labels:
app: minio-storage-claim
spec:
# Read more about access modes here: https://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes
accessModes:
- ReadWriteOnce
resources:
# This is the request for storage. Should be available in the cluster.
requests:
storage: 15Gi
# Uncomment and add storageClass specific to your requirements below. Read more https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class-1
#storageClassName:
---
apiVersion: apps/v1
kind: Deployment
metadata:
# This name uniquely identifies the Deployment
name: minio-deployment
namespace: {{ default "ci-go-runner" .Namespace }}
spec:
strategy:
type: Recreate
selector:
matchLabels:
app: minio
template:
metadata:
labels:
# Label is used as selector in the service.
app: minio
spec:
# Refer to the PVC created earlier
volumes:
- name: storage
persistentVolumeClaim:
# Name of the PVC created earlier
claimName: minio-pv-claim
containers:
- name: minio
# Pulls the default Minio image from Docker Hub
image: minio/minio
args:
- server
- /storage
envFrom:
- configMapRef:
name: build-env
ports:
- containerPort: 9000
# Mount the volume into the pod
volumeMounts:
- name: storage # must match the volume name, above
mountPath: "/storage"
---
apiVersion: v1
kind: Service
metadata:
name: minio-service
namespace: {{ default "ci-go-runner" .Namespace }}
spec:
type: LoadBalancer
ports:
- port: 9000
targetPort: 9000
protocol: TCP
selector:
app: minio
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
# This name uniquely identifies the PVC. Will be used in deployment below.
name: build-pv-claim
namespace: {{ default "ci-go-runner" .Namespace }}
labels:
app: build-storage-claim
spec:
# Read more about access modes here: https://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes
accessModes:
- ReadWriteMany
resources:
# This is the request for storage. Should be available in the cluster.
requests:
storage: 30Gi
# Uncomment and add storageClass specific to your requirements below. Read more https://kubernetes.io/docs/concepts/storage/persistent-volumes/#class-1
#storageClassName:
---
# Run the integration build as a deployment, the lifecycle will be dealt with by the CMD entry
apiVersion: apps/v1
kind: Deployment
metadata:
name: build
namespace: {{ default "ci-go-runner" .Namespace }}
labels:
keel.sh/policy: force
keel.sh/match-tag: "true"
keel.sh/trigger: poll
spec:
selector:
matchLabels:
# Label is used as selector in the service.
app: build
template:
metadata:
labels:
# Label is used as selector in the service.
app: build
spec:
automountServiceAccountToken: true
volumes:
- name: aws-sqs
secret:
optional: true
secretName: studioml-runner-aws-sqs
items:
- key: credentials
path: credentials
- key: config
path: config
- name: message-encryption
secret:
optional: false
secretName: studioml-runner-key-secret
items:
- key: ssh-privatekey
path: ssh-privatekey
- key: ssh-publickey
path: ssh-publickey
- name: encryption-passphrase
secret:
optional: false
secretName: studioml-runner-passphrase-secret
items:
- key: ssh-passphrase
path: ssh-passphrase
- name: queue-signing
secret:
optional: false
secretName: studioml-signing
- name: response-queue-signing
secret:
optional: false
secretName: studioml-report-keys
- name: build-storage
persistentVolumeClaim:
# Name of the PVC created earlier
claimName: build-pv-claim
- name: podinfo
downwardAPI:
items:
- path: "namespace"
fieldRef:
fieldPath: metadata.namespace
- path: "annotations"
fieldRef:
fieldPath: metadata.annotations
- path: "labels"
fieldRef:
fieldPath: metadata.labels
containers:
- name: build
env:
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
name: release-github-token
key: github_token
- name: K8S_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: K8S_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
envFrom:
- configMapRef:
name: build-env
image: {{ $branch := .duat.gitBranch | replace "/" "_" | replace "-" "_"}}{{ .Image | empty | ternary "quay.io/leafai/studio-go-runner-standalone-build:" ""}}{{ .Image | empty | ternary $branch .Image }}
imagePullPolicy: Always
resources:
limits:
memory: "6Gi"
cpu: 2
nvidia.com/gpu: {{ expandenv "$NVIDIA_VISIBLE_DEVICES" | empty | ternary "0" "2" }}
volumeMounts:
- name: build-storage # must match the volume name, above
mountPath: "/build"
- name: podinfo
mountPath: /etc/podinfo
readOnly: false
- name: aws-sqs
mountPath: "/runner/certs/aws-sqs/default"
readOnly: true
- name: message-encryption
mountPath: "/runner/certs/message/encryption"
readOnly: true
- name: encryption-passphrase
mountPath: "/runner/certs/message/passphrase"
readOnly: true
- name: queue-signing
mountPath: "/runner/certs/queues/signing"
readOnly: true
- name: response-queue-signing
mountPath: "/runner/certs/queues/reponse-encrypt"
readOnly: true
lifecycle:
postStart:
exec:
command:
- "/bin/bash"
- "-c"
- >
set -euo pipefail ;
IFS=$'\n\t' ;
echo "Starting the keel modifications" $K8S_POD_NAME ;
kubectl label deployment build keel.sh/policy- --namespace={{ default "ci-go-runner" .Namespace }} ;
kubectl scale --namespace {{ default "ci-go-runner" .Namespace }} --replicas=1 rc/rabbitmq-controller ;
kubectl scale --namespace {{ default "ci-go-runner" .Namespace }} --replicas=1 deployment/minio-deployment ;
curl -v --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt -H "Authorization: Bearer $(cat /var/runsecrets/kubernetes.io/serviceaccount/token)" https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_PORT_443_TCP_PORT/api/v1/namespaces/$K8S_NAMESPACE/pods/$K8S_POD_NAME
preStop:
exec:
command:
- "/bin/bash"
- "-c"
- >
set -euo pipefail ;
IFS=$'\n\t' ;
echo "Starting the namespace injections etc" $K8S_POD_NAME ;
kubectl label deployment build keel.sh/policy=force --namespace={{ default "ci-go-runner" .Namespace }} ;
kubectl scale --namespace {{ default "ci-go-runner" .Namespace }} --replicas=0 rc/rabbitmq-controller ;
kubectl scale --namespace {{ default "ci-go-runner" .Namespace }} --replicas=0 deployment/minio-deployment ;
for (( ; ; )) ;
do ;
sleep 10 ;
done