Skip to content

Commit 658fe21

Browse files
Prepare second importer cronjob for production (#2194)
Increase run frequency to 3 hourly
1 parent 8d46f95 commit 658fe21

File tree

6 files changed

+55
-21
lines changed

6 files changed

+55
-21
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
apiVersion: batch/v1
2+
kind: CronJob
3+
metadata:
4+
name: importer-deleter
5+
spec:
6+
schedule: "* */3 * * *"
7+
concurrencyPolicy: Forbid
8+
jobTemplate:
9+
spec:
10+
template:
11+
spec:
12+
containers:
13+
- name: importer-deleter
14+
image: importer
15+
imagePullPolicy: Always
16+
volumeMounts:
17+
- mountPath: "/work"
18+
name: "ssd"
19+
securityContext:
20+
privileged: true
21+
resources:
22+
requests:
23+
cpu: 1
24+
memory: "10G"
25+
limits:
26+
cpu: 1
27+
memory: "11G"
28+
restartPolicy: OnFailure
29+
volumes:
30+
- name: "ssd"
31+
hostPath:
32+
path: "/mnt/disks/ssd0"

deployment/clouddeploy/gke-workers/base/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ resources:
22
- workers.yaml
33
- scaler.yaml
44
- importer.yaml
5+
- importer-deleter.yaml
56
- exporter.yaml
67
- alpine-cve-convert.yaml
78
- combine-to-osv.yaml

deployment/clouddeploy/gke-workers/environments/oss-vdb-test/importer-deleter.yaml

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ kind: CronJob
33
metadata:
44
name: importer-deleter
55
spec:
6-
schedule: "* */6 * * *"
7-
concurrencyPolicy: Forbid
86
jobTemplate:
97
spec:
108
template:
@@ -19,21 +17,3 @@ spec:
1917
- --delete
2018
- --delete_threshold_pct=20
2119
- --public_log_bucket=osv-test-public-import-logs
22-
imagePullPolicy: Always
23-
volumeMounts:
24-
- mountPath: "/work"
25-
name: "ssd"
26-
securityContext:
27-
privileged: true
28-
resources:
29-
requests:
30-
cpu: 1
31-
memory: "10G"
32-
limits:
33-
cpu: 1
34-
memory: "11G"
35-
restartPolicy: OnFailure
36-
volumes:
37-
- name: "ssd"
38-
hostPath:
39-
path: "/mnt/disks/ssd0"

deployment/clouddeploy/gke-workers/environments/oss-vdb-test/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
resources:
22
- ../../base
33
- debian-cve-convert.yaml
4-
- importer-deleter.yaml
54
patches:
65
- path: workers.yaml
76
- path: scaler.yaml
87
- path: importer.yaml
8+
- path: importer-deleter.yaml
99
- path: exporter.yaml
1010
- path: alpine-cve-convert.yaml
1111
- path: combine-to-osv.yaml
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: batch/v1
2+
kind: CronJob
3+
metadata:
4+
name: importer-deleter
5+
spec:
6+
suspend: true
7+
jobTemplate:
8+
spec:
9+
template:
10+
spec:
11+
containers:
12+
- name: importer-deleter
13+
env:
14+
- name: GOOGLE_CLOUD_PROJECT
15+
value: oss-vdb
16+
image: importer
17+
args:
18+
- --delete
19+
- --delete_threshold_pct=20
20+
- --public_log_bucket=osv-public-import-logs

deployment/clouddeploy/gke-workers/environments/oss-vdb/kustomization.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ resources:
55
patches:
66
- path: workers.yaml
77
- path: importer.yaml
8+
- path: importer-deleter.yaml
89
- path: exporter.yaml
910
- path: alpine-cve-convert.yaml
1011
- path: combine-to-osv.yaml

0 commit comments

Comments
 (0)