hashicorp / hashicorp/nomad

Job plan for system job displays max uint64 for create

Open
#7,019 6 comments 0 reactions 0 assignees View on GitHub
theme/cli theme/plan theme/system-scheduler type/bug
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Nomad version
Output from `nomad version`

Nomad v0.10.3 (65af1b9ecff5b55a1dd6e10b8c3224f896d6c9fa)

### Operating system and Environment details

ubuntu 19.10

### Issue

`nomad job plan repro.hcl` for a system job diaplays max uint64 (likely negative number being computed)

```
→ nomad job plan repro.hcl
+/- Job: "redis"
+/- Task Group: "cache" (18446744073709551615 create, 2 create/destroy update)
+ Constraint {
+ LTarget: "${node.class}"
+ Operand: "="
+ RTarget: "class-1"
}
+/- Task: "redis" (forces create/destroy update)
+/- Env[version]: "5" => "2"

+ Task Group: "cache2" (1 create)
+ Task: "redis" (forces create)

Scheduler dry-run:
- All tasks successfully allocated.

```

### Reproduction steps

running a nomad dev cluster with different node classes, run a system job without constraints, plan job with constraints.

`nomad job run simplerepro.hcl`

then `nomad job plan repro.hcl`

### Job file (if appropriate)

simplerepro.hcl
```
job "redis" {
datacenters = ["dc1"]

type = "system"

group "cache" {
count = 1

restart {
attempts = 10
interval = "5m"

delay = "25s"
mode = "delay"
}

ephemeral_disk {
size = 10
}

task "redis" {
driver = "docker"

config {
image = "redis:3.2"

port_map {
db = 6379
}
}

env {
version = "5"
}

logs {
max_files = 1
max_file_size = 9
}

resources {
cpu = 20 # 500 MHz

memory = 40 # 256MB

network {
mbits = 1
port "db" {}
}
}
}
}
}

```

repro.hcl
```hcl
job "redis" {
datacenters = ["dc1"]

type = "system"

# type = "service"
group "cache2" {
constraint {
attribute = "${node.class}"
value = "class-2"
}

count = 1

restart {
attempts = 10
interval = "5m"

delay = "25s"
mode = "delay"
}

ephemeral_disk {
size = 10
}

task "redis" {
driver = "docker"

config {
image = "redis:3.2"

port_map {
db = 6379
}
}

env {
version = "2"
}

logs {
max_files = 1
max_file_size = 9
}

resources {
cpu = 20 # 500 MHz

memory = 40 # 256MB

network {
mbits = 1
port "db" {}
}
}
}
}

group "cache" {
constraint {
attribute = "${node.class}"
value = "class-1"
}

count = 1

restart {
attempts = 10
interval = "5m"

delay = "25s"
mode = "delay"
}

ephemeral_disk {
size = 10
}

task "redis" {
driver = "docker"

config {
image = "redis:3.2"

port_map {
db = 6379
}
}

env {
version = "2"
}

logs {
max_files = 1
max_file_size = 9
}

resources {
cpu = 20 # 500 MHz

memory = 40 # 256MB

network {
mbits = 1
port "db" {}
}
}
}
}
}

```

### Nomad logs (if appropriate)
If possible please post relevant logs in the issue.

```
2020-01-29T16:29:47.188-0500 [DEBUG] nomad.job.system_sched: reconciled current state with desired state: eval_id=c948f657-174c-98e9-85c8-7d76d4d7910d job_id=redis namespace=default place=2 update=2 migrate=0 stop=0 ignore=0 lost=0
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.