-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-jobs.yml
63 lines (62 loc) · 1.24 KB
/
test-jobs.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
---
apiVersion: batch/v1
kind: Job
metadata:
name: succeeds
labels:
k8s-emailer.hpc.nyu.edu/mode: "all"
annotations:
k8s-emailer.hpc.nyu.edu/addresses: "[email protected]"
spec:
backoffLimit: 6
template:
spec:
containers:
- name: job
image: python:3.10
args: ["true"]
restartPolicy: Never
---
apiVersion: batch/v1
kind: Job
metadata:
name: retries
labels:
k8s-emailer.hpc.nyu.edu/mode: "all"
annotations:
k8s-emailer.hpc.nyu.edu/addresses: "[email protected]"
spec:
backoffLimit: 100
template:
spec:
containers:
- name: job
image: python:3.10
args:
- python
- -c
- |
import os
import random
# Succeed 10% of the time
if random.random() > 0.1:
os.exit(1)
restartPolicy: Never
---
apiVersion: batch/v1
kind: Job
metadata:
name: fails
labels:
k8s-emailer.hpc.nyu.edu/mode: "all"
annotations:
k8s-emailer.hpc.nyu.edu/addresses: "[email protected]"
spec:
backoffLimit: 2
template:
spec:
containers:
- name: job
image: python:3.10
args: ["false"]
restartPolicy: Never