Skip to content

Commit 44737d3

Browse files
committed
extract k7s job templates
Signed-off-by: Javan Lacerda <javanlacerda@google.com>
1 parent 7d4f883 commit 44737d3

9 files changed

Lines changed: 462 additions & 347 deletions

File tree

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ google-cloud-secret-manager = "==2.17.0"
1818
google-cloud-logging = "==3.6.0"
1919
google-cloud-monitoring = "==2.15.1"
2020
google-cloud-datastore = "==2.16.1"
21+
Jinja2 = "==3.1.2"
2122
oauth2client = "==4.1.3"
2223
requests = "==2.21.0"
2324
PyYAML = "==6.0"

Pipfile.lock

Lines changed: 159 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Pipfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ google-crc32c = "==1.5.0"
2727
grpcio = "==1.62.2"
2828
httplib2 = "==0.19.0"
2929
jira = "==2.0.0"
30+
Jinja2 = "==3.1.4"
3031
kubernetes = "==34.1.0"
3132
mozprocess = "==1.3.1"
3233
oauth2client = "==4.1.3"
@@ -50,8 +51,7 @@ charset-normalizer = "==3.3.2"
5051
firebase-admin = "==6.2.0"
5152
Flask = "==2.2.2"
5253
itsdangerous = "==2.0.1"
53-
Jinja2 = "==3.1.4"
54-
PyJWT = "==2.7.0"
54+
pyjwt = "==2.7.0"
5555
requests-toolbelt = "==0.9.1"
5656
werkzeug = "==2.2.2"
5757
parameterized = "==0.9.0"

src/Pipfile.lock

Lines changed: 123 additions & 82 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
apiVersion: batch/v1
15+
kind: Job
16+
metadata:
17+
name: "{{job_name}}"
18+
spec:
19+
activeDeadlineSeconds: {{active_deadline_seconds}}
20+
template:
21+
spec:
22+
serviceAccountName: "{{service_account_name}}"
23+
containers:
24+
- name: "{{job_name}}"
25+
image: "{{docker_image}}"
26+
imagePullPolicy: IfNotPresent
27+
env:
28+
- name: HOST_UID
29+
value: '1337'
30+
- name: CLUSTERFUZZ_RELEASE
31+
value: "{{clusterfuzz_release}}"
32+
- name: UNTRUSTED_WORKER
33+
value: 'False'
34+
- name: UWORKER
35+
value: 'True'
36+
- name: USE_GCLOUD_STORAGE_RSYNC
37+
value: '1'
38+
- name: UWORKER_INPUT_DOWNLOAD_URL
39+
value: "{{input_url}}"
40+
- name: IS_K8S_ENV
41+
value: 'true'
42+
- name: DISABLE_MOUNTS
43+
value: 'true'
44+
- name: UPDATE_WEB_TESTS
45+
value: 'False'
46+
securityContext:
47+
privileged: true
48+
capabilities:
49+
add:
50+
- ALL
51+
volumeMounts:
52+
- mountPath: /dev/shm
53+
name: dshm
54+
volumes:
55+
- name: dshm
56+
emptyDir:
57+
medium: Memory
58+
sizeLimit: 1.9Gi
59+
restartPolicy: Never
60+
backoffLimit: 0
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
apiVersion: batch/v1
15+
kind: Job
16+
metadata:
17+
name: "{{job_name}}"
18+
spec:
19+
activeDeadlineSeconds: {{active_deadline_seconds}}
20+
template:
21+
metadata:
22+
labels:
23+
app.kubernetes.io/name: clusterfuzz-kata-job
24+
spec:
25+
runtimeClassName: kata
26+
serviceAccountName: "{{service_account_name}}"
27+
dnsPolicy: ClusterFirstWithHostNet
28+
containers:
29+
- name: "{{job_name}}"
30+
image: "{{docker_image}}"
31+
imagePullPolicy: IfNotPresent
32+
lifecycle:
33+
postStart:
34+
exec:
35+
command:
36+
- /bin/sh
37+
- -c
38+
- mkdir -p /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix
39+
securityContext:
40+
privileged: true
41+
capabilities:
42+
add:
43+
- ALL
44+
resources:
45+
requests:
46+
cpu: '2'
47+
memory: 3.75Gi
48+
limits:
49+
cpu: '2'
50+
memory: 3.75Gi
51+
env:
52+
- name: HOST_UID
53+
value: '1337'
54+
- name: CLUSTERFUZZ_RELEASE
55+
value: "{{clusterfuzz_release}}"
56+
- name: UNTRUSTED_WORKER
57+
value: 'False'
58+
- name: UWORKER
59+
value: 'True'
60+
- name: USE_GCLOUD_STORAGE_RSYNC
61+
value: '1'
62+
- name: UWORKER_INPUT_DOWNLOAD_URL
63+
value: "{{input_url}}"
64+
- name: IS_K8S_ENV
65+
value: 'true'
66+
- name: DISABLE_MOUNTS
67+
value: 'true'
68+
- name: UPDATE_WEB_TESTS
69+
value: 'False'
70+
restartPolicy: Never
71+
volumes:
72+
- name: dshm
73+
emptyDir:
74+
medium: Memory
75+
sizeLimit: 1.9Gi
76+
nodeSelector:
77+
cloud.google.com/gke-nodepool: kata-enabled-pool
78+
backoffLimit: 0

0 commit comments

Comments
 (0)