Skip to content

Commit

Permalink
score pages on cron (ZcashFoundation#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
skyl authored Jan 9, 2023
1 parent 3ec2d12 commit e466712
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions k8s/free2z/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ k8s_objects(
":service",
":deployment",
"//k8s/free2z/cron:renew_subs",
"//k8s/free2z/cron:score_pages",
"//k8s/free2z/cron:set_can_stream",
"//k8s/free2z/sub:tweet_comments",
],
Expand Down
10 changes: 10 additions & 0 deletions k8s/free2z/cron/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ k8s_deploy(
kind = "CronJob",
template = ":set_can_stream.yaml",
)

# TODO: we could do one cronjob with a template
k8s_deploy(
name = "score_pages",
images = {
"gcr.io/free2z/free2z:latest": "//k8s/free2z:container",
},
kind = "CronJob",
template = ":score_pages.yaml",
)
31 changes: 31 additions & 0 deletions k8s/free2z/cron/score_pages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: score-pages
spec:
# every minute
schedule: "* * * * *"
concurrencyPolicy: Forbid
jobTemplate:
spec:
backoffLimit: 333
template:
spec:
serviceAccountName: free2z-db
restartPolicy: OnFailure
containers:
- name: score-pages
image: gcr.io/free2z/free2z:latest
resources:
limits:
memory: 1000Mi
requests:
memory: 100Mi
args:
- "/py/dj/free2z/manage.py"
- "score_pages"
envFrom:
- configMapRef:
name: free2z
- secretRef:
name: free2z

0 comments on commit e466712

Please sign in to comment.