Skip to content

Commit

Permalink
Prepare second importer cronjob for production (#2194)
Browse files Browse the repository at this point in the history
Increase run frequency to 3 hourly
  • Loading branch information
andrewpollock committed May 13, 2024
1 parent 8d46f95 commit 658fe21
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 21 deletions.
32 changes: 32 additions & 0 deletions deployment/clouddeploy/gke-workers/base/importer-deleter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: importer-deleter
spec:
schedule: "* */3 * * *"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
containers:
- name: importer-deleter
image: importer
imagePullPolicy: Always
volumeMounts:
- mountPath: "/work"
name: "ssd"
securityContext:
privileged: true
resources:
requests:
cpu: 1
memory: "10G"
limits:
cpu: 1
memory: "11G"
restartPolicy: OnFailure
volumes:
- name: "ssd"
hostPath:
path: "/mnt/disks/ssd0"
1 change: 1 addition & 0 deletions deployment/clouddeploy/gke-workers/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resources:
- workers.yaml
- scaler.yaml
- importer.yaml
- importer-deleter.yaml
- exporter.yaml
- alpine-cve-convert.yaml
- combine-to-osv.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ kind: CronJob
metadata:
name: importer-deleter
spec:
schedule: "* */6 * * *"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
Expand All @@ -19,21 +17,3 @@ spec:
- --delete
- --delete_threshold_pct=20
- --public_log_bucket=osv-test-public-import-logs
imagePullPolicy: Always
volumeMounts:
- mountPath: "/work"
name: "ssd"
securityContext:
privileged: true
resources:
requests:
cpu: 1
memory: "10G"
limits:
cpu: 1
memory: "11G"
restartPolicy: OnFailure
volumes:
- name: "ssd"
hostPath:
path: "/mnt/disks/ssd0"
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
resources:
- ../../base
- debian-cve-convert.yaml
- importer-deleter.yaml
patches:
- path: workers.yaml
- path: scaler.yaml
- path: importer.yaml
- path: importer-deleter.yaml
- path: exporter.yaml
- path: alpine-cve-convert.yaml
- path: combine-to-osv.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: importer-deleter
spec:
suspend: true
jobTemplate:
spec:
template:
spec:
containers:
- name: importer-deleter
env:
- name: GOOGLE_CLOUD_PROJECT
value: oss-vdb
image: importer
args:
- --delete
- --delete_threshold_pct=20
- --public_log_bucket=osv-public-import-logs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ resources:
patches:
- path: workers.yaml
- path: importer.yaml
- path: importer-deleter.yaml
- path: exporter.yaml
- path: alpine-cve-convert.yaml
- path: combine-to-osv.yaml
Expand Down

0 comments on commit 658fe21

Please sign in to comment.