mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
build(docker): bake chromium runtime libs and refresh pinned tools (#357)
* build(docker): bake chromium runtime libs and refresh pinned tools Install the Chromium runtime libraries in the runner image from Playwright's own resolver instead of a hand-maintained package list, so a Playwright e2e suite runs in the Manager container without root or sudo. PLAYWRIGHT_VERSION is shared with the sandbox guest image and the docker-build workflow. Refresh the remaining pins: node 24.21.0, pnpm 10.28.1, OpenCode 1.18.31, microsandbox 0.7.2 and @opencode-ai/sdk 1.18.31. CI moves to Node 24 to match the image and the documented requirement. uv stays at 0.12.7. The runner previously fetched the unversioned installer URL, so UV_VERSION and the workflow build argument had no effect; it now installs from the versioned URL and asserts the installed version, and the workflow pins the release instead of resolving the newest tag. The pin cannot move past 0.12.7 yet because 0.12.8 and later segfault under qemu-user x86_64 emulation, which is how an arm64 host builds the amd64 platform. * chore(docker): bump the sandbox image digest to the 1.63 build The guest image was rebuilt and republished for Playwright 1.63.0, uv 0.12.7 and pnpm 10.28.1. Moving the digest is what makes deployments adopt it: attestation compares the reference string, so a rebuilt image behind the old digest would never be pulled or recreated. * build(sandbox): align toolchain pins and verify on native runners * feat(sandbox): run Docker with persistent guest storage * chore(docker): pin the Docker-enabled sandbox image
This commit is contained in:
1 parent
50da84541a
commit
65f5bd0e6a
19 files changed
+863
-112
No files matched your search
@@ -42,7 +42,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
node-version: "24"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
@@ -65,7 +65,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
node-version: "24"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
@@ -90,7 +90,7 @@ jobs:
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: "22"
|
||||
node-version: "24"
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
@@ -16,16 +16,18 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Resolve tool versions (bundled OpenCode and microsandbox for reproducibility)
|
||||
- name: Set tool versions (pinned for reproducibility)
|
||||
id: versions
|
||||
run: |
|
||||
UV_VERSION=$(git ls-remote --tags --sort=-v:refname https://github.com/astral-sh/uv.git 'refs/tags/[0-9]*' | head -1 | sed 's/.*refs\/tags\///')
|
||||
OPENCODE_VERSION=1.18.16
|
||||
MICROSANDBOX_VERSION=0.6.15
|
||||
UV_VERSION=0.12.7
|
||||
OPENCODE_VERSION=1.18.31
|
||||
MICROSANDBOX_VERSION=0.7.2
|
||||
PLAYWRIGHT_VERSION=1.63.0
|
||||
echo "uv=${UV_VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "opencode=${OPENCODE_VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "microsandbox=${MICROSANDBOX_VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "Versions: uv=${UV_VERSION} (latest), opencode=${OPENCODE_VERSION} (bundled default), microsandbox=${MICROSANDBOX_VERSION} (pinned)"
|
||||
echo "playwright=${PLAYWRIGHT_VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "Versions: uv=${UV_VERSION} (pinned), opencode=${OPENCODE_VERSION} (bundled default), microsandbox=${MICROSANDBOX_VERSION} (pinned), playwright=${PLAYWRIGHT_VERSION} (pinned)"
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
@@ -63,6 +65,7 @@ jobs:
|
||||
UV_VERSION=${{ steps.versions.outputs.uv }}
|
||||
OPENCODE_VERSION=${{ steps.versions.outputs.opencode }}
|
||||
MICROSANDBOX_VERSION=${{ steps.versions.outputs.microsandbox }}
|
||||
PLAYWRIGHT_VERSION=${{ steps.versions.outputs.playwright }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
target: runner
|
||||
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
node-version: '24'
|
||||
cache: 'pnpm'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
name: Sandbox Image
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
description: Extra tag to publish alongside the package version and commit sha
|
||||
default: latest
|
||||
required: false
|
||||
pull_request:
|
||||
paths:
|
||||
- Dockerfile.sandbox
|
||||
- scripts/sandbox-dockerd-start.sh
|
||||
- .github/workflows/sandbox-image.yml
|
||||
|
||||
env:
|
||||
IMAGE: docker.io/cstechdev/ocm-sandbox
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build:
|
||||
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.head.repo.full_name == github.repository
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
include:
|
||||
- platform: linux/amd64
|
||||
runner: ubuntu-latest
|
||||
- platform: linux/arm64
|
||||
runner: ubuntu-24.04-arm
|
||||
runs-on: ${{ matrix.runner }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Platform slug
|
||||
id: platform
|
||||
run: echo "slug=${PLATFORM//\//-}" >> "$GITHUB_OUTPUT"
|
||||
env:
|
||||
PLATFORM: ${{ matrix.platform }}
|
||||
|
||||
- name: Login to Docker Hub
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Build and verify native image
|
||||
id: build
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: Dockerfile.sandbox
|
||||
platforms: ${{ matrix.platform }}
|
||||
outputs: ${{ github.event_name == 'workflow_dispatch' && format('type=image,name={0},push-by-digest=true,name-canonical=true,push=true', env.IMAGE) || 'type=cacheonly' }}
|
||||
cache-from: type=gha,scope=sandbox-${{ steps.platform.outputs.slug }}
|
||||
cache-to: type=gha,scope=sandbox-${{ steps.platform.outputs.slug }},mode=max
|
||||
|
||||
- name: Export digest
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
run: |
|
||||
mkdir -p /tmp/digests
|
||||
touch "/tmp/digests/${DIGEST#sha256:}"
|
||||
env:
|
||||
DIGEST: ${{ steps.build.outputs.digest }}
|
||||
|
||||
- name: Upload digest
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: digests-${{ steps.platform.outputs.slug }}
|
||||
path: /tmp/digests/*
|
||||
if-no-files-found: error
|
||||
retention-days: 1
|
||||
|
||||
merge:
|
||||
if: github.event_name == 'workflow_dispatch'
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download digests
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: /tmp/digests
|
||||
pattern: digests-*
|
||||
merge-multiple: true
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Resolve tags
|
||||
id: tags
|
||||
run: |
|
||||
version="$(jq -er .version package.json)"
|
||||
tags="sha-${GITHUB_SHA::12} $version"
|
||||
for tag in "$version" "$EXTRA_TAG"; do
|
||||
if [ -n "$tag" ] && [[ ! "$tag" =~ ^[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}$ ]]; then
|
||||
printf 'Invalid image tag: %s\n' "$tag" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
if [ -n "$EXTRA_TAG" ]; then
|
||||
tags="$tags $EXTRA_TAG"
|
||||
fi
|
||||
echo "tags=$tags" >> "$GITHUB_OUTPUT"
|
||||
env:
|
||||
EXTRA_TAG: ${{ inputs.tag }}
|
||||
|
||||
- name: Create manifest list and push
|
||||
working-directory: /tmp/digests
|
||||
run: |
|
||||
read -ra tags <<< "$TAGS"
|
||||
args=()
|
||||
for tag in "${tags[@]}"; do
|
||||
args+=(-t "$IMAGE:$tag")
|
||||
done
|
||||
digests=(*)
|
||||
test "${#digests[@]}" -eq 2
|
||||
for digest in "${digests[@]}"; do
|
||||
[[ "$digest" =~ ^[a-f0-9]{64}$ ]]
|
||||
args+=("$IMAGE@sha256:$digest")
|
||||
done
|
||||
docker buildx imagetools create "${args[@]}"
|
||||
env:
|
||||
TAGS: ${{ steps.tags.outputs.tags }}
|
||||
|
||||
- name: Report index digest
|
||||
run: |
|
||||
digest="$(docker buildx imagetools inspect "$IMAGE:sha-${GITHUB_SHA::12}" --format '{{json .Manifest.Digest}}' | tr -d '"')"
|
||||
{
|
||||
echo "## Sandbox image"
|
||||
echo
|
||||
echo "Tags: $TAGS"
|
||||
echo
|
||||
echo "Pin \`SANDBOX_IMAGE\` to:"
|
||||
echo
|
||||
echo '```'
|
||||
echo "$IMAGE@$digest"
|
||||
echo '```'
|
||||
} >> "$GITHUB_STEP_SUMMARY"
|
||||
echo "$IMAGE@$digest"
|
||||
env:
|
||||
TAGS: ${{ steps.tags.outputs.tags }}
|
||||
Reference in new issue
Block a user