-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run import job in as Kubernetes CronJob
Instead of running the import job as a cron script on a random EC2 VM, run it as an actual CronJob in Kubernetes with everything else. This also cleans up the docs around jobs. Work not visible here: created a new IAM account for jobs that can write to relevant S3 buckets, added ability to store cache files in S3 (edgi-govdata-archiving/web-monitoring-processing#849) since we have no persistent storage in Kubernetes. Why do this now? See: - edgi-govdata-archiving/web-monitoring#168 - edgi-govdata-archiving/web-monitoring-processing#757
- Loading branch information
Showing
7 changed files
with
83 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,4 @@ spec: | |
valueFrom: | ||
secretKeyRef: | ||
name: job-secrets | ||
key: healthcheck_sentry_dsn | ||
key: healthcheck_sentry_dsn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: ia-import-job | ||
namespace: production | ||
spec: | ||
# FIXME: schedule *should* be "30 3 * * *". Current schedule is a test. | ||
# schedule: "30 3 * * *" | ||
schedule: "20 18 * * *" | ||
jobTemplate: | ||
spec: | ||
template: | ||
spec: | ||
restartPolicy: Never | ||
# Kill after 12 hours. Sometimes it gets stuck! | ||
activeDeadlineSeconds: 43200 | ||
containers: | ||
- name: ia-import-job | ||
image: envirodgi/processing:latest | ||
command: [ | ||
"scripts/wm", | ||
"import", | ||
"ia-known-pages", | ||
"--parallel", "10", | ||
"--unplaybackable", "s3://edgi-wm-db-internal/importer-unplaybackable-cache.json", | ||
"--precheck", | ||
# The last 7 days | ||
"--from", "168" | ||
] | ||
imagePullPolicy: Always | ||
resources: | ||
requests: | ||
memory: "256Mi" | ||
cpu: "100m" | ||
limits: | ||
memory: "1024Mi" | ||
cpu: "1500m" | ||
env: | ||
- name: WEB_MONITORING_DB_EMAIL | ||
valueFrom: | ||
secretKeyRef: | ||
name: job-secrets | ||
key: import_db_email | ||
- name: WEB_MONITORING_DB_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: job-secrets | ||
key: import_db_password | ||
- name: WAYBACK_RATE_LIMIT | ||
value: "10" | ||
- name: AWS_ACCESS_KEY_ID | ||
valueFrom: | ||
secretKeyRef: | ||
name: job-secrets | ||
key: aws_access_key_id | ||
- name: AWS_SECRET_ACCESS_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
name: job-secrets | ||
key: aws_secret_access_key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters