Skip to content

Conversation

Copy link

Copilot AI commented Dec 30, 2025

Description

Adds a Kubernetes CronJob that syncs MongoDB production data to non-production environments by downloading the latest private dump from GCS and restoring it to the target database.

Code Changes

  • helm-chart/sefaria/templates/cronjob/sync-mongo-production-data.yaml: New CronJob template

    • Init container downloads latest private_dump_*.tar.gz from gs://sefaria-mongo-backup/ (excludes private_dump_small_*)
    • Main container restores dump via mongorestore --drop
    • Schedule: 30 12 * * * (daily at 12:30 PM)
    • Safety: Only creates when restore.enabled && cronJobs.syncMongoProductionData.enabled
    • Node affinity prefers non-preemptible nodes
    • Resource limits: 500m CPU request, 1Gi memory limit
  • helm-chart/sefaria/values.yaml: Added cronJobs.syncMongoProductionData.enabled: false

Notes

Disabled by default. Requires service account with GCS bucket read access (restore.serviceAccount). Uses GCS timestamps for reliable latest-backup detection.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix issues based on feedback for Mongo production sync Add MongoDB production data sync CronJob for non-production environments Dec 30, 2025
Copilot AI requested a review from yodem December 30, 2025 13:14
@yodem yodem closed this Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants