codeforboston / codeforboston/maple

Add Support for Cloud Run Jobs

Open
#1,965 0 comments 0 reactions 0 assignees View on GitHub
backend CI/CD enhancement Ready for Development
Dominant language
TypeScript
Stars
56
Forks
175
Avg merge
2d 5h
Merged PRs (30d)
13

Description

## 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.