mirror of
https://github.com/hanzoai/gym.git
synced 2026-11-03 00:14:45 +00:00
The purpose-prefixed labels (hanzo-build-*, hanzo-deploy-*, hanzo-docs-build-*) are retired in favour of the bare <os>-<arch> every runner already advertises. They were not a capability, only a habit, and the habit cost builds: papers asked for hanzo-build-linux-amd64, no online runner offered it, and two idle linux-amd64 runners sat beside the queue while the build simply never ran. The lux tree lost three days to lux-linux-amd64 the same way. What a job is FOR is the workflow's name. runs-on is the machine it needs. Co-authored-by: Hanzo Dev <[email protected]>
70 lines
2.3 KiB
YAML
70 lines
2.3 KiB
YAML
# Build ghcr.io/hanzoai/gym from Dockerfile.cuda and push it. Nothing else.
|
|
#
|
|
# A `v*` tag publishes an image named after the tag; a push to main publishes
|
|
# an immutable sha-<7>. Only the first is deployable: which tag RUNS is a
|
|
# reviewed pin in hanzoai/universe (the ClusterTrainingRuntime for
|
|
# hanzo-ft-lora), never a CI side effect, and no floating tag is pushed.
|
|
#
|
|
# Same shape as hanzoai/kv and hanzoai/engine deploy.yml: the in-cluster
|
|
# git-runners advertise linux-amd64, and GHCR_USER / GHCR_TOKEN are
|
|
# hanzoai org secrets on git.hanzo.ai.
|
|
name: image
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ['v*']
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: image-gym-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: [linux-amd64]
|
|
timeout-minutes: 120
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- id: meta
|
|
run: |
|
|
case "$GITHUB_REF" in
|
|
refs/tags/v*) tag="${GITHUB_REF#refs/tags/}" ;;
|
|
*) tag="sha-$(echo "$GITHUB_SHA" | cut -c1-7)" ;;
|
|
esac
|
|
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
|
|
|
- uses: docker/setup-buildx-action@v3
|
|
with:
|
|
driver: docker-container
|
|
driver-opts: network=host
|
|
|
|
# Without this the push is unauthenticated and 403s at the registry.
|
|
- uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ secrets.GHCR_USER }}
|
|
password: ${{ secrets.GHCR_TOKEN }}
|
|
|
|
- uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile.cuda
|
|
platforms: linux/amd64
|
|
push: true
|
|
provenance: false
|
|
build-args: CUDA_COMPUTE_CAP=90
|
|
tags: ghcr.io/hanzoai/gym:${{ steps.meta.outputs.tag }}
|
|
|
|
# build-push-action can exit 0 before the manifest resolves, so a green run
|
|
# could still mean a future ImagePullBackOff. Prove it pulls.
|
|
- name: Verify the pushed image resolves
|
|
run: |
|
|
set -euo pipefail
|
|
img="ghcr.io/hanzoai/gym:${{ steps.meta.outputs.tag }}"
|
|
for i in 1 2 3 4 5 6; do
|
|
docker buildx imagetools inspect "$img" >/dev/null 2>&1 && { echo "resolved $img"; exit 0; }
|
|
sleep 5
|
|
done
|
|
echo "::error::pushed image never resolved: $img"; exit 1
|