Skip to content

feat(antigravity): add pure Dockerfile and multi-arch build/verify CI - #9

Merged
MushuEE merged 5 commits into
agentexecutor:mainfrom
Lukeluds:feat/antigravity-dockerfile
Nov 18, 2026
Merged

MushuEE merged 5 commits into
agentexecutor:mainfrom
Lukeluds:feat/antigravity-dockerfile

Conversation

@Lukeluds

@Lukeluds Lukeluds commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Note: Stacked on #8 (see commit 4a7fc6d for only this PR's diff; the PR diff will shrink automatically once #8 merges).

Adds agents/antigravity/Dockerfile and extends .github/workflows/antigravity.yaml with native linux/amd64 and linux/arm64 build and purity verification (no image push yet):

  • Pure AX agent image: No ax-task-runner baked in and no forced ENTRYPOINT, ready for AX to mount the static runner read-only at /opt/ax.
  • Runtime install by default (ARG PREINSTALL_AGY=false): Ships only debian:bookworm-slim packages, /usr/local/share/ax/install-agy.sh, and /usr/local/bin/ax-harness (AGY_CLI_DISABLE_AUTO_UPDATE=true) so no proprietary binary is bundled in the default image (ax-harness installs AGY_VERSION on startup).
  • Optional pre-installed local builds (--build-arg PREINSTALL_AGY=true): Pre-installs agy at build time with SHA-512 verification for local/airgapped E2E test environments.
  • Multi-arch CI (ubuntu-24.04 + ubuntu-24.04-arm, build-only): Verifies the default image contains neither ax-task-runner nor agy, smoke-tests ax-harness / install-agy.sh / git / python3, and runs an ephemeral local PREINSTALL_AGY=true build (agy --version, removed at job end).

@mayawang mayawang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before merge, two decisions: (1) the default image has no agy, so every task downloads it at start. Under the demo's Gateway (generativelanguage only) that fails, and allowing storage.googleapis.com opens all of GCS. Preinstalling a pinned version is cleaner, but that ships the agy binary in a public image, so we need a licensing answer first. (2) The image has no ax-task-runner or ENTRYPOINT, and expects AX to mount a runner at /opt/ax and write AX_GOAL_FILE, which AX main doesn't do yet. Let's agree that contract with @itssimrank (runner injection) before a ghcr name is published. Non-blocking: route inputs.agy_version through env:, and CI builds latest, so builds aren't reproducible.

@mayawang

Copy link
Copy Markdown
Collaborator

Update: the Antigravity runner approach is being worked out separately (@rakyll and @aprajitaarora13 are on it), so let's hold off on shipping the agy binary in the image until that lands.

@Lukeluds
Lukeluds force-pushed the feat/antigravity-dockerfile branch 2 times, most recently from 61a4cc1 to dfa51ae Compare November 17, 2026 20:58

@MushuEE MushuEE left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The image shape matches what the mounted runner expects on google/ax main: no runner in the image and the launcher at /usr/local/bin/ax-harness. Three things that would help us get to an image we can validate. I'm not weighing in on preinstall versus runtime install here, since that is on hold with the runner discussion.

1. Put the runtime install directory on PATH in the image. The harness adds ${PWD}/.ax/bin to PATH only for its own process. AX doesn't run the harness for a task with no goal, and an ax ssh shell never goes through it (google/ax#632), so a runtime-installed agy isn't found in an interactive session. Could the Dockerfile set it, for example ENV PATH=/workspace/.ax/bin:${PATH}? That assumes the workspace is mounted at /workspace, which is the default but can be changed per task.

2. Say in the README that the image needs the runner volume. The image only starts when ax-server is configured with a runner volume image (AX_RUNNER_VOLUME_IMAGE). google/ax#626 publishes ax-runner-volume but leaves it off in the release manifests by default. Without it AX starts /usr/local/bin/ax-task-runner, which this image doesn't have, and the task fails to start with an error that doesn't point at the cause.

3. Add a minimal Task example for the default image. With no agy in the image, a task has to set AGY_RUNTIME_INSTALL=true in spec.env and have egress to storage.googleapis.com. A short example in the README (image by digest, spec.goal.text, that env var, and the egress it needs) would give us one known-good way to validate the image end to end.

@MushuEE

MushuEE commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Tracking: this is part of #15 (get the Antigravity image ready to publish), under the release epic #12. The open decision on whether the published image contains agy is recorded there too.

@Lukeluds

Copy link
Copy Markdown
Collaborator Author

Thanks @MushuEE , all three done in 9ec8bf5:

  1. The Dockerfile puts /workspace/.ax/bin on PATH (default workspace path only, as noted).
  2. The README says the image needs the runner volume (--runner-volume-image / AX_RUNNER_VOLUME_IMAGE), or the task fails to start.
  3. The README has a minimal Task + Gateway example for the default image (digest, spec.goal.text, AGY_RUNTIME_INSTALL=true, storage.googleapis.com egress).
    It also covers your feat(antigravity): add ax-harness launcher with runtime install fallback #8 note: how to set up agy in an ax ssh session.

