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 Go types for specification #51

Merged
merged 1 commit into from
Jul 2, 2015

Conversation

crosbymichael
Copy link
Member

This adds Go types implementing the configuration specification.

Closes #42

I also took the liberty to clean up the resource types because some of the names did not make sense at all and was pretty bad.

Signed-off-by: Michael Crosby [email protected]

@crosbymichael crosbymichael force-pushed the addtypes branch 2 times, most recently from 3450504 to f25e5fc Compare July 2, 2015 17:29
@LK4D4
Copy link
Contributor

LK4D4 commented Jul 2, 2015

LGTM

// Linux contains platform specific configuration for linux based containers.
type Linux struct {
// UidMapping specifies user mappings for supporting user namespaces on linux.
UidMapping []IDMapping `json:"uidMapping"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe pluralize like the other fields?

This adds Go types implementing the configuration specification.

Signed-off-by: Michael Crosby <[email protected]>
// Rlimits specifies rlimit options to apply to the container's process.
Rlimits []Rlimit `json:"rlimits"`
// SystemProperties are a set of key value pairs that are set for the container on start.
SystemProperties map[string]string `json:"systemProperties"`
Copy link
Contributor

Choose a reason for hiding this comment

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

If we get in opencontainers/runc#73 then might save the rename to sysctl after ;)
I can rebase later however :)

@mrunalp
Copy link
Contributor

mrunalp commented Jul 2, 2015

LGTM

mrunalp pushed a commit that referenced this pull request Jul 2, 2015
Add Go types for specification
@mrunalp mrunalp merged commit 89fbfc1 into opencontainers:master Jul 2, 2015
@crosbymichael crosbymichael deleted the addtypes branch July 2, 2015 20:44
wking added a commit to wking/opencontainer-runtime-spec that referenced this pull request Jul 12, 2017
It's backed by memory.oom_control, so this commit moves it in with
the rest of the memory-controller config.

Looking at the history, the initial request landing a setting for this
in the Docker/OCI ecosystem seems to be [1], which added
Cgroup.OomKillDisable.  That commit was carried from libcontainer into
runC [2] where it is now Resources.OomKillDisable [3].  From runC it
was carried into this repo (with some renaming) in [4].  Subsequent
early doc updates landed in [5,6].  In none of those can I find
discussion about why the setting is not already under memory.  I
expect the reason is that the runC structures are flat, so "under
memory" is not a thing there.  But in this spec, resources has
per-controller sub-properties.  The fact that disableOOMKiller
belonged to the memory controller may have been overlooked in [4] and
never revisited until now.

[1]: docker-archive/libcontainer#417
     Subject: cgroups: add support for oom control
[2]: opencontainers/runc@295c708
     Subject: cgroups: add support for oom control
[3]: https://github.com/opencontainers/runc/blob/v1.0.0-rc3/libcontainer/configs/cgroup_unix.go#L113-L114
[4]: opencontainers#51
     Subject: Add Go types for specification
[5]: opencontainers#137
     Subject: Adding cgroups path to the Spec.
[6]: opencontainers#199
     Subject: runtime: config: linux: add cgroups informations

Signed-off-by: W. Trevor King <[email protected]>
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.

3 participants