Skip to content

Potential Migration to GCP Cloud Functions 2nd Gen #8

@bachtran02

Description

@bachtran02

Potential Migration to GCP Cloud Functions 2nd Gen

Background

The current Gen 1 implementation requires maintaining three separate instances of the same repository to handle:

  • handle_form_submit
  • handle_email_queue
  • handle_flush_gradescope

These functions are stateless and are invoked by a Google Sheets App Script using function signatures.

Current Gen 1 functions only support pulling code from Cloud Source Repository or from the inline editor. While it is **possible** for Cloud Source repo to mirror GitHub repository (which could potentially in roadmap to synchronize the codebases), there is no support for continuous deployment, which means we still have manually re-deploy 3 functions to run latest code after sync.

Proposed Migration

Migrating to Cloud Functions 2nd Gen, which supports HTTP server frameworks, would allow us to consolidate all three functions into a single long-lived service container. Key benefits include:

  • Single Service: Maintain one deployment instead of three separate instances.
  • Docker Support: Enables continuous build & deployment on new commits to GitHub repository.

Non-Exhaustive To-Do List

  • Implement a global HTTP listener to handle all three function requests.
  • Modify the Google Sheets App Script to call the new HTTP endpoints correctly.
  • Explore making the code stateful while ensuring isolation between function calls from different spreadsheets.
  • Create a Dockerfile to enable continuous deployment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions