Skip to content

Add Support for Cloud Run Jobs #1965

@Mephistic

Description

@Mephistic

Problem

When we run one-off scripts, we currently have to do it against a dev's local machine. This leads to a number of recurring, preventable issues - ranging from auth differences between local dev and deployed instances to resource issues with personal machines to simple environment inconsistency. There is also no permanent record of a job's results after it's been run, making it difficult to track the state of various backfills.

To make these tasks more robust, we should move from running these scripts locally to running them in a Google Cloud Run environment - this will let us run one-off scripts with a similar architecture to our existing Firebase Functions.

Success Criteria

  • New package/directory for Cloud Run jobs
  • Example Cloud Run job that has the same feature access as the current scripts in the scripts folder:
    • Connect to Firebase Admin Firestore
    • Connect to Firebase Admin Storage
    • Connect to Firebase Admin Auth
    • Logs some text to the console
      • We might end up using something like this as a healthcheck down the road
  • Add a Github Action to deploy the Cloud Run packages on changes
    • If this is difficult, bring it to the group and we can discuss alternatives
  • Job should run on both DEV and PROD

Additional Notes

  • Don't worry about migrating our existing backfill scripts to the new system - we can just consider those deprecated and use Cloud Run jobs moving forward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CI/CDGitHub Actions, deployments, or build pipeline stuffReady for DevelopmentAutomatically assigned to issues that are ready to be picked upbackendBackend DevelopmentenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions