-
Notifications
You must be signed in to change notification settings - Fork 2k
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
rkt: create parent cgroup to enable stats #4188
Conversation
Having the Nomad executor create parent cgroups that rkt is launched within allows the stats collection code used for the exec driver to Just Work. The only downside is that now the Nomad executor's resource utilization counts against the cgroups resource limits just as it does for the exec driver.
@@ -194,7 +194,10 @@ func rktGetDriverNetwork(uuid string, driverConfigPortMap map[string]string, log | |||
return nil, lastErr | |||
} | |||
|
|||
// This is a successful landing. | |||
// This is a successful landing; log if its not the first attempt. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a test we can add to ensure stats work?
Added a test and modernized rkt tests a bit more. Also removed the env var required to run them as we already require Linux + root + rkt installed. Since it's an officially supported driver we probably shouldn't skip the tests by default. |
client/testutil/driver_compatible.go
Outdated
func RktCompatible(t *testing.T) { | ||
if runtime.GOOS == "windows" || syscall.Geteuid() != 0 { | ||
t.Skip("Must be root on non-windows environments to run test") | ||
t.Skip("Must be root on non-Windows environments to run test") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would also try on Darwin
client/testutil/driver_compatible.go
Outdated
rktOnce.Do(func() { | ||
out, err := exec.Command("rkt", "version").CombinedOutput() | ||
if err == nil { | ||
t.Logf("found rkt version: %s", out) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this log?
Remove the NOMAD_TEST_RKT flag as a guard for rkt tests. Still require Linux, root, and rkt to be installed. Only check for rkt installation once in hopes of speeding up rkt tests a bit.
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. |
Fixes #2400
Having the Nomad executor create parent cgroups that rkt is launched
within allows the stats collection code used for the exec driver to Just
Work. The only downside is that now the Nomad executor's resource
utilization counts against the cgroups resource limits just as it does
for the exec driver.