[nomad-step-5] S5.4 — dispatcher.sh DISPATCHER_BACKEND=nomad branch (nomad job dispatch) #991

Closed
opened 2026-04-18 06:42:29 +00:00 by dev-bot · 0 comments
Collaborator

Part of the Nomad+Vault migration. Step 5 — Edge + staging + chat + vault-runner dispatch. Blocked by: #988 (S5.1), #990 (S5.3).

Goal

Add the DISPATCHER_BACKEND=nomad branch to docker/edge/dispatcher.sh. The prep work (P2 #802) already refactored the dispatcher into a pluggable launch_runner() with DISPATCHER_BACKEND={docker,nomad} switch and a docker implementation. This issue adds the nomad branch.

Scope

In docker/edge/dispatcher.sh, implement _launch_runner_nomad:

_launch_runner_nomad() {
  local action_id="$1" secrets_csv="$2" mounts_csv="$3"
  
  nomad job dispatch \
    -detach \
    -meta action_id="$action_id" \
    -meta secrets_csv="$secrets_csv" \
    vault-runner
  
  # Poll dispatch status
  local dispatch_id
  dispatch_id=$(nomad job dispatch ... | grep -oE '[a-f0-9-]{36}')
  
  # Wait for completion, write result.json
  ...
}

Key details:

  • Replace the current stub (echo "nomad backend not yet implemented"; exit 99) with real dispatch.
  • Poll nomad job status for the dispatched evaluation until terminal state.
  • On completion: read exit code from alloc, write <action-id>.result.json via lib/forge-push.sh (from P12 #803).
  • On failure: write result.json with error, log stderr from alloc.
  • PR-verification + TOML-validation logic stays shared (backend-agnostic, already refactored by P2).

Acceptance criteria

  • DISPATCHER_BACKEND=nomad dispatches a vault-runner batch job via nomad job dispatch.
  • End-to-end: create a test vault action TOML on ops repo → admin-merge → dispatcher dispatches → result.json committed back.
  • DISPATCHER_BACKEND=docker (default) still works unchanged on live stack.
  • shellcheck clean.

Non-goals

  • No changes to the PR-approval workflow (Forgejo API calls unchanged).
  • No changes to TOML validation (already backend-agnostic).

Labels / meta

  • [nomad-step-5] S5.4 — blocked by #988, #990.
Part of the Nomad+Vault migration. **Step 5 — Edge + staging + chat + vault-runner dispatch.** **Blocked by: #988 (S5.1), #990 (S5.3).** ## Goal Add the `DISPATCHER_BACKEND=nomad` branch to `docker/edge/dispatcher.sh`. The prep work (P2 #802) already refactored the dispatcher into a pluggable `launch_runner()` with `DISPATCHER_BACKEND={docker,nomad}` switch and a `docker` implementation. This issue adds the `nomad` branch. ## Scope In `docker/edge/dispatcher.sh`, implement `_launch_runner_nomad`: ```bash _launch_runner_nomad() { local action_id="$1" secrets_csv="$2" mounts_csv="$3" nomad job dispatch \ -detach \ -meta action_id="$action_id" \ -meta secrets_csv="$secrets_csv" \ vault-runner # Poll dispatch status local dispatch_id dispatch_id=$(nomad job dispatch ... | grep -oE '[a-f0-9-]{36}') # Wait for completion, write result.json ... } ``` Key details: - Replace the current stub (`echo "nomad backend not yet implemented"; exit 99`) with real dispatch. - Poll `nomad job status` for the dispatched evaluation until terminal state. - On completion: read exit code from alloc, write `<action-id>.result.json` via `lib/forge-push.sh` (from P12 #803). - On failure: write result.json with error, log stderr from alloc. - PR-verification + TOML-validation logic stays shared (backend-agnostic, already refactored by P2). ## Acceptance criteria - `DISPATCHER_BACKEND=nomad` dispatches a vault-runner batch job via `nomad job dispatch`. - End-to-end: create a test vault action TOML on ops repo → admin-merge → dispatcher dispatches → result.json committed back. - `DISPATCHER_BACKEND=docker` (default) still works unchanged on live stack. - `shellcheck` clean. ## Non-goals - No changes to the PR-approval workflow (Forgejo API calls unchanged). - No changes to TOML validation (already backend-agnostic). ## Labels / meta - `[nomad-step-5] S5.4` — blocked by #988, #990.
dev-bot added the
backlog
label 2026-04-18 06:42:29 +00:00
dev-qwen self-assigned this 2026-04-18 07:17:55 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-18 07:17:55 +00:00
dev-qwen removed their assignment 2026-04-18 07:43:30 +00:00
dev-qwen removed the
in-progress
label 2026-04-18 07:43:30 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#991
No description provided.