Grandchild jobs in the Nomad UI
- Dominant language
- Go
- Stars
- 17k
- Forks
- 2.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 105
Description
As pointed out in #24311, currently children of child jobs (I'll say grandchildren of grandparent jobs) are not easy to browse to in the Nomad web UI.
We brushed up against this when revamping the Jobs page ([lil breadcrumb in rpc code](https://github.com/hashicorp/nomad/blob/v1.8.0/nomad/job_endpoint_statuses.go#L243-L245)), but I don't think we wrote it down anywhere to eventually swing back around to it.
## CLI
`grandparent.nomad.hcl`:
```hcl
# `nomad job run` produces a parameterized job
job "grandparent" {
type = "batch"
# `nomad job dispatch grandparent` produces a child job
parameterized {}
# `nomad job periodic force grandparent/`
# of the child produces a periodic child,
# i.e. a "grandchild" job of the original "grandparent"
periodic {
crons = ["30 2 * * * *"] # 2:30am daily, e.g.
}
group "example" {
task "example" {
driver = "docker"
config {
image = "busybox:1"
command = "sh"
args = ["-c", "echo hello; sleep 1"]
}
}
}
}
```
```shell
$ nomad run grandparent.nomad.hcl
Job registration successful
$ nomad job dispatch grandparent
Dispatched Job ID = grandparent/dispatch-1730309121-2f3cdded
$ nomad job periodic force grandparent/
==> 2024-10-30T13:25:32-04:00: Monitoring evaluation "7e7eb01d"
2024-10-30T13:25:32-04:00: Evaluation triggered by job "grandparent/dispatch-1730309121-2f3cdded/periodic-1730309132"
2024-10-30T13:25:33-04:00: Allocation "c7540d85" created: node "4d4717d0", group "example"
2024-10-30T13:25:33-04:00: Evaluation status changed: "pending" -> "complete"
==> 2024-10-30T13:25:33-04:00: Evaluation "7e7eb01d" finished with status "complete"
$ nomad status
ID Type Priority Status Submit Date
grandparent batch/periodic/parameterized 50 running 2024-10-30T13:25:17-04:00
grandparent/dispatch-1730309121-2f3cdded batch/periodic 50 running 2024-10-30T13:25:21-04:00
grandparent/dispatch-1730309121-2f3cdded/periodic-1730309132 batch 50 dead 2024-10-30T13:25:32-04:00
```
## Web UI
The grandchild is not browse-to-able through Jobs



Only through Evaluations (or generating the URL manually)


Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the breadcrumb-related code in nomad/job_endpoint_statuses.go and reproduce the grandparent, dispatched child, and periodic grandchild flow described in the issue. Trace how the Jobs page exposes those relationships and verify that the grandchild can be reached through Jobs rather than only through Evaluations or a manually constructed URL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100