Add OOM adjustment flag to hostconfig via swarmctl cli - #3177
Merged
Conversation
The module path for swarmd is not valid for the location of the swarmd
module within the swarmkit repo. The go command resolves package paths
to the swarmkit/v2 module and fails when the packages don't exist.
$ go run github.com/moby/swarmkit/v2/swarmd/cmd/swarm-rafttool@master
go: github.com/moby/swarmkit/v2/swarmd/cmd/swarm-rafttool@master: module github.com/moby/swarmkit/v2@master found (v2.0.0-20240227173239-911c97650f2e), but does not contain package github.com/moby/swarmkit/v2/swarmd/cmd/swarm-rafttool
(This is only a problem when swarmd is not the main module.)
Fix the swarmd module's path to align with the module source location so
that `go run` can once again be used to invoke swarm-rafttool and the
other commands.
Signed-off-by: Cory Snider <csnider@mirantis.com>
Signed-off-by: plaurent <patrick@saint-laurent.us>
Signed-off-by: plaurent <patrick@saint-laurent.us>
dperny
requested changes
Jun 7, 2024
| Resources limits = 1; | ||
| Resources reservations = 2; | ||
|
|
||
|
|
Collaborator
There was a problem hiding this comment.
Unnecessary edits in this file.
| // is equivalent to passing --ulimit to docker run. | ||
| repeated Ulimit ulimits = 29; | ||
|
|
||
| int64 oom_score_adj = 30; |
Collaborator
There was a problem hiding this comment.
Please add a comment, in the fashion of the comments above, explaining what the field does. These end up as godoc comments, so the comment should start with something like
// OomScoreAdj <sets/defines/verbs>Signed-off-by: plaurent <patrick@saint-laurent.us>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did
Add kernel level tuning flag for OOM adjustment to hostconfig via swarmctl cli
- How I did it
I added flags to swarmctl modified the API to include oom-score-adj flag.
- How to test it
After starting swarmd, run
swarmctl service create --name <service_name> --oom-score-adj --image <image_name>
Verify oom-score-adj works correctly by inspecting the container
docker container inspect <container_name>
The Hostconfig, OomScoreAdj value should be set to the value you specified via swarmctl
- Description for the changelog
Add OOM adjustment flag to hostconfig via swarmctl cli