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

Add oom-score-adj option while running #1255

Merged
merged 1 commit into from
Jul 23, 2022

Conversation

manugupt1
Copy link
Contributor

@manugupt1 manugupt1 commented Jul 22, 2022

This PR adds support for --oom-score-adj on
root mode only.

Testing details

➜  nerdctl git:(oom-score-adj) ✗ make && sudo make install && go test -v ./cmd/... -exec sudo -run TestRunWithOOMScoreAdj
GO111MODULE=on CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w -X github.com/containerd/nerdctl/pkg/version.Version=v0.21.0-143-g825e6f1 -X github.com/containerd/nerdctl/pkg/version.Revision=825e6f13da817e7c706eb0a52aa1ac5173186d19"  -o /home/manu/go/src/github.com/containerd/nerdctl/_output/nerdctl github.com/containerd/nerdctl/cmd/nerdctl
[sudo] password for manu: 
install -D -m 755 /home/manu/go/src/github.com/containerd/nerdctl/_output/nerdctl /usr/local/bin/nerdctl
install -D -m 755 /home/manu/go/src/github.com/containerd/nerdctl/extras/rootless/containerd-rootless.sh /usr/local/bin/containerd-rootless.sh
install -D -m 755 /home/manu/go/src/github.com/containerd/nerdctl/extras/rootless/containerd-rootless-setuptool.sh /usr/local/bin/containerd-rootless-setuptool.sh
test target: "nerdctl"
=== RUN   TestRunWithOOMScoreAdj
=== PAUSE TestRunWithOOMScoreAdj
=== CONT  TestRunWithOOMScoreAdj
--- PASS: TestRunWithOOMScoreAdj (0.33s)
PASS
ok      github.com/containerd/nerdctl/cmd/nerdctl       0.351s
➜  nerdctl git:(oom-score-adj) ✗ 

Signed-off-by: Manu Gupta [email protected]

@@ -331,3 +332,14 @@ func TestRunWithFluentdLogDriverWithLogOpt(t *testing.T) {
assert.Equal(t, true, strings.Contains(logData, "test2"))
assert.Equal(t, true, strings.Contains(logData, inspectedContainer.ID))
}

func TestRunWithOOMScoreAdj(t *testing.T) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it works well on docker because I have docker added in the sudo'ers group.
Code here shows rootless mode cannot be supported: https://github.com/moby/moby/blob/cf867587b9dc8edf92efd8372fcc6f86f117e386/daemon/daemon_unix.go#L1642-L1656

README.md Show resolved Hide resolved
@manugupt1 manugupt1 marked this pull request as ready for review July 22, 2022 02:59
Copy link
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Green after rerun 6 times...

LGTM

@AkihiroSuda AkihiroSuda added this to the v0.22.1 milestone Jul 22, 2022
cmd/nerdctl/run_linux.go Outdated Show resolved Hide resolved
@fahedouch
Copy link
Member

fahedouch commented Jul 22, 2022

Green after rerun 6 times...

LGTM

@fuweid Do you remember what is this most failed job ?

This PR adds support for --oom-score-adj on
root mode only.

Signed-off-by: Manu Gupta <[email protected]>
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@fuweid
Copy link
Member

fuweid commented Jul 23, 2022

Green after rerun 6 times...

LGTM

@fuweid Do you remember what is this most failed job ?

sorry, I should record it. Will post or file issue to track flaky cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants