open-nomad/drivers/shared/executor
Mahmood Ali d5e136b82b
executor: set CpuWeight in cgroup-v2 (#11287)
Cgroup-v2 uses `cpu.weight` property instead of cpu shares:
https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html#cpu-interface-files
. And it uses a different range (i.e. `[1, 10000]`) from cpu.shares
(i.e. `[2, 262144]`) to make things more interesting.

Luckily, the libcontainer provides a helper function to perform the
conversion
[`ConvertCPUSharesToCgroupV2Value`](https://pkg.go.dev/github.com/opencontainers/runc@v1.0.2/libcontainer/cgroups#ConvertCPUSharesToCgroupV2Value).

I have confirmed that docker/libcontainer performs the conversion as
well in
https://github.com/opencontainers/runc/blob/v1.0.2/libcontainer/specconv/spec_linux.go#L536-L541
, and that CpuShares is ignored by libcontainer in
https://github.com/opencontainers/runc/blob/v1.0.2/libcontainer/cgroups/fs2/cpu.go#L24-L29
.
2021-10-14 08:46:07 -04:00
..
proto drivers/exec: pass capabilities through executor RPC 2021-05-17 12:37:40 -06:00
test-resources/busybox tests: busybox only depends on arch 2019-01-07 08:36:32 -05:00
client.go executor: suppress spurious log messages (#11273) 2021-10-06 12:42:35 -04:00
exec_utils.go Apply some suggested fixes from staticcheck (#9598) 2020-12-10 07:29:18 -08:00
executor.go chore: fix incorrect docstring formatting. 2021-08-30 11:08:12 +02:00
executor_basic.go gofmt all the files 2021-10-01 10:14:28 -04:00
executor_linux.go executor: set CpuWeight in cgroup-v2 (#11287) 2021-10-14 08:46:07 -04:00
executor_linux_test.go drivers/exec: Don't inherit Nomad oom_score_adj value (#10698) 2021-06-03 14:15:50 -04:00
executor_plugin.go goimports 2019-01-22 15:44:31 -08:00
executor_test.go tests: copy permissions when copying files 2020-10-01 10:23:14 -04:00
executor_universal_linux.go deps: update runc to v1.0.0-rc93 2021-03-31 10:57:02 -04:00
executor_unix.go gofmt all the files 2021-10-01 10:14:28 -04:00
executor_windows.go default e.getAllPids in executor_basic 2019-07-18 10:57:27 -04:00
legacy_executor_wrapper.go Legacy executors are executors after all 2020-11-10 10:20:07 -05:00
libcontainer_nsenter_linux.go comment on using init() for libcontainer handling 2019-04-19 09:49:04 -04:00
pid_collector.go deps: bump gopsutil to v3.21.2 2021-03-30 16:02:51 -04:00
pid_collector_test.go drivers: Move client/drivers/executor to drivers/shared/executor 2018-11-30 10:46:13 +01:00
plugins.go driver: add pre09 migration logic 2019-01-18 18:31:01 -05:00
pty_unix.go gofmt all the files 2021-10-01 10:14:28 -04:00
pty_windows.go gofmt all the files 2021-10-01 10:14:28 -04:00
resource_container_default.go gofmt all the files 2021-10-01 10:14:28 -04:00
resource_container_linux.go resource_container_linux new getAllPidsByCgroup 2019-07-17 17:31:36 -04:00
server.go drivers/exec: pass capabilities through executor RPC 2021-05-17 12:37:40 -06:00
utils.go drivers/exec+java: Add task configuration to restore previous PID/IPC isolation behavior 2021-02-08 14:26:35 -06:00
utils_test.go drivers/exec+java: Add task configuration to restore previous PID/IPC isolation behavior 2021-02-08 14:26:35 -06:00
utils_unix.go gofmt all the files 2021-10-01 10:14:28 -04:00
utils_windows.go executor: merge plugin shim with executor package 2018-12-06 21:13:45 -05:00
z_executor_cmd.go drivers: remove duplicate import statements. 2021-06-11 09:38:09 +02:00