hashicorp / hashicorp/nomad

[feature request] be able override resources in parameterized job

Open
#8,259 7 comments 18 reactions 0 assignees View on GitHub
stage/accepted theme/batch type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Nomad version
Nomad v0.11.3 (8918fc804a0c6758b6e3e9960e4eb2e605e38552)

### Operating system and Environment details
CentOS 7/8, Ubuntu 18.04

### Issue
I want to be able to register a `parameterized` job and then, be able to have different `resource` constraints for each `dispatch` of the job instance.

Also, if I were to move the meta from `required` to `optional`, how would I be able to specify a default value for the `optional` parameter?

### Reproduction steps

### Job file (if appropriate)

File: param1.nomad

```hcl
job "param1" {
type = "batch"

parameterized {
payload = "forbidden"
meta_required = ["CPU_VALUE"]
}

group "mygroup" {
task "mytask" {
driver = "raw_exec"

config {
command = "/bin/sleep"
args = ["300"]
}

resources {
cpu = "${NOMAD_META_CPU_VALUE}" # this does not work (of course), but that's what I want to achieve
memory = 256

network {
mbits = 100
}
}
}
}
}
```

### Use Case
The parameterized job is used to build different software components, some require more CPU/MEMORY than others while building, hence reserving the same cpu/memory for each dispatch is "sub-optimal".
n/a

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the parameterized job example in param1.nomad and trace how Nomad handles dispatches, resources, and required versus optional metadata. Confirm the intended semantics for per-dispatch CPU and memory and defaults for optional parameters. Done means the feature is implemented with coverage for these dispatch cases and the expected behavior is documented.

Written by the indexing model from the issue text.

Assessment

Domain
infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.