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 a new container runtime interface #25899

Merged
merged 1 commit into from
Jul 1, 2016

Conversation

yujuhong
Copy link
Contributor

This PR includes a proposal and a Go file to re-define the container runtime interface.
This is based on the original doc: https://docs.google.com/document/d/1ietD5eavK0aTuMQTw6-21r67UU73_vqYSUIPFdA0J5Q/

The umbrella issues is #22964

/cc @kubernetes/sig-node

@yujuhong yujuhong added the sig/node Categorizes an issue or PR as relevant to SIG Node. label May 19, 2016
@k8s-github-robot k8s-github-robot added kind/design Categorizes issue or PR as related to design. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. release-note-label-needed labels May 19, 2016
@vishh
Copy link
Contributor

vishh commented May 19, 2016

cc @mrunalp

@dchen1107
Copy link
Member

cc/ @philips @jonboulle @yifan-gu @euank from coreos / rkt
cc/ @smarterclayton @derekwaynecarr @timothysc @mrunalp from redhat and runc integration
cc/ @feiskyer @resouer from hyper.sh and hyperd integration
cc/ @krobertson from Apcera

@yifan-gu
Copy link
Contributor

cc @tmrts @s-urbaniak

Pull(image ImageSpec, auth AuthConfig) error
Remove(image ImageSpec) error
Status(image ImageSpec) (Image, error)
Metrics(image ImageSpec) (ImageMetrics, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: spacing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will fix it. thanks

@vishh
Copy link
Contributor

vishh commented May 19, 2016

@yujuhong Would it be useful to mention explicitly that this PR is not intended to be the final API / interface and that the individual fields/features can be fixed/updated/improved in subsequent PRs?

}

// Namespaces contains paths to the namespaces.
type Namespaces struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should probably include paths to all shared namespaces for completeness.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can approach this in two different ways. One is, as you suggested, returning everything for completeness. The other is to add fields when we need it. I went with the second approach, and we can iterate and add more fields if required.

@yifan-gu yifan-gu added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 1, 2016
@yujuhong
Copy link
Contributor Author

yujuhong commented Jul 1, 2016

I recognize that there are still some concerns, but we're not going to get anything done here. We should take additional discussion either into new issues or into other communication forms. I'm sending out an email to sig-node today to try and kick off that discussion.

+1. There is no way we can have effective discussions on this PR anymore. Let's open up separate issues/PRs for a more focused discussion.

@dchen1107
Copy link
Member

LGTM

We carried a lot of good discussion through the PR and identified several issues. But at the high level, I didn't see much progress through this pr any more.

@k8s-bot
Copy link

k8s-bot commented Jul 1, 2016

GCE e2e build/test passed for commit 96c0103455f27a974085e9a2fc4148f669ac4dec.

@tmrts
Copy link
Contributor

tmrts commented Jul 1, 2016

It seems like I wasn't able to communicate my intentions well. I meant addressing the comments of other people so that theirs don’t get lost and carry the discussion about my concerns to another PR. I agree with 100% with the recent comments 👍

This commit includes a proposal and a Go file to re-define the container
runtime interface.

Note that this is an experimental interface and is expected to go through
multiple revisions once developers start implementing against it. As stated in
the proposal, there are also individual issues to carry discussions of
specific features.
@yujuhong
Copy link
Contributor Author

yujuhong commented Jul 1, 2016

Updated the boillerplate to the new style. Reapplying the lgtm.

@yujuhong yujuhong added lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Jul 1, 2016
@k8s-bot
Copy link

k8s-bot commented Jul 1, 2016

GCE e2e build/test passed for commit 08dc661.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit fb19362 into kubernetes:master Jul 1, 2016
@erictune erictune mentioned this pull request Jul 11, 2016
12 tasks
k8s-github-robot pushed a commit that referenced this pull request Jul 12, 2016
Automatic merge from submit-queue

Proposal: client/server container runtime

Ref #25899  #13768 

Proposal for client/server container runtime

CC @brendandburns @dchen1107 @kubernetes/goog-node @kubernetes/sig-node

// Linux contains configurations specific to Linux hosts.
Linux *LinuxPodSandboxConfig
}
Copy link
Contributor

@runcom runcom Jul 15, 2016

Choose a reason for hiding this comment

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

is there any particular issue in having an User property in PodSandboxConfig above? OCI would want to specify an user in the config.json as part of running a container with a specified user. Having the CRI proto to support that would let OCI containers to run with a particular user. @mrunalp @yujuhong @vishh

Copy link
Contributor

Choose a reason for hiding this comment

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

Since the securityContext of a container can have a runAsUser, we need something in this interface to be able to handle that. However, I think it should be solely part of a container's config, not pod sandbox.

Want to file a followup issue or make a PR to add this and discuss there instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that adding this at the container level makes sense. PodSandbox could be left upto the runtime.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 I'll make a PR to discuss that then

Copy link
Contributor

Choose a reason for hiding this comment

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

BTW, @euank sorry for the confusion, I did mean ContainerConfig not PodSandboxConfig

Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for adding user to container config.

// Mounts specifies mounts for the container
Mounts []Mount
// Labels are key value pairs that may be used to scope and select individual resources.
Labels Labels
Copy link
Member

Choose a reason for hiding this comment

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

From where do these labels come?
What if the container runtime needs to know the origin of this container in k8s API terms, such as k8s namespace, k8s pod name, and user container name in the pod --- how could the runtime know those?

Copy link
Contributor

@euank euank Jul 19, 2016

Choose a reason for hiding this comment

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

This interface abstracts those details away. Those labels realistically do contain such information, but it's an internal contract for the kubelet to use for itself only, not something the runtime is supposed to interpret in any way.

Right now those come mostly from here iirc and are used for things like calculating restart count and checkpointing data.

The interface explicitly does not express more to the runtime than it needs to know.

That being said, a sufficiently smart runtime could lookup a container it manages in the kubelet's pods endpoint based on its container ID I expect.
Realistically though, k8s namespaces and pod names and so on are all higher level details that the runtime should not have to care about.

k8s-github-robot pushed a commit that referenced this pull request Jul 22, 2016
Automatic merge from submit-queue

CRI: add LinuxUser to LinuxContainerConfig

Following discussion in #25899 (comment)

The Container Runtime Interface should provide runtimes with User information to run the container process as (OCI being one of them).
This patch introduces a new field `user` into `LinuxContainerConfig` structure. The `user` field introduces also a new type structure `LinuxUser` which consists of `uid`, `gid` and `additional_gids`. 

The `LinuxUser` struct has been embedded into `LinuxContainerConfig` to leave space for future implementations which are not Linux-related (e.g. Windows may have a different representation of _Users_).

If you feel naming can be better we can probably move `LinuxUser` to `UnixUser` also. 

/cc @mrunalp @vishh @euank @yujuhong 

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
@yujuhong yujuhong deleted the ncri branch September 21, 2016 00:15
xingzhou pushed a commit to xingzhou/kubernetes that referenced this pull request Dec 15, 2016
…er-proposal

Automatic merge from submit-queue

Proposal: client/server container runtime

Ref kubernetes#25899  kubernetes#13768 

Proposal for client/server container runtime

CC @brendandburns @dchen1107 @kubernetes/goog-node @kubernetes/sig-node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/design Categorizes issue or PR as related to design. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. sig/node Categorizes an issue or PR as relevant to SIG Node. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet