Files
nomad/client/lib/proclib/wrangler_linux.go
Seth Hoenig a4cc76bd3e numa: enable numa topology detection (#18146)
* client: refactor cgroups management in client

* client: fingerprint numa topology

* client: plumb numa and cgroups changes to drivers

* client: cleanup task resource accounting

* client: numa client and config plumbing

* lib: add a stack implementation

* tools: remove ec2info tool

* plugins: fixup testing for cgroups / numa changes

* build: update makefile and package tests and cl
2023-08-10 17:05:30 -05:00

29 lines
566 B
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
//go:build linux
package proclib
import (
"github.com/hashicorp/nomad/client/lib/cgroupslib"
)
// New creates a Wranglers factory for creating ProcessWrangler's appropriate
// for the given system (i.e. cgroups v1 or cgroups v2).
func New(configs *Configs) *Wranglers {
w := &Wranglers{
configs: configs,
m: make(map[Task]ProcessWrangler),
}
switch cgroupslib.GetMode() {
case cgroupslib.CG1:
w.create = newCG1(configs)
default:
w.create = newCG2(configs)
}
return w
}