Skip to content

Use backend initContainer migrations and remove Spin migration jobs#138

Merged
tomvothecoder merged 10 commits intoE3SM-Project:mainfrom
tomvothecoder:devops/117-safe-migration
Mar 12, 2026
Merged

Use backend initContainer migrations and remove Spin migration jobs#138
tomvothecoder merged 10 commits intoE3SM-Project:mainfrom
tomvothecoder:devops/117-safe-migration

Conversation

@tomvothecoder
Copy link
Collaborator

@tomvothecoder tomvothecoder commented Mar 11, 2026

Closes #117

This PR updates SimBoard’s NERSC Spin operational workflow to run Alembic migrations via a backend initContainer (rather than at backend startup) and consolidates Spin workload configuration into a single runbook.

Changes:

  • Add a Spin runbook documenting Rancher UI workload settings and initContainer
    migration flow.
  • Update CI/CD deployment docs to describe initContainer-based migrations and the
    new secret/env injection model (envFrom).
  • Simplify backend container startup to serve mode only (no startup-time
    migrations).

@tomvothecoder tomvothecoder force-pushed the devops/117-safe-migration branch from 1284aba to a28c20a Compare March 11, 2026 22:28
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a28c20a4c8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates SimBoard’s NERSC Spin operational workflow to run Alembic
migrations via a backend initContainer (rather than at backend startup) and
consolidates Spin workload configuration into a single runbook.

Changes:

  • Add a Spin runbook documenting Rancher UI workload settings and initContainer
    migration flow.
  • Update CI/CD deployment docs to describe initContainer-based migrations and the
    new secret/env injection model (envFrom).
  • Simplify backend container startup to serve mode only (no startup-time
    migrations).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
docs/deploy/spin.md New Spin runbook (Rancher UI settings, initContainer migrations, archive mount guidance).
docs/cicd/DEPLOYMENT.md Updates deployment guidance to reference initContainer migrations and Spin runbook.
docs/README.md Adds docs/deploy/spin.md to the docs structure and links.
backend/entrypoint.sh Removes migration-on-startup; supports serve mode only.
backend/app/scripts/README.md Updates scripts domain description for db/.
backend/Dockerfile Adds runtime env for uv cache location and HOME.

You can also share your feedback on Copilot code review. Take the survey.

| Init container name | `migrate` |
| Init container image | `registry.nersc.gov/e3sm/simboard/backend:<tag>` |
| Init container command | `sh -c` |
| Init container args | `test -n "$DATABASE_URL" \\|\\| { echo "DATABASE_URL is required"; exit 1; }; alembic upgrade head` |
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The initContainer command is shown with \\|\\| inside inline code. If an operator copy/pastes this, the shell will see literal \|\| and the command will fail. Consider moving the migration command out of the table into a fenced code block (or rewriting it without | so it can live safely in a table), and keep the actual shell operator as ||.

Copilot uses AI. Check for mistakes.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.


You can also share your feedback on Copilot code review. Take the survey.

@tomvothecoder tomvothecoder merged commit 936faec into E3SM-Project:main Mar 12, 2026
1 check passed
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.

[DevOps]: Production-Safe Alembic Migration Strategy (NERSC Spin)

2 participants