Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: use correct effective cpuset filename on legacy cgroups v1 systems #20294

Merged
merged 1 commit into from
Apr 5, 2024

Conversation

shoenig
Copy link
Contributor

@shoenig shoenig commented Apr 4, 2024

Fixes #20293

@shoenig
Copy link
Contributor Author

shoenig commented Apr 4, 2024

Spot Check)

➜ make dev && sudo nomad agent -dev
job 1 (using resources.cpu)
job "job1" {

  group "cache" {
    network {
      port "db" {
        to = 6379
      }
    }

    task "redis" {
      driver = "docker"

      config {
        image          = "redis:7"
        ports          = ["db"]
        auth_soft_fail = true
      }

      resources {
        cpu    = 500
        memory = 256
      }
    }
  }
}
job 2 (using resources.cores)
job "job2" {

  group "cache" {
    network {
      port "db" {
        to = 6379
      }
    }

    task "redis" {
      driver = "docker"

      config {
        image          = "redis:7"
        ports          = ["db"]
        auth_soft_fail = true
      }

      resources {
        cores = 3
        memory = 256
      }
    }
  }
}
➜ nomad job run job1.hcl

initial value is all cpus as expected

➜ cat /sys/fs/cgroup/cpuset/docker/d047294cd29a0c0abd0d76509b837acedf0aff7391acc4d5c8232ffb2dfa68d5/cpuset.cpus
0-11
➜ nomad job run job2.hcl

cpuset has been updated to exclude cores reserved for job2

➜ cat /sys/fs/cgroup/cpuset/docker/d047294cd29a0c0abd0d76509b837acedf0aff7391acc4d5c8232ffb2dfa68d5/cpuset.cpus
3-11

@shoenig shoenig marked this pull request as ready for review April 4, 2024 16:59
@shoenig shoenig requested a review from schmichael April 4, 2024 16:59
@shoenig shoenig added this to the 1.7.x milestone Apr 5, 2024
@shoenig shoenig added the backport/1.7.x backport to 1.7.x release line label Apr 5, 2024
@shoenig shoenig merged commit 825efc3 into main Apr 5, 2024
20 of 21 checks passed
@shoenig shoenig deleted the fix-cpuset-fixer-cgv1 branch April 5, 2024 13:05
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/1.7.x backport to 1.7.x release line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker: cpuset fixer not working on cgroups v1 systems
2 participants