fix: [nomad-step-5] S5.1 — nomad/jobs/edge.hcl (Caddy + dispatcher sidecar) (#988) #994
No reviewers
Labels
No labels
action
backlog
blocked
bug-report
cannot-reproduce
in-progress
in-triage
needs-triage
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
rejected
reproduced
tech-debt
underspecified
vision
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#994
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-988"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #988
Changes
AI Review
Summary
PR adds
nomad/jobs/edge.hcl— a Nomad service job for the Caddy reverse proxy and dispatcher sidecar (S5.1). Structure follows the established sibling pattern fromagents.hcl. Two blockers will cause runtime failures before S5.2 can wire this job.Blockers
nomad/jobs/edge.hcl:44: Vault role name mismatch. The job stanza declaresvault { role = "service-dispatcher" }, butvault/roles.yamldefines the dispatcher role asname: dispatcher(noservice-prefix) withjob_id: dispatcher(notedge). Workload identity will fail to match on both dimensions. The inline comment also claims the policy lives atvault/policies/service-dispatcher.hcl, but that file does not exist — the actual file isvault/policies/dispatcher.hcl.Fix required: In
vault/roles.yaml, rename the role entry toservice-dispatcher(matching the convention used byservice-agents,service-forgejo, etc.) and setjob_id: edgeto match the actual job name. Update the inline comment to reference the correct policy file name.Confirm done:
grep service-dispatcher vault/roles.yamlreturns a match and the entry hasjob_id: edge.nomad/jobs/edge.hcl:196-202: Docker socket declared as a host volume (type = "host",source = "/var/run/docker.sock"). Nomad host volumes requiresourceto reference a named volume registered inclient.hcl— absolute paths are not valid source values.docker-socketis not declared inclient.hcl, and/var/run/docker.sockis a socket file, not a directory. The job will be rejected at submission time.Fix required: Remove the
volume "docker-socket"stanza and the correspondingvolume_mountblock. Mount the socket via the docker driver bind-volume config (no client.hcl entry needed;volumes.enabled = trueis already set in the plugin config):Confirm done: no
volume "docker-socket"stanza in the file; dispatcher task config block carries the bind mount.Non-blocking
nomad/jobs/edge.hcl:105: Comment reads "Mount Caddy config from repo (docker/Caddyfile)" but the caddy task has no matchingvolume_mountanddocker/edge/Dockerfiledoes notCOPYa Caddyfile. Clarify the comment — either it is stale or the config is generated at runtime byentrypoint-edge.sh.Verdict
REQUEST_CHANGES — Two runtime blockers: vault role name mismatch (service-dispatcher vs dispatcher + wrong job_id) and docker-socket declared as a host volume with an absolute path instead of a bind mount
Reviewed at
ebdf8e0| AGENTS.mdAI Review: REQUEST_CHANGES — Two runtime blockers: vault role name mismatch (service-dispatcher vs dispatcher + wrong job_id) and docker-socket declared as a host volume with an absolute path instead of a bind mount
ebdf8e0f5eto72aecff8d8AI Re-review (round 2)
Previous Findings
[blocker] Vault role name mismatch → FIXED:
vault/roles.yamlupdated toname: service-dispatcher,policy: service-dispatcher,job_id: edge. Policy filevault/policies/service-dispatcher.hclcreated. Workload identity will resolve correctly.[blocker] Docker socket as host volume → FIXED:
volume "docker-socket"stanza and itsvolume_mountremoved. Bind mount added to dispatcher task's docker config block (volumes = ["/var/run/docker.sock:/var/run/docker.sock:ro"]). Job will no longer be rejected at submission.[low] Stale Caddyfile comment → FIXED: comment updated to describe caddy-data mount purpose and Caddyfile delivery via
entrypoint-edge.sh.New Issues
nomad/jobs/edge.hcl:35: Comment now readsvault/policies/dispatcher.hclbut the actual policy bound to this role isvault/policies/service-dispatcher.hcl(the new file added in this PR).dispatcher.hclis the old standalone policy. Comment-only, no runtime impact.Verdict
APPROVE — Both blockers closed: vault role renamed to service-dispatcher with correct job_id, docker socket converted to bind mount.
Reviewed at
72aecff| Previous:ebdf8e0| AGENTS.mdAI Re-review (round 2): APPROVE — Both blockers closed: vault role renamed to service-dispatcher with correct job_id, docker socket converted to bind mount.