From 6fed3613879bc583b7fe2ca867873b6c51e8c302 Mon Sep 17 00:00:00 2001 From: Marius Ciepluch <11855163+norandom@users.noreply.github.com> Date: Tue, 29 Sep 2026 17:50:28 +0200 Subject: [PATCH] ops(ax): bring-up, tear-down and smoke Task for the local ax (task 0, in progress) kind cluster + registry, Agent Substrate, ax control plane via ko, one files-only smoke Task; helpers run from their own checkout because they resolve paths from the git toplevel. Footprint and README follow once the cluster is up. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01EmM1j46qgKMh3zqD1QMwEo --- ops/ax/down.sh | 7 +++++++ ops/ax/smoke-task.yaml | 29 +++++++++++++++++++++++++++++ ops/ax/up.sh | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+) create mode 100755 ops/ax/down.sh create mode 100644 ops/ax/smoke-task.yaml create mode 100755 ops/ax/up.sh diff --git a/ops/ax/down.sh b/ops/ax/down.sh new file mode 100755 index 0000000..1a8a25a --- /dev/null +++ b/ops/ax/down.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# Tear down the local ax: the kind cluster and its registry container. Source checkouts stay in the cache. +set -euo pipefail +export PATH="$HOME/go/bin:$HOME/.local/bin:$PATH" +export KIND_CLUSTER_NAME="${KIND_CLUSTER_NAME:-ousast}" +SRC="${OUSAST_AX_SRC:-$HOME/.cache/ousast/ax-src}" +(cd "$SRC/substrate" && hack/delete-kind-cluster.sh) diff --git a/ops/ax/smoke-task.yaml b/ops/ax/smoke-task.yaml new file mode 100644 index 0000000..ec248a4 --- /dev/null +++ b/ops/ax/smoke-task.yaml @@ -0,0 +1,29 @@ +# Minimal Task for the bring-up smoke test: default runner image, a files-only workspace, no MCP or skills. +apiVersion: ax.io/v1alpha1 +kind: Task +metadata: + name: ousast-smoke + atespace: default +spec: + image: "gcr.io/ax-substrate/ate-images/ax-task-runner@sha256:3a0dea6ad8b55278685db58aca6e37dc4ba04056831d45bef3aaeafdca43cac6" + command: ["sh", "-c", "cat /workspace/hello.txt && echo smoke-ok"] + resources: + requests: + cpu: "100m" + memory: "256Mi" + limits: + cpu: "1" + memory: "1Gi" + workspaces: + - name: ousast-smoke-ws + path: "/workspace" +--- +apiVersion: ax.io/v1alpha1 +kind: Workspace +metadata: + name: ousast-smoke-ws + atespace: default +spec: + files: + - path: "hello.txt" + content: "hello from openultrasast\n" diff --git a/ops/ax/up.sh b/ops/ax/up.sh new file mode 100755 index 0000000..e5bc8fa --- /dev/null +++ b/ops/ax/up.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Bring up ax on this host: kind cluster + local registry, Agent Substrate, the ax control plane, one smoke +# Task. Idempotent enough to rerun; `down.sh` removes everything. Requires docker, go, kubectl, kind, ko, ax. +set -euo pipefail +export PATH="$HOME/go/bin:$HOME/.local/bin:$PATH" +export GOTOOLCHAIN=auto +export KIND_CLUSTER_NAME="${KIND_CLUSTER_NAME:-ousast}" +export KO_DOCKER_REPO="${KO_DOCKER_REPO:-localhost:5001}" +SRC="${OUSAST_AX_SRC:-$HOME/.cache/ousast/ax-src}" + +for t in docker go kubectl kind ko ax; do + command -v "$t" >/dev/null || { echo "missing tool: $t" >&2; exit 2; } +done +mkdir -p "$SRC" +clone() { [ -d "$SRC/$1" ] || git clone -q --depth 1 "$2" "$SRC/$1"; } +clone substrate https://github.com/agent-substrate/substrate.git +clone ax https://github.com/google/ax.git +step() { printf '\n== %s (%s)\n' "$1" "$(date +%H:%M:%S)"; } + +step "kind cluster '$KIND_CLUSTER_NAME' + registry $KO_DOCKER_REPO" +(cd "$SRC/substrate" && hack/create-kind-cluster.sh) # its helpers resolve paths from the git toplevel + +step "agent substrate (ate-system)" +(cd "$SRC/substrate" && hack/install-ate-kind.sh --deploy-ate-system) +kubectl -n ate-system wait --for=condition=Ready pod --all --timeout=900s || true +kubectl -n ate-system get pods + +step "ax control plane (ax-system)" +(cd "$SRC/ax" && make deploy AX_IMAGE_REPO="$KO_DOCKER_REPO") +kubectl -n ax-system wait --for=condition=Ready pod --all --timeout=600s || true +kubectl -n ax-system get pods + +step "smoke task" +ax apply -f "$(dirname "$0")/smoke-task.yaml" +ax get tasks + +step "footprint" +free -m | sed -n 1,2p +docker stats --no-stream --format '{{.Name}} {{.MemUsage}} {{.CPUPerc}}' | grep -Ei 'kind|registry' || true