mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 17:05:43 +03:00
This PR adds support for the raw_exec driver on systems with only cgroups v2. The raw exec driver is able to use cgroups to manage processes. This happens only on Linux, when exec_driver is enabled, and the no_cgroups option is not set. The driver uses the freezer controller to freeze processes of a task, issue a sigkill, then unfreeze. Previously the implementation assumed cgroups v1, and now it also supports cgroups v2. There is a bit of refactoring in this PR, but the fundamental design remains the same. Closes #12351 #12348
14 lines
331 B
Go
14 lines
331 B
Go
package resources
|
|
|
|
// A Containment will cleanup resources created by an executor.
|
|
type Containment interface {
|
|
// Apply enables containment on pid.
|
|
Apply(pid int) error
|
|
|
|
// Cleanup will purge executor resources like cgroups.
|
|
Cleanup() error
|
|
|
|
// GetPIDs will return the processes overseen by the Containment
|
|
GetPIDs() PIDs
|
|
}
|