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 docker-shim package #29553

Merged
merged 2 commits into from
Jul 29, 2016
Merged

Conversation

yujuhong
Copy link
Contributor

Add a new docker integration with kubelet using the new runtime API.
This change adds the package with the skeleton and implements some of the basic operations.

This PR only implements a small sets of functions. The rest of the functions will be implemented
in the followup PRs to keep the changes readable, and the reviewers sane.

Note: The first commit is from #28396, only the second commit is for review.

/cc @kubernetes/sig-node @feiskyer @Random-Liu

@yujuhong yujuhong added the sig/node Categorizes an issue or PR as relevant to SIG Node. label Jul 25, 2016
@k8s-github-robot k8s-github-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. release-note-label-needed labels Jul 25, 2016
@yujuhong yujuhong added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels Jul 25, 2016
@yujuhong
Copy link
Contributor Author

@k8s-bot test this issue: #29451

for k, v := range config.GetAnnotations() {
if _, ok := labels[k]; !ok {
// Only write to labels if the key doesn't exist.
labels[k] = v
Copy link
Member

Choose a reason for hiding this comment

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

In this way, it is impossible to get annotations back. Maybe save all annotations inside one label, e.g. io.kubernetes.container.annotations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I have a TODO for that.

Copy link
Member

Choose a reason for hiding this comment

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

Use a prefix to distinguish labels and annotations. Or else when get container status how do we know which is label, which is annotation? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a TODO for that.

@errordeveloper
Copy link
Member

errordeveloper commented Jul 27, 2016

This looks interesting, but it's unclear what's the motivation for this exactly, is there a meta issue in features repo or anything like that?

@yujuhong
Copy link
Contributor Author

Addressed comments and fixed the boilerplate issue. PTAL. Thanks!

@yujuhong
Copy link
Contributor Author

This looks interesting, but it's unclear what's the motivation for this exactly, is there a meta issue in features repo or anything like that?

@errordeveloper, we are migrating all the runtime integration to the new interface. kubernetes/enhancements#54

}

if filter.LabelSelector != nil {
for k, v := range filter.LabelSelector {
Copy link
Member

Choose a reason for hiding this comment

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

We should add ("label", "k=v") here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. I saw the documentation but forgot to correct it. Done.

I need to find a good way to test this code.

return
}

func generateMountBindings(mounts []*runtimeApi.Mount) (result []string) {
Copy link
Member

Choose a reason for hiding this comment

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

Port original comment here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@Random-Liu
Copy link
Member

LGTM with nits.

@yujuhong yujuhong force-pushed the docker-shim branch 2 times, most recently from ce2e190 to 66e0fb5 Compare July 28, 2016 01:03
// ImageManagerService interface defines the interfaces that should be implemented
// by a container image manager.
// Thread safety is required from implementations of this interface.
// ImageManagerService interface should be implemented a container image
Copy link
Member

Choose a reason for hiding this comment

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

s/implemented/implemented by

Add a new docker integration with kubelet using the new runtime API.
This change adds the package with some skeletons, and implements some
of the basic operations.
@Random-Liu
Copy link
Member

LGTM. @dchen1107 Do you want to take another look?

@feiskyer
Copy link
Member

LGTM. We can make kuberuntime.go in together with this PR for unblocking docker-shim and gRPC implementation #29623.

@errordeveloper
Copy link
Member

@errordeveloper, we are migrating all the runtime integration to the new interface.

@yujuhong thank you for the pointer to feature issue. I am also really quite curious about the benefits of docker-shim... I know in Docker it provides the way to track children of dockerd, but it must help kubelet as well, right?

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

Applied lgtm based on the reviews to unblock other PRs.
The code is not currently in use, so @dchen1107, let me know if you want any changes. I'll upload a separate PR to address them.

@yujuhong
Copy link
Contributor Author

@yujuhong thank you for the pointer to feature issue. I am also really quite curious about the benefits of docker-shim... I know in Docker it provides the way to track children of dockerd, but it must help kubelet as well, right?

@errordeveloper I think there is some misunderstanding -- the shim is to make docker client library conform to the new interface kubelet uses. The docker shim in this PR still calls docker daemon to perform operations.

@dchen1107
Copy link
Member

LGTM

@yujuhong
Copy link
Contributor Author

LGTM

Thanks for the rubberstamp :)

@k8s-bot
Copy link

k8s-bot commented Jul 29, 2016

GCE e2e build/test passed for commit 03d11bc.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 7aa592b into kubernetes:master Jul 29, 2016
@errordeveloper
Copy link
Member

The docker shim in this PR still calls docker daemon to perform operations.

@yujuhong ah, so I have just checked and what I was thinking of is containerd-shim. Sorry for the confusion.

@yujuhong
Copy link
Contributor Author

@yujuhong ah, so I have just checked and what I was thinking of is containerd-shim. Sorry for the confusion.

No problem. There is on-going runc integration which doesn't use containerd at all. You can check out the proposal in #26788

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

dockershim: Implement more functions.

Based on #29553. Only the last two commits are new.
@yujuhong yujuhong deleted the docker-shim branch September 21, 2016 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

8 participants