tests: move the orchestrator scenarios next to the integration suites… #25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI - Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version tag to publish (e.g. v0.1.0). Leave empty to publish 'latest'." | |
| required: false | |
| default: "" | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| docker-build-and-push: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Single-platform (amd64) for both components: the platform is adopted | |
| # as a unit, and the snapshot-agent is x86_64-only today (cuda-checkpoint | |
| # binary + CGO build). Revisit both together when an aarch64 | |
| # cuda-checkpoint is available. | |
| - component: acceleratororchestrator | |
| dockerfile: docker/acceleratororchestrator/Dockerfile | |
| platforms: linux/amd64 | |
| - component: snapshot-agent | |
| dockerfile: docker/snapshot-agent/Dockerfile | |
| platforms: linux/amd64 | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v7 | |
| - name: Determine tag | |
| id: tag | |
| env: | |
| # Read via env, not template interpolation, so the input can't be | |
| # rendered into Bash source; validated as a Docker tag below. | |
| VERSION: ${{ github.event.inputs.version }} | |
| run: | | |
| if [[ -n "${VERSION}" && ! "${VERSION}" =~ ^[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}$ ]]; then | |
| echo "Invalid image tag: ${VERSION}" >&2 | |
| exit 1 | |
| fi | |
| if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" && -n "${VERSION}" ]]; then | |
| # Manual versioned release: publish only the requested tag, | |
| # leave 'latest' to main-branch builds. | |
| printf 'tag=%s\nprerelease=true\n' "${VERSION}" >> "$GITHUB_OUTPUT" | |
| else | |
| # Every main merge (and tag-less manual runs) publishes 'latest'. | |
| echo "tag=latest" >> "$GITHUB_OUTPUT" | |
| echo "prerelease=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| shell: bash | |
| - name: Build and push | |
| uses: ./.github/actions/docker-build-and-push | |
| with: | |
| image-name: ${{ matrix.component }} | |
| dockerfile: ${{ matrix.dockerfile }} | |
| platforms: ${{ matrix.platforms }} | |
| registry: ghcr.io/${{ github.repository }} | |
| tag: ${{ steps.tag.outputs.tag }} | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| prerelease: ${{ steps.tag.outputs.prerelease }} | |
| - name: Trivy security scan | |
| uses: ./.github/actions/trivy-scan | |
| with: | |
| image: ghcr.io/${{ github.repository }}/${{ matrix.component }}:${{ steps.tag.outputs.tag }} |