@MushuEE

MushuEE commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Following up on my earlier review, where I left preinstall versus runtime install open. For the first pass I think we will likely need to bake agy into the image, pinned to the version in install-agy.sh. This is a proposal for the first pass, not a final answer on what we publish.

Why: with runtime install, every task needs AGY_RUNTIME_INSTALL=true and egress to storage.googleapis.com, which opens all of GCS (@mayawang's point 1). An ax ssh session also has no agy until someone installs it by hand (google/ax#632). A baked-in binary removes both.

Suggested changes:

  1. Default to the baked-in build. ARG PREINSTALL_AGY=true in the Dockerfile, so the default image has the pinned agy in /usr/local/bin. Keeping PREINSTALL_AGY=false as an opt-out build is fine.
  2. Have CI assert the pin. The "purity" step currently fails if the default image contains agy. Flip it: the default image must have agy, and agy --version must report PINNED_VERSION from install-agy.sh. Keep the check that there is no ax-task-runner.
  3. Don't let the workspace shadow the baked-in binary. ENV PATH="/workspace/.ax/bin:${PATH}" puts a workspace copy ahead of /usr/local/bin/agy, so a leftover runtime install would win over the pinned one. Drop that entry, or move it after the system paths.
  4. Record the version in the image. ENV AGY_VERSION is empty in a default build, so nothing in the image says which agy it holds. Set it to the resolved version, or add a label.
  5. Update the README. The example Task no longer needs AGY_RUNTIME_INSTALL=true or the storage.googleapis.com egress rule, and the manual ax ssh install step goes away.

Still open: shipping the agy binary in a public image needs the licensing answer (#15). I'd make these changes now so we can validate the image end to end, and keep the ghcr publish blocked until that is answered. @mayawang, does that work with the hold while the runner approach is worked out?

@Lukeluds

Copy link
Copy Markdown
Collaborator Author

Status: ready for review. All of @MushuEE's points are in:

  • Default is now the bundled build (PREINSTALL_AGY=true). The runtime-install build is still available with PREINSTALL_AGY=false.
  • /workspace/.ax/bin comes after the system paths (image and ax-harness), so a workspace copy never shadows the baked-in agy.
  • The image records the agy version (AGY_VERSION and an io.agentexecutor.agy.version label), and CI checks it matches PINNED_VERSION.
  • CI builds and verifies both builds with verify_image.sh, on amd64 and arm64.
  • The README covers both builds, the runner-volume requirement, a Task example, and ax ssh.

Published images stay runtime-install until #15 is answered (#11 builds antigravity with PREINSTALL_AGY=false).

Merge order for the rc: this first, then #11.

@Lukeluds

Copy link
Copy Markdown
Collaborator Author

Tested the pinned agy (1.5.10) end to end against real Gemini with my API key on KinD, from this PR's head (5ee9b46). Both builds ran the hero-demo task: "Add a subtract(a, b) function to /workspace/app/math_utils.py and a unit test in test_math.py."

Check Bundled (PREINSTALL_AGY=true, default) Runtime install (PREINSTALL_AGY=false, published via #11)
Ran pinned agy 1.5.10 ✅ from /usr/local/bin ✅ downloaded and sha512-verified at start
Egress allowed generativelanguage.googleapis.com only plus storage.googleapis.com
No runtime download ✅ (AGY_RUNTIME_INSTALL unset) n/a
Gemini added subtract + test, unittest passes ✅ ✅
Answer written to AX_OUTPUT_FILE ✅ ✅
Key injected at the gateway, sandbox only sees a placeholder ✅ ✅
/proc/1/environ free of the real key ✅ ✅
Result 9/9 8/8

Note: this used the E2E stand-in runner. The full current-AX run comes with the hero demo validation (#16) after the rc tag.

MushuEE
MushuEE previously approved these changes Nov 18, 2026

@MushuEE MushuEE left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, now, thanks for validating in test.

@Lukeluds
Lukeluds dismissed MushuEE’s stale review November 18, 2026 23:05

The merge-base changed after approval.

MushuEE
MushuEE previously approved these changes Nov 18, 2026
@Lukeluds
Lukeluds dismissed MushuEE’s stale review November 18, 2026 23:15

The merge-base changed after approval.

…X usage

- Dockerfile: add /workspace/.ax/bin to PATH so ax ssh sessions, which
  never run the launcher, find a runtime-installed agy.
- README: the image needs ax-server's runner volume, a minimal Task and
  Gateway example for the default image, and how to set up agy in an
  ax ssh session.
… on PATH, verify both builds

- Dockerfile: ARG AGY_VERSION defaults to the pinned version and is
  recorded as AGY_VERSION and an io.agentexecutor.agy.version label. CI
  checks it equals PINNED_VERSION in install-agy.sh.
- /workspace/.ax/bin goes after the system paths in the image and in
  ax-harness, so a leftover runtime install never shadows an agy
  installed in the image.
- verify_image.sh checks a built image (bundled or runtime); CI builds
  and verifies both explicitly, independent of the Dockerfile default.
- README covers both builds and notes that published images are
  runtime-install until agentexecutor#15 is answered.
The default build installs the pinned agy into /usr/local/bin, so tasks
need no storage.googleapis.com egress and ax ssh sessions have agy right
away. Published images stay runtime-install (release.yaml builds
PREINSTALL_AGY=false) until agentexecutor#15 is answered.
@Lukeluds
Lukeluds force-pushed the feat/antigravity-dockerfile branch from 5ee9b46 to 05d0142 Compare November 18, 2026 23:16

@MushuEE MushuEE left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for rebase

@MushuEE
MushuEE merged commit 0d473b4 into agentexecutor:main Nov 18, 2026
6 checks passed
@MushuEE

MushuEE commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Trial: a task on the published antigravity image (v0.0.0-rc.1)

The published image ran a real task end to end on GKE: the mounted AX runner started ax-harness, agy was installed at start, and the agent wrote and ran hello.py. A first attempt without resource limits failed during the agy install.

Setup, output, the failed first attempt, and limits

Setup

  • Image: ghcr.io/agentexecutor/antigravity@sha256:e7419611493b3400c4512939dd8feea8107c23e56e4966453ad1d4a44c86ce9d (v0.0.0-rc.1, built with PREINSTALL_AGY=false). The package is still private, so the cluster pulled a copy from a private registry with the same index digest.
  • Cluster: GKE 1.37.1, linux/amd64, Substrate v1.0.0, gVisor.
  • AX: built from release: publish ax-runner-volume, with a switch to mount it by default google/ax#626, with ax-server mounting the runner volume into every task.
  • Task: the example from agents/antigravity/README.md, with debug: true added: AGY_RUNTIME_INSTALL=true, GEMINI_API_KEY=placeholder, limits of 2 CPU and 4Gi, and a Gateway that passes storage.googleapis.com through and injects the real key for generativelanguage.googleapis.com.
  • Goal: Create /workspace/hello.py that prints hello, and run it.

Result (second attempt, 2 CPU / 4Gi)

Runner and launcher log, from the worker:

03:28:43.676  initializing AX task runner  wsPath=/workspace
03:28:43.685  started task command  command=[/usr/local/bin/ax-harness]
03:28:43.703  ax-harness: agy not found on PATH; installing agy 1.5.10 to /workspace/.ax/bin...
03:28:46.987  install-agy: installed agy 1.5.10 (linux-x64) to /workspace/.ax/bin/agy
03:28:55.352  I have created the `/workspace/hello.py` file and executed it for you. Here is the output:
03:28:55.352  hello
03:28:55.372  task command completed successfully

About 3.3 s to install agy and 8.4 s for the agent's turn.

Checked in the task with ax ssh:

# tr "\0" " " < /proc/1/cmdline
/opt/ax/ax-task-runner
# ls /usr/local/bin/ax-task-runner
ls: cannot access '/usr/local/bin/ax-task-runner': No such file or directory
# ls -la /workspace/.ax/bin
-rwxr-xr-x 1 root root 267322056 Nov 19 03:28 agy
# /workspace/.ax/bin/agy --version
1.5.10
# cat /workspace/hello.py
print("hello")
# python3 /workspace/hello.py
hello
# cat /workspace/.ax/output
I have created the `/workspace/hello.py` file and executed it for you. Here is the output:

hello

What this shows:

  • The image has no runner of its own; PID 1 is the runner from the mounted volume, and it runs /usr/local/bin/ax-harness.
  • The runtime install works through the Gateway's tlsPassthrough rule.
  • The model call succeeded while the task only held placeholder, so the Gateway injected the key.
  • The answer was written to $AX_OUTPUT_FILE.

First attempt (no limits) failed

Without spec.profile.resources.limits, AX gives a task 1 CPU and 512Mi. The archive downloaded (about 100 MB), then unpacking failed and the launcher exited with code 2:

ax-harness: agy not found on PATH; installing agy 1.5.10 to /workspace/.ax/bin...
tar: antigravity: Wrote only 8704 of 10240 bytes
tar: Exiting with failure status due to previous errors
task command exited with error  exitCode=2

The installed agy binary is 267 MB and the workspace volume is memory-backed, so the archive plus the binary do not fit in 512Mi. The README's example limits (2 CPU, 4Gi) are enough. Two things made this harder to see:

  • The tar error does not mention space or limits.
  • The task kept reporting Working and Ready=True after the launcher had exited with an error; the failure was only in the worker's log.

Not covered

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants