-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
libcontainer: export and add new methods to allow cgroups manipulation #2177
Merged
crosbymichael
merged 2 commits into
opencontainers:master
from
devimc:topic/libcontainer/kata-containers
Jan 2, 2020
Merged
libcontainer: export and add new methods to allow cgroups manipulation #2177
crosbymichael
merged 2 commits into
opencontainers:master
from
devimc:topic/libcontainer/kata-containers
Jan 2, 2020
Conversation
This file contains 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
devimc
force-pushed
the
topic/libcontainer/kata-containers
branch
from
December 6, 2019 17:10
70ed2ca
to
ed50637
Compare
ping @mrunalp |
egernst
reviewed
Dec 13, 2019
@@ -46,6 +46,9 @@ type Manager interface { | |||
|
|||
// Sets the cgroup as configured. | |||
Set(container *configs.Config) error | |||
|
|||
// Gets the cgroup as configured. | |||
GetCgroups() (*configs.Cgroup, error) |
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.
Hey @devimc:
- nit: s/splications/applications on your commit message.
- Can you better explain the intended use case, highlighting why this is needed? Specific to the Kata case (in both v2-shim and CLI based configurations), what do we do with the cgroup config? Do we need to store a copy of the information, or can it be obtained as needed later? It just isn't clear to me. thx!
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.
done, thanks
devimc
force-pushed
the
topic/libcontainer/kata-containers
branch
from
December 17, 2019 22:45
ed50637
to
7897de1
Compare
A `config.Cgroups` object is required to manipulate cgroups v1 and v2 using libcontainer. Export `createCgroupConfig` to allow API users to create `config.Cgroups` objects using directly libcontainer API. Signed-off-by: Julio Montes <julio.montes@intel.com>
`configs.Cgroup` contains the configuration used to create cgroups. This configuration must be saved to disk, since it's required to restore the cgroup manager that was used to create the cgroups. Add method to get cgroup configuration from cgroup Manager to allow API users save it to disk and restore a cgroup manager later. fixes opencontainers#2176 Signed-off-by: Julio Montes <julio.montes@intel.com>
devimc
force-pushed
the
topic/libcontainer/kata-containers
branch
from
December 17, 2019 22:46
7897de1
to
8ddd892
Compare
1 similar comment
AkihiroSuda
added a commit
to AkihiroSuda/runc
that referenced
this pull request
Jan 14, 2020
A new method was added to the cgroup interface when opencontainers#2177 was merged. After opencontainers#2177 got merged, opencontainers#2169 was merged without rebase (sorry!) and compilation was failing: libcontainer/cgroups/fs2/fs2.go:208:22: container.Cgroup undefined (type *configs.Config has no field or method Cgroup) Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
adrianreber
pushed a commit
to adrianreber/runc
that referenced
this pull request
Feb 10, 2020
A new method was added to the cgroup interface when opencontainers#2177 was merged. After opencontainers#2177 got merged, opencontainers#2169 was merged without rebase (sorry!) and compilation was failing: libcontainer/cgroups/fs2/fs2.go:208:22: container.Cgroup undefined (type *configs.Config has no field or method Cgroup) Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
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.
libcontainer: export createCgroupConfig
A
config.Cgroups
object is required to manipulate cgroups v1 and v2 usinglibcontainer.
Export
createCgroupConfig
to allow API users to createconfig.Cgroups
objects using directly libcontainer API.
libcontainer: add method to get cgroup config from cgroup Manager
configs.Cgroup
contains the configuration used to create cgroups. Thisconfiguration must be saved to disk, since it's required to restore the
cgroup manager that was used to create the cgroups.
Add method to get cgroup configuration from cgroup Manager to allow API users
save it to disk and restore a cgroup manager later.
fixes #2176