Repository navigation
feat(actions): run Nomad task action blocks as implicit workload actions - #840
Merged
Merged
Conversation
…tions Each `action` block in a workload's job specs is offered as one of the workload's implicit actions, with nothing added to workload.yaml: - Discovery: the revision loader reads the job HCL as written (hcl-rs) and names each block by its label (task-qualified on a collision); plain-string command lines become the description. - Where it runs: one running allocation of its group, or every one of a system job's. Groups that may run several allocations offer the choice (`ActionInfo.instances`), carried by run and action-rollout requests, `RolloutAction` and `RunAction.instances` to the executor. - Execution: Nomad's action WebSocket (`/v1/job/:id/action`), opened by a new `Transport::socket` over TCP/TLS (reqwest HTTP/1.1 upgrade) and the task API socket (hyper upgrade). One step per allocation, stopping at the first non-zero exit; the executor checks the registered job still defines the action. - Output: lines stream as step progress; the scrubbed last 64 KiB lands in `StepOutcome.output` / `StepReport.output`, behind "Show output" in the run report. - UI: a task action offering the choice opens a dialog with One / Every allocation (no note required); workload-wide rollouts offer the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WkowUvEdVzjDvfrZRY8Uot
…er's own connection Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WkowUvEdVzjDvfrZRY8Uot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Ben · project thread
Each
actionblock in a workload's job specs becomes one of the workload's implicit actions. Nothing needs adding toworkload.yaml. For example, nomad-auto-update'scheck-nownow shows up in Buckle's UI and runs from there.Discovery (server, from Git)
buckle_core::engine::task_actions: when a revision loads, the loader parses each job's HCL as written (hcl-rs, the same approach asdeclared_vars) and stores the result onLoadedWorkload.task_actions.task.labelwhen two tasks share a label or the label is already an implicit or declared action's name.commandandargsare written as plain strings..j2spec whose template syntax isn't HCL) offers no actions, and neither does an action inside adynamicblock.actions::listoffers them with kindnomad.action,implicit, and no confirmation.Where it runs (any / all allocations)
countother than a literal 1). In that caseActionInfo.instancescarries the default.RunActionRequest.instances/StartActionRollout.instances→Command::RunAction/RolloutAction(the action digest includes it) →RunAction.instances(proto field 8) → the executor. The audit message records it.Execution (executor)
GET /v1/job/:id/action?action=&allocID=&task=&tty=false). A newTransport::socketopens it in two ways:This adds
tokio-tungstenitewith only thehandshakefeature.StepProgress. The last 64 KiB, scrubbed of the assignment's secrets, is kept inStepOutcome.output/StepReport.output.deployidentity's namespacewritealready grantsalloc-exec.raw_exectasks would also needalloc-node-exec.UI
Tests
RunAction.Not run locally: the e2e suite and screenshots, because trunk couldn't be installed in this environment. CI runs both.
Generated by Claude Code