Repository navigation
Publish client image #8
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
| # Manually-triggered build+push of the endpoints client image to GHCR. | |
| # | |
| # Run it from the Actions tab ("Run workflow"): pick the branch/tag in the UI (that | |
| # selection is github.sha), or type an explicit SHA/branch/tag in the `ref` input. | |
| # The image is pushed to ghcr.io/mlcommons/endpoints tagged with the short commit | |
| # SHA and the ref name, using the automatic GITHUB_TOKEN (no stored secret needed). | |
| name: Publish client image | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| description: "Git ref to build (branch/tag/SHA). Blank = the ref selected above." | |
| required: false | |
| type: string | |
| platforms: | |
| description: "Target platform(s)" | |
| required: true | |
| default: linux/amd64 | |
| type: choice | |
| options: | |
| - linux/amd64 | |
| - linux/amd64,linux/arm64 | |
| provision_dsr1: | |
| description: "Bake in the DeepSeek-R1 accuracy evaluator (heavier; needs build-time network)" | |
| required: true | |
| default: "1" | |
| type: choice | |
| options: | |
| - "1" | |
| - "0" | |
| provision_vbench: | |
| description: "Bake in the WAN 2.2 VBench accuracy scorer (heavier; downloads AMT/RAFT/RAM weights at build time)" | |
| required: true | |
| default: "1" | |
| type: choice | |
| options: | |
| - "1" | |
| - "0" | |
| no_cache: | |
| description: "Build with --no-cache (clean/reproducible, slower)" | |
| required: true | |
| default: "true" | |
| type: choice | |
| options: | |
| - "true" | |
| - "false" | |
| force: | |
| description: "Overwrite an existing :<sha> tag. platform/DSR1/cache are NOT part of the tag, so the first successful publish of a SHA wins; use force to re-publish a SHA (e.g. a different arch, or a failed run)." | |
| required: true | |
| default: "false" | |
| type: choice | |
| options: | |
| - "false" | |
| - "true" | |
| # GITHUB_TOKEN needs packages:write to push to the org's GHCR package. | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout selected ref | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| # Check out the ref *name* (not github.sha) so a local branch head exists | |
| # and the script can resolve/tag it; blank input falls back to the | |
| # dispatched branch/tag. Full history for `git rev-parse --short`. | |
| ref: ${{ inputs.ref || github.ref_name }} | |
| fetch-depth: 0 | |
| # Registers QEMU binfmt handlers so the docker-container builder can build | |
| # the non-native arch when platforms includes linux/arm64. | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 | |
| # Logs in as the user who triggered the run; the password is this run's | |
| # automatic GITHUB_TOKEN (scoped by the permissions block above). | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| env: | |
| ENDPOINTS_REF: ${{ inputs.ref || github.ref_name }} | |
| PLATFORM: ${{ inputs.platforms }} | |
| PROVISION_DSR1: ${{ inputs.provision_dsr1 }} | |
| PROVISION_VBENCH: ${{ inputs.provision_vbench }} | |
| NO_CACHE: ${{ inputs.no_cache == 'true' && '1' || '0' }} | |
| # Fixed flag or empty — the input value itself is never interpolated into the command. | |
| FORCE_FLAG: ${{ inputs.force == 'true' && '--force' || '' }} | |
| run: ./scripts/push_docker_image.sh $FORCE_FLAG |