Automate Container Builds to NERSC Registry via GitHub Actions (Dev & Prod CI/CD)#97
Conversation
|
@copilot I also have a development frontend hosted at NERSC. Replicate the Docker dev build process but for the frontend. |
Added development frontend workflow in commit bf346ae. The new
All documentation updated to include the dev frontend workflow:
The workflow follows the same pattern as the backend dev workflow for consistency. |
|
@copilot Organize CI/CD docs under an appropriately named sub-directory. |
Organized CI/CD documentation under Changes:
The documentation is now better organized with a clear structure under the |
… deployment documentation Co-authored-by: tomvothecoder <25624127+tomvothecoder@users.noreply.github.com>
Co-authored-by: tomvothecoder <25624127+tomvothecoder@users.noreply.github.com>
Co-authored-by: tomvothecoder <25624127+tomvothecoder@users.noreply.github.com>
…hosted dev frontend Co-authored-by: tomvothecoder <25624127+tomvothecoder@users.noreply.github.com>
Co-authored-by: tomvothecoder <25624127+tomvothecoder@users.noreply.github.com>
425de82 to
86063d0
Compare
|
@copilot Simplify the cicd docs, there's too many pages. |
Co-authored-by: tomvothecoder <25624127+tomvothecoder@users.noreply.github.com>
Simplified CI/CD documentation in commit 0aa8c91. Consolidation:
New structure:
Merged content:
All essential information preserved, redundancy eliminated, and navigation simplified. |
|
@copilot Update DEPLOYMENT.md to remove kubectl references. I don't have access to those commands. I am using the Rancher UI service provided by NERSC Spin to manage services: https://rancher2.spin.nersc.gov/dashboard/home. |
Co-authored-by: tomvothecoder <25624127+tomvothecoder@users.noreply.github.com>
Replaced all Changes in both
|
There was a problem hiding this comment.
Pull request overview
This PR implements automated CI/CD pipelines for building and publishing multi-architecture Docker images to the NERSC container registry, with clear separation between development and production environments enforced via image tags and Kubernetes namespaces.
Changes:
- Added 4 GitHub Actions workflows: dev and prod builds for both backend and frontend, triggered automatically on main branch pushes (dev) or GitHub releases (prod)
- Consolidated 6 documentation files into 2 streamlined guides (docs/cicd/README.md and docs/cicd/DEPLOYMENT.md), achieving 63% reduction while maintaining completeness
- Updated main README.md with automated deployment information and manual build examples using proper tags
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/build-backend-dev.yml | Dev backend workflow: builds on main push, tags with :dev and :sha-, pushes to NERSC registry |
| .github/workflows/build-backend-prod.yml | Prod backend workflow: builds on release/tag, applies semantic versioning (:vX.Y.Z, :vX.Y, :vX, :latest) |
| .github/workflows/build-frontend-dev.yml | Dev frontend workflow: builds on main push with configurable VITE_API_BASE_URL, tags with :dev and :sha- |
| .github/workflows/build-frontend-prod.yml | Prod frontend workflow: builds on release/tag with production API URL, applies semantic versioning |
| docs/cicd/README.md | Quick start guide covering setup, workflows, release process, and deployment via Rancher UI |
| docs/cicd/DEPLOYMENT.md | Complete reference with detailed workflow descriptions, tagging strategy, deployment procedures, and troubleshooting |
| docs/README.md | New documentation index providing navigation to CI/CD guides |
| README.md | Updated deployment section with automated build information and manual build examples |
Comments suppressed due to low confidence (3)
.github/workflows/build-backend-prod.yml:10
- The workflow_dispatch trigger for production builds may not generate semantic version tags when manually triggered from a non-tag ref. The docker/metadata-action with type=semver patterns requires a tag context to work properly. Consider either: (1) removing workflow_dispatch from production workflows since production should only build from explicit releases/tags, or (2) adding a fallback tag strategy for manual builds (e.g., type=raw with a manual- prefix).
workflow_dispatch: {}
.github/workflows/build-frontend-prod.yml:15
- The workflow_dispatch trigger for production builds may not generate semantic version tags when manually triggered from a non-tag ref. The docker/metadata-action with type=semver patterns requires a tag context to work properly. Consider either: (1) removing workflow_dispatch from production workflows since production should only build from explicit releases/tags, or (2) adding a fallback tag strategy for manual builds.
workflow_dispatch:
inputs:
vite_api_base_url:
description: 'VITE_API_BASE_URL for the build'
required: false
default: 'https://simboard-api.e3sm.org'
README.md:298
- For consistency with the new CI/CD documentation, consider updating the Rancher Dashboard URL to use the more general path:
https://rancher2.spin.nersc.gov/dashboard/homeinstead of the cluster-specific path. The current cluster-specific URL may become outdated or inaccessible if cluster configurations change.
- **Rancher Dashboard:** <https://rancher2.spin.nersc.gov/dashboard/c/c-fwj56/explorer/apps.deployment>
Description
Implements automated multi-arch container builds to NERSC registry with dev/prod separation enforced via image tags and K8s namespaces.
Workflows (4 automated pipelines):
build-backend-dev.yml- Triggers onmainpush, tags:dev+:sha-<commit>build-frontend-dev.yml- Triggers onmainpush, tags:dev+:sha-<commit>(for NERSC-hosted dev frontend)build-backend-prod.yml- Triggers on releases/tags, semantic versioning (:vX.Y.Z,:vX.Y,:vX,:latest)build-frontend-prod.yml- Triggers on releases/tags, includes build-timeVITE_API_BASE_URLinjectionArchitecture:
Both dev frontend and backend are hosted on NERSC Spin with automated builds from
main. A Vercel-hosted dev frontend remains available for rapid prototyping.Registry:
registry.nersc.gov/e3sm/simboard/{backend,frontend}All workflows use Docker Buildx for
linux/amd64,linux/arm64with layer caching.All deployment instructions reference the Rancher UI for managing NERSC Spin services.
Documentation (streamlined under
docs/cicd/):docs/cicd/README.md- Quick start guide with setup steps and common operationsdocs/cicd/DEPLOYMENT.md- Complete reference with workflows, Rancher UI deployment steps, and troubleshootingdocs/README.md- Main documentation indexSimplification: Consolidated 6 documentation files (1694 lines) into 2 focused guides — 63% reduction — while preserving all essential information and eliminating redundancy.
Checklist
Deployment Notes (if any)
Required before workflows activate:
NERSC_REGISTRY_USERNAME,NERSC_REGISTRY_PASSWORDe3sm/simboard/namespaceNERSC Spin deployment updates (via Rancher UI):
registry.nersc.gov/e3sm/simboard/backend:devwith Pull PolicyAlwaysregistry.nersc.gov/e3sm/simboard/frontend:devwith Pull PolicyAlways:vX.Y.Z) with Pull PolicyIfNotPresentDocumentation:
docs/cicd/README.mddocs/cicd/DEPLOYMENT.mdOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.