-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmpi-operator.yaml
425 lines (425 loc) · 10.5 KB
/
mpi-operator.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
421
422
423
424
425
# --------------------------------------------------
# - Single configuration deployment YAML for MPI-Operator
# - Include:
# CRD deployment
# Namespace deployment
# RBAC deployment
# MPI-operator container deployment set
# --------------------------------------------------
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: mpijobs.kubeflow.org
spec:
group: kubeflow.org
versions:
- name: v1alpha2
schema:
openAPIV3Schema:
properties:
spec:
properties:
mpiReplicaSpecs:
properties:
Launcher:
properties:
replicas:
maximum: 1
minimum: 1
type: integer
type: object
x-kubernetes-preserve-unknown-fields: true
Worker:
properties:
replicas:
minimum: 1
type: integer
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
slotsPerWorker:
minimum: 1
type: integer
type: object
x-kubernetes-preserve-unknown-fields: true
status:
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
served: true
storage: false
subresources:
status: {}
- name: v1
schema:
openAPIV3Schema:
properties:
spec:
properties:
mpiReplicaSpecs:
properties:
Launcher:
properties:
replicas:
maximum: 1
minimum: 1
type: integer
type: object
x-kubernetes-preserve-unknown-fields: true
Worker:
properties:
replicas:
minimum: 1
type: integer
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
slotsPerWorker:
minimum: 1
type: integer
type: object
x-kubernetes-preserve-unknown-fields: true
status:
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
served: true
storage: false
subresources:
status: {}
- name: v2beta1
schema:
openAPIV3Schema:
properties:
spec:
properties:
mpiImplementation:
enum:
- OpenMPI
- Intel
type: string
mpiReplicaSpecs:
properties:
Launcher:
properties:
replicas:
maximum: 1
minimum: 1
type: integer
restartPolicy:
enum:
- Never
- OnFailure
type: string
template:
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
Worker:
properties:
replicas:
minimum: 1
type: integer
restartPolicy:
enum:
- Never
- OnFailure
type: string
template:
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
required:
- Launcher
type: object
runPolicy:
properties:
activeDeadlineSeconds:
description: |
Defines the duration in seconds, relative to its start time, that the launcher
Job may be active before the system tries to terminate it. Defaults to infinite.
minimum: 0
type: integer
backoffLimit:
description: Specifies the number of retries before marking the
launcher Job as failed. Defaults to 6.
minimum: 0
type: integer
cleanPodPolicy:
description: Defines which worker Pods must be deleted after the
Job completes
enum:
- None
- Running
- All
type: string
ttlSecondsAfterFinished:
description: |
Defines the TTL to clean up the launcher Job.
Defaults to infinite. Requires kubernetes 1.21+.
minimum: 0
type: integer
type: object
slotsPerWorker:
minimum: 1
type: integer
sshAuthMountPath:
type: string
type: object
status:
properties:
completionTime:
format: date-time
type: string
conditions:
items:
properties:
lastTransitionTime:
format: date-time
type: string
lastUpdateTime:
format: date-time
type: string
message:
type: string
reason:
type: string
status:
enum:
- "True"
- "False"
- Unknown
type: string
type:
enum:
- Created
- Running
- Restarting
- Succeeded
- Failed
type: string
type: object
type: array
lastReconcileTime:
format: date-time
type: string
replicaStatuses:
properties:
Launcher:
properties:
active:
type: integer
failed:
type: integer
succeeded:
type: integer
type: object
Worker:
properties:
active:
type: integer
failed:
type: integer
succeeded:
type: integer
type: object
type: object
startTime:
format: date-time
type: string
type: object
type: object
served: true
storage: true
subresources:
status: {}
scope: Namespaced
names:
plural: mpijobs
singular: mpijob
kind: MPIJob
shortNames:
- mj
- mpij
subresources:
status: {}
validation:
openAPIV3Schema:
properties:
spec:
properties:
slotsPerWorker:
type: integer
minimum: 1
mpiReplicaSpecs:
properties:
Launcher:
properties:
replicas:
type: integer
minimum: 1
maximum: 1
Worker:
properties:
replicas:
type: integer
minimum: 1
---
apiVersion: v1
kind: Namespace
metadata:
name: mpi-operator
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: mpi-operator
rules:
- apiGroups:
- ""
resources:
- configmaps
- serviceaccounts
verbs:
- create
- list
- watch
# This is needed for the launcher Role.
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- list
- watch
# This is needed for the launcher Role.
- apiGroups:
- ""
resources:
- pods/exec
verbs:
- create
- apiGroups:
- ""
resources:
- endpoints
verbs:
- create
- get
- update
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- rbac.authorization.k8s.io
resources:
- roles
- rolebindings
verbs:
- create
- list
- watch
- apiGroups:
- policy
resources:
- poddisruptionbudgets
verbs:
- create
- list
- update
- watch
- apiGroups:
- apps
resources:
- statefulsets
verbs:
- create
- list
- update
- watch
- apiGroups:
- batch
resources:
- jobs
verbs:
- create
- list
- update
- watch
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- create
- get
- apiGroups:
- kubeflow.org
resources:
- mpijobs
- mpijobs/finalizers
- mpijobs/status
verbs:
- "*"
- apiGroups:
- scheduling.incubator.k8s.io
- scheduling.sigs.dev
resources:
- queues
- podgroups
verbs:
- "*"
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: mpi-operator
namespace: mpi-operator
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: mpi-operator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: mpi-operator
subjects:
- kind: ServiceAccount
name: mpi-operator
namespace: mpi-operator
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mpi-operator
namespace: mpi-operator
labels:
app: mpi-operator
spec:
replicas: 1
selector:
matchLabels:
app: mpi-operator
template:
metadata:
labels:
app: mpi-operator
spec:
serviceAccountName: mpi-operator
containers:
- name: mpi-operator
image: mpioperator/mpi-operator:latest
command: ["/opt/mpi-operator.v1alpha2"]
args: [
"-alsologtostderr",
"--kubectl-delivery-image",
"mpioperator/kubectl-delivery:latest"
]
imagePullPolicy: Always