Skip to content

Add valar batch commands for RFC-0003 batch executions - #14

Merged
lnsp merged 1 commit into
masterfrom
feat/batch
Jul 26, 2026
Merged

Add valar batch commands for RFC-0003 batch executions#14
lnsp merged 1 commit into
masterfrom
feat/batch

Conversation

@lnsp

@lnsp lnsp commented Jul 26, 2026

Copy link
Copy Markdown
Member

Batch services could not be created through the CLI at all — kind is only settable at service creation, and neither SubmitArtifact nor SubmitBuild sent it, so batch was reachable only by hand-rolled HTTP.

builds push gains --kind, validated before the artifact upload since the upload is what creates the service, and repeated on the build request because the server reads an absent kind as function and 409s against an existing batch service.

valar batch adds run, list, inspect, logs, cancel, config.

Exercised against the live platform (2.4.1):

$ valar batch run -s batchdemo --follow -e GREETING=deterministic -- /out/venv/bin/python app.py final
Execution 4b1bbd66-8c0c-4deb-8a04-c0341f6a29aa pending
valar batch sample: starting
args: ['final']
GREETING: deterministic
valar batch sample: done
Execution 4b1bbd66-8c0c-4deb-8a04-c0341f6a29aa succeeded (exit 0)

Two behaviours worth review:

  • run --follow waits for completion, then prints output rather than streaming live. Batch containers routinely exit in under a second, so a tail started when status turns running usually attaches to an already-closed log and returns nothing — the first version of this did exactly that and printed an EOF error. Waiting first is deterministic.
  • inspect translates blockedGate into something actionable. The five gates look identical from outside (the execution just hasn't started) but "no single runner has room" and "batch is at its configured share" call for different responses.

config only PATCHes when a flag was actually passed, so reading the config can't silently rewrite it.

Batch services could not be created through the CLI at all: kind is only
settable when a service is created, and neither SubmitArtifact nor SubmitBuild
sent it, so batch was reachable only by hand-rolled HTTP.

builds push gains --kind. It is validated before the artifact upload, because
the upload is what creates the service, and it is repeated on the build request
because the server reads an absent kind as "function" and answers 409 on a
mismatch with an existing batch service.

valar batch adds run, list, inspect, logs, cancel and config.

Two behaviours worth noting. run --follow waits for the execution to finish and
then prints its output, rather than streaming live: batch containers routinely
exit in under a second, so a tail started when the status turns "running"
usually attaches to an already-closed log and returns nothing. Waiting first
makes the output deterministic, which was not true of the first version.

And inspect translates blocked_gate into something actionable. The five gates
look identical from outside -- the execution simply has not started -- but
"no single runner has room" and "batch is at its configured share" call for
different responses.

config only sends a PATCH when a flag was actually passed, so reading the
configuration cannot silently rewrite it.
@lnsp
lnsp merged commit 4840a4f into master Jul 26, 2026
1 check failed
lnsp added a commit that referenced this pull request Jul 26, 2026
This branch was cut from a stale local master, before #11 replaced
streamRequest with streamOnce plus a reconnecting follow helper. The squash
merge of #14 produced no textual conflict -- the removed symbol and the new
call site are in different parts of the file -- so master built green in the
branch and broken on trunk.

Batch log streaming now uses the same path service logs do. A followed stream
reconnects and resumes at an exact byte offset. It always starts at the
beginning of the log rather than anchoring to the end: an execution's output is
finite and usually short, so there is nothing to gain from skipping the start
and a real chance of missing all of it.
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.

1 participant