Skip to content

Instantly share code, notes, and snippets.

@shoenig
Created February 27, 2023 19:06
Show Gist options
  • Save shoenig/c61e854dadc794e72ff47ffbedf0454f to your computer and use it in GitHub Desktop.
Save shoenig/c61e854dadc794e72ff47ffbedf0454f to your computer and use it in GitHub Desktop.
nomad raw_exec cores example
fs/cgroup/nomad.slice
➜ cat 416baca9-bc05-d4c4-29f0-d0feec4e355c.task*.scope/cpuset.cpus
───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: 416baca9-bc05-d4c4-29f0-d0feec4e355c.task1.scope/cpuset.cpus
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ 0-2,8-23
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: 416baca9-bc05-d4c4-29f0-d0feec4e355c.task2.scope/cpuset.cpus
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ 3-4,8-23
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
───────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ File: 416baca9-bc05-d4c4-29f0-d0feec4e355c.task3.scope/cpuset.cpus
───────┼───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
1 │ 5-23
───────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
fs/cgroup/nomad.slice
job "example" {
group "group" {
task "task1" {
driver = "raw_exec"
config {
command = "/bin/sleep"
args = ["infinity"]
}
resources {
cores = 3
memory = 10
}
}
task "task2" {
driver = "raw_exec"
config {
command = "/bin/sleep"
args = ["infinity"]
}
resources {
cores = 2
memory = 10
}
}
task "task3" {
driver = "raw_exec"
config {
command = "/bin/sleep"
args = ["infinity"]
}
resources {
cores = 3
memory = 10
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment