Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions hack/hero-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ With `RUN_LIVE_STEPS=1`, the harness calls:
- Step 1: `ax get workspaces`, to check `ax-server` is reachable.
- Step 2: `ax apply -f workspace.yaml`, which waits for the pre-warm, then `ax describe workspace` to check `SnapshotReady`.
- Step 3: `ax apply -f gateway.yaml` and `ax apply -f task-starter.yaml`, then `ax resume`, wait for `/workspace/.ax/output`, and `ax suspend` / `ax resume`.
- Step 4: `ax apply -f task-custom.yaml` and `ax resume`, then wait for `hero-demo-custom-task` to reach `Completed` in the shared `hero-demo-ws` workspace.
- Step 5: `ax promote task hero-demo-starter-task --to <remote> --replace --suspend-source`.

`task-starter.yaml` pins the published Antigravity starter image (`ghcr.io/agentexecutor/antigravity`, `v0.0.0-rc.2`, pinned by digest as Substrate requires); pass `STARTER_IMAGE=<image>@sha256:<digest>` to override it for local testing. Because pure starter images have no `ax-task-runner` baked in, `ax-server` also needs a runner volume image (`ax install --runner-volume-image` or `AX_RUNNER_VOLUME_IMAGE`, which is empty by default); Step 2 needs it too, because the workspace is pre-warmed in the same image.
`task-starter.yaml` pins the published Antigravity starter image (`ghcr.io/agentexecutor/antigravity`, `v0.0.0-rc.2`, pinned by digest as Substrate requires); pass `STARTER_IMAGE=<image>@sha256:<digest>` to override it for local testing. Because pure starter and custom images have no `ax-task-runner` baked in, `ax-server` also needs a runner volume image (`ax install --runner-volume-image` or `AX_RUNNER_VOLUME_IMAGE`, which is empty by default); Steps 2, 3, and 4 all rely on it.

Still stubbed: local mode and the AX Studio health check (Step 1), the second Session turn on the same task's workspace (Step 3), and the custom image task, which needs automatic `ax-task-runner` injection (Step 4).
Still stubbed: local mode and the AX Studio health check (Step 1), and the second Session turn on the same task's workspace (Step 3).

## Checking the warm snapshot by hand

Expand Down
39 changes: 31 additions & 8 deletions hack/hero-demo/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,37 @@ step3_starter_task_session() {
step4_custom_image_task() {
local step="${STEPS[3]}"
echo "==> [Step 4] Custom Image Task - No Starter Template"
# A plain image has no ax-task-runner, so task-custom.yaml cannot run on main
# yet; nothing is called here even in live mode.
# TODO(@itssimrank, @siyuanfoundation): Once automatic runner injection lands, run
# ax apply -f task-custom.yaml && ax resume task hero-demo-custom-task
# and check the unit tests pass, e.g. with
# ax ssh hero-demo-custom-task -- python3 -m unittest discover -s /workspace/app
: "${CUSTOM_MANIFEST}" "${CUSTOM_TASK}"
mark_stub "${step}" "Wire custom image + command Task (needs runner injection)"
if ! live; then
mark_stub "${step}" "Set RUN_LIVE_STEPS=1 to run the custom image task"
return
fi
# Tasks are immutable, so start from a fresh one on every run.
run_ax delete task "${CUSTOM_TASK}" >/dev/null 2>&1 || true

if ! AX_TIMEOUT=600 ax_quiet apply -f "${CUSTOM_MANIFEST}"; then
mark_fail "${step}" "ax apply -f task-custom.yaml failed"
return
fi
if ! ax_quiet resume task "${CUSTOM_TASK}"; then
mark_fail "${step}" "ax resume task ${CUSTOM_TASK} failed"
return
fi

local deadline=$((SECONDS + AX_TIMEOUT))
local desc=""
while ((SECONDS < deadline)); do
desc="$(run_ax describe task "${CUSTOM_TASK}" 2>/dev/null || true)"
if echo "${desc}" | grep -qE '^State:[[:space:]]*Completed$'; then
mark_pass "${step}" "${CUSTOM_TASK} completed unit tests in shared workspace ${WORKSPACE_NAME}"
return
fi
if echo "${desc}" | grep -qE '^State:[[:space:]]*Failed$'; then
mark_fail "${step}" "${CUSTOM_TASK} failed; see 'ax describe task ${CUSTOM_TASK}'"
return
fi
sleep 2
done
mark_fail "${step}" "${CUSTOM_TASK} did not complete within ${AX_TIMEOUT}s"
}

# ------------------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions hack/hero-demo/task-custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ metadata:
atespace: default
spec:
profile:
# TODO(@itssimrank): A plain image has no /usr/local/bin/ax-task-runner, so this
# needs automatic runner injection. Pin by digest as well: Substrate rejects
# tag-only images.
image: python:3.12-slim
# Plain Python image pinned by digest (Substrate rejects tag-only images).
# ax-server injects /usr/local/bin/ax-task-runner automatically when
# AX_RUNNER_VOLUME_IMAGE is configured.
image: "python:3.12@sha256:5411fa1b302c43f510324381162b5f5d0d93b9ee2af538f09d944f0d290ee3cb"
resources:
limits:
cpu: "1"
Expand Down
Loading