Skip to content

api,runner: bind at most one workspace per task - #496

Merged
rakyll merged 1 commit into
mainfrom
one-workspace
Oct 20, 2026
Merged

rakyll merged 1 commit into
mainfrom
one-workspace

Conversation

@rakyll

@rakyll rakyll commented Oct 18, 2026

Copy link
Copy Markdown
Member

Replace the repeated TaskSpec.workspaces field with a singular WorkspaceRef workspace. Mounting several durable filesystems into one task meant handling mount layout, path conflicts, and partial setup failures, and tasks only ever worked in the first entry anyway. Users who need content from several sources can put it all in one Workspace.

  • TaskSpec: replace repeated WorkspaceRef workspaces = 5 with WorkspaceRef workspace = 5. The WorkspaceRefs and WorkspacePaths helpers become a single WorkspacePath, and ValidateTask drops the duplicate name and path checks.
  • A binding without a path is mounted at /workspace rather than /workspace/. A task with no workspace still gets an empty working directory at /workspace.
  • runner: Config.Workspaces becomes Config.Workspace. The runner sets up one workspace and runs the command there.
  • controller,server: Reconcile takes a single *Workspace. The bound Workspace is injected as AX_WORKSPACE_YAML, one document, instead of the AX_WORKSPACES_YAML stream.
  • metadata: serve the bound Workspace at /metadata/v1alpha1/ax/workspace (404 when none) instead of a stream at .../workspaces.
  • ax-task-runner: --workspace-file is no longer repeatable.
  • Update docs, README, and examples/task.yaml for the new shape.

This is a breaking change. Manifests using the spec.workspaces list are rejected as an unknown field, and custom runners must read AX_WORKSPACE_YAML. The ax CLI and ax-server must be upgraded together.

Fixes #495.

@rakyll
rakyll requested a review from mayawang October 18, 2026 19:30

@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.

LGTM, one workspace per task is a good simplification. One note for the PR description: the JSON key changes from workspaces to workspace, and the store discards unknown fields, so tasks already stored in Redis lose their workspace binding on reload. Fine pre-alpha, but worth calling out like #485 did. Also heads-up that #405 is landing first and touches docs/concepts.md.

Replace the repeated TaskSpec.workspaces field with a singular
WorkspaceRef workspace. Mounting several durable filesystems into one
task meant handling mount layout, path conflicts, and partial setup
failures, and tasks only ever worked in the first entry anyway. Users
who need content from several sources can put it all in one Workspace.

- TaskSpec: replace `repeated WorkspaceRef workspaces = 5` with
  `WorkspaceRef workspace = 5`. The WorkspaceRefs and WorkspacePaths
  helpers become a single WorkspacePath, and ValidateTask drops the
  duplicate name and path checks.
- A binding without a path is mounted at /workspace rather than
  /workspace/<name>. A task with no workspace still gets an empty
  working directory at /workspace.
- runner: Config.Workspaces becomes Config.Workspace. The runner sets
  up one workspace and runs the command there.
- controller,server: Reconcile takes a single *Workspace. The bound
  Workspace is injected as AX_WORKSPACE_YAML, one document, instead of
  the AX_WORKSPACES_YAML stream.
- metadata: serve the bound Workspace at /metadata/v1alpha1/ax/workspace
  (404 when none) instead of a stream at .../workspaces.
- ax-task-runner: --workspace-file is no longer repeatable.
- Update docs, README, and examples/task.yaml for the new shape.

This is a breaking change. Manifests using the spec.workspaces list are
rejected as an unknown field, and custom runners must read
AX_WORKSPACE_YAML. The ax CLI and ax-server must be upgraded together.

Fixes #495.
@rakyll
rakyll merged commit 6a1d6ea into main Oct 20, 2026
9 checks passed
@rakyll
rakyll deleted the one-workspace branch October 20, 2026 17:17
cloudonly added a commit to cloudonly/ax that referenced this pull request Oct 21, 2026
google#496 moves AX to one workspace per task, so the example linked from
docs/manifests.md now shows a Task bound to a single git-backed
Workspace instead of composing two. The filename is kept so the link
keeps resolving.
cloudonly added a commit to cloudonly/ax that referenced this pull request Oct 21, 2026
google#496 removed the docs/manifests.md link to this file, so the header
comment no longer needs to claim the filename keeps that link
resolving.
yongruilin added a commit that referenced this pull request Oct 29, 2026
ax apply rejected the demo Task: #496 replaced spec.workspaces with
spec.workspace. The pinned runner image predates #496 and fails on the
new field, so leave spec.image unset unless AX_TASK_IMAGE is given.
cloudonly added a commit to cloudonly/ax that referenced this pull request Oct 30, 2026
google#496 moves AX to one workspace per task, so the example linked from
docs/manifests.md now shows a Task bound to a single git-backed
Workspace instead of composing two. The filename is kept so the link
keeps resolving.
cloudonly added a commit to cloudonly/ax that referenced this pull request Oct 30, 2026
google#496 removed the docs/manifests.md link to this file, so the header
comment no longer needs to claim the filename keeps that link
resolving.
cloudonly added a commit to cloudonly/ax that referenced this pull request Nov 3, 2026
google#496 moves AX to one workspace per task, so the example linked from
docs/manifests.md now shows a Task bound to a single git-backed
Workspace instead of composing two. The filename is kept so the link
keeps resolving.
cloudonly added a commit to cloudonly/ax that referenced this pull request Nov 3, 2026
google#496 removed the docs/manifests.md link to this file, so the header
comment no longer needs to claim the filename keeps that link
resolving.
mayawang added a commit that referenced this pull request Nov 4, 2026
…es (#505)

* docs: add WorkerPool step to quick start, fix Suspended flow, add multi-workspace example

The quick start jumped from deploying the control plane straight to running
a task, but nothing creates a WorkerPool: the first ax resume fails with
ResourceExhausted (no free workers available) until one is applied. Add a
step that applies examples/workerpool.yaml, with guidance on the
ate.dev/substrate-version nodeSelector label and the ko apply flow from a
Substrate checkout.

New tasks are stored Suspended and only start on ax resume, so the quick
start now resumes task123 after applying it instead of showing Running
straight away, and notes that a slow first resume does not mean failure.

docs/manifests.md links to examples/multi-workspace.yaml, which did not
exist; add it as a Task binding two Workspaces (one git-backed, one built
from inlined files).

* docs: bind a single workspace in the manifests example

#496 moves AX to one workspace per task, so the example linked from
docs/manifests.md now shows a Task bound to a single git-backed
Workspace instead of composing two. The filename is kept so the link
keeps resolving.

* docs: fix single workspace schema in manifest example

* docs: describe the current binding docs in the example header

#496 removed the docs/manifests.md link to this file, so the header
comment no longer needs to claim the filename keeps that link
resolving.

* docs: drop the multi-workspace example

* docs: update the WorkerPool example for Substrate v0.6.0

* docs: use ate.dev/v1 in the WorkerPool example

Substrate v1.0.0-rc.1 serves WorkerPool only as ate.dev/v1.

* docs: point the quick start at simple.yaml and shorten the WorkerPool step

examples/task.yaml was replaced by simple.yaml in #513. The WorkerPool step
now links to examples/workerpool.yaml and the installation guide instead of
walking through ko.

---------

Co-authored-by: cloudonly <[email protected]>
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.

Allow only one workspace per task

2 participants