Files
hermes-agent/.github/workflows/sandbox-image.yml
Teknium 5b147ab036 fix(ci): Docker manifest-list jobs run on GitHub-hosted runners again
Every job that only assembles or promotes Docker Hub manifest lists with
`imagetools create` (docker.yml merge + release-publish-manifest,
sandbox-image.yml merge, the stable-release `complete` and publication
`reconcile` alias promotions) moved to Blacksmith in 91fae5f8cb. Since then
the index commit to Docker Hub fails every time:

  failed commit on ref "index-sha256:...": unexpected status from GET request
  to https://registry-1.docker.io:443/v2/.../manifests/rc.4-v0.22.3: 404 Not Found

It is not the buildx version: rc.4 ran buildx v0.38.1 (after 6932521f25) and
failed identically to rc.1-rc.3 on v0.23.0, while v0.22.2 published on
ubuntu-latest with docker/setup-buildx-action. Restore exactly that setup
(runner, checkout, setup-buildx-action pinned to the pre-migration SHAs) for
these five jobs; builds and per-arch pushes stay on Blacksmith.
2026-10-21 04:14:29 -07:00

187 lines
7.0 KiB
YAML

name: Sandbox desktop image
# nousresearch/hermes-sandbox:desktop is the terminal-backend sandbox base
# (nikolaik/python-nodejs) plus a display stack; Bot Screen, computer_use and
# the bot's browser run inside it when terminal.backend is docker/ssh/etc.
# It contains NO Hermes code, so it does not need to track main: it changes
# when its Dockerfile changes, not when the agent changes.
#
# Triggers: a PR that edits the Dockerfile/smoke (build + smoke, no push),
# a release (publish :<tag>-desktop and roll :desktop), and manual dispatch.
# Deliberately NOT on every main push: two 4 GB multi-arch builds per commit
# for an image that changes a few times a year.
on:
pull_request:
paths:
- docker/sandbox-desktop.Dockerfile
- docker/sandbox-desktop-smoke.sh
- .github/workflows/sandbox-image.yml
release:
types: [published]
workflow_dispatch:
inputs:
publish:
description: Push to Docker Hub (rolls :desktop)
type: boolean
default: false
permissions:
contents: read
concurrency:
group: sandbox-image-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
IMAGE_NAME: nousresearch/hermes-sandbox
jobs:
# PR code: secret-free build + smoke per arch.
build:
if: github.repository == 'NousResearch/hermes-agent'
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
runner: blacksmith-32vcpu-ubuntu-2404
platform: linux/amd64
- arch: arm64
runner: blacksmith-32vcpu-ubuntu-2404-arm
platform: linux/arm64
runs-on: ${{ matrix.runner }}
timeout-minutes: 45
steps:
- uses: useblacksmith/checkout@25227e61ff9dafe400e22fa487b673eac4e4409a # v1
- name: Set up Docker Buildx
uses: useblacksmith/setup-docker-builder@19215110ab936351210feebdfa5b440b4493e184 # v2
- name: Build (${{ matrix.arch }})
uses: useblacksmith/build-push-action@9b0579bbec7a6cad2f171596c57e7ac1e7658850 # v2
with:
context: .
file: docker/sandbox-desktop.Dockerfile
platforms: ${{ matrix.platform }}
tags: ${{ env.IMAGE_NAME }}:test
load: true
cache-from: type=gha,scope=sandbox-${{ matrix.arch }}
cache-to: ${{ github.event_name != 'pull_request' && format('type=gha,mode=max,scope=sandbox-{0}', matrix.arch) || '' }}
# The contract: the launcher, cua-driver and a headed Chromium work as `pn`.
- name: Smoke
run: docker/sandbox-desktop-smoke.sh ${{ env.IMAGE_NAME }}:test
# Trusted source only; the sole Docker Hub credential boundary.
publish:
if: github.repository == 'NousResearch/hermes-agent' && (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.publish))
needs: [build]
environment: container-publish
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
runner: blacksmith-32vcpu-ubuntu-2404
platform: linux/amd64
- arch: arm64
runner: blacksmith-32vcpu-ubuntu-2404-arm
platform: linux/arm64
runs-on: ${{ matrix.runner }}
timeout-minutes: 30
steps:
- uses: useblacksmith/checkout@25227e61ff9dafe400e22fa487b673eac4e4409a # v1
- name: Set up Docker Buildx
uses: useblacksmith/setup-docker-builder@19215110ab936351210feebdfa5b440b4493e184 # v2
- name: Log in to Docker Hub
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push ${{ matrix.arch }} by digest
id: push
uses: useblacksmith/build-push-action@9b0579bbec7a6cad2f171596c57e7ac1e7658850 # v2
with:
context: .
file: docker/sandbox-desktop.Dockerfile
platforms: ${{ matrix.platform }}
labels: |
org.opencontainers.image.revision=${{ github.sha }}
outputs: type=image,name=${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=true
cache-from: type=gha,scope=sandbox-${{ matrix.arch }}
- name: Export digest
run: |
mkdir -p "$RUNNER_TEMP/digests"
digest="${{ steps.push.outputs.digest }}"
touch "$RUNNER_TEMP/digests/${digest#sha256:}"
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: sandbox-digest-${{ matrix.arch }}
path: ${{ runner.temp }}/digests/*
if-no-files-found: error
retention-days: 1
# Registry-side stitch of the two digests into one tagged manifest list.
merge:
if: ${{ !cancelled() && github.repository == 'NousResearch/hermes-agent' && (github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && inputs.publish)) }}
needs: [publish]
# GitHub-hosted with docker/setup-buildx-action, as before the runner migration: on
# Blacksmith `imagetools create` cannot commit a manifest list to Docker Hub (404 on the
# index commit, any buildx version): v0.22.3 rc.1-rc.4 died on it in the versioned manifest.
runs-on: ubuntu-latest
timeout-minutes: 10
environment: container-publish
steps:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
path: ${{ runner.temp }}/digests
pattern: sandbox-digest-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
- name: Log in to Docker Hub
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Create manifest list and push
working-directory: ${{ runner.temp }}/digests
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
set -euo pipefail
shopt -s nullglob
args=()
for digest_file in *; do
args+=("${IMAGE_NAME}@sha256:${digest_file}")
done
if [ "${#args[@]}" -ne 2 ]; then
echo "::error::want 2 digests, found ${#args[@]} (a publish leg failed)"
exit 1
fi
# :desktop is the stable tag docker_image points at; releases also get a pinned tag.
tags=(-t "${IMAGE_NAME}:desktop")
if [ -n "${RELEASE_TAG}" ]; then
tags+=(-t "${IMAGE_NAME}:${RELEASE_TAG}-desktop")
fi
for i in 1 2 3; do
if docker buildx imagetools create "${tags[@]}" "${args[@]}"; then
break
fi
if [ "$i" = 3 ]; then
echo "::error::imagetools create failed after 3 attempts"
exit 1
fi
sleep 10
done
docker buildx imagetools inspect "${IMAGE_NAME}:desktop"