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

feature: independent runtime root #2748

Merged

Conversation

zhuangqh
Copy link
Contributor

Signed-off-by: zhuangqh zhuangqhc@gmail.com

Ⅰ. Describe what this PR did

put different runtime to independent runtime root.

First, distinguish different runtime files. Secondly, it enables v1 containerd-shim to know which runtime to go (hack).

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Signed-off-by: zhuangqh <zhuangqhc@gmail.com>
@codecov
Copy link

codecov bot commented Mar 14, 2019

Codecov Report

Merging #2748 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2748      +/-   ##
=========================================
- Coverage   69.43%   69.4%   -0.03%     
=========================================
  Files         277     277              
  Lines       17412   17412              
=========================================
- Hits        12090   12085       -5     
- Misses       4004    4009       +5     
  Partials     1318    1318
Flag Coverage Δ
#criv1alpha2_test 39.38% <100%> (ø) ⬆️
#integration_test_0 36.56% <100%> (-0.05%) ⬇️
#integration_test_1 35.8% <100%> (-0.02%) ⬇️
#integration_test_2 36.47% <100%> (-0.06%) ⬇️
#integration_test_3 35.55% <100%> (ø) ⬆️
#node_e2e_test 35.28% <100%> (-0.03%) ⬇️
#unittest 28.51% <0%> (ø) ⬆️
Impacted Files Coverage Δ
ctrd/container.go 56.59% <100%> (-0.96%) ⬇️
apis/server/utils.go 71.15% <0%> (-3.85%) ⬇️
cri/v1alpha2/cri.go 72.14% <0%> (+0.25%) ⬆️

@allencloud
Copy link
Collaborator

Sounds good!

@zhuangqh zhuangqh requested a review from Ace-Tang March 14, 2019 12:45
@@ -540,7 +541,7 @@ func (c *Client) createContainer(ctx context.Context, ref, id, checkpointDir str
containerd.WithContainerLabels(container.Labels),
containerd.WithRuntime(fmt.Sprintf("io.containerd.runtime.v1.%s", runtime.GOOS), &runctypes.RuncOptions{
Runtime: container.Runtime,
RuntimeRoot: runtimeRoot,
RuntimeRoot: path.Join(runtimeRoot, container.Runtime),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we first create this directory or someone would create it if non-exist?
Just confirm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we first create this directory or someone would create it if non-exist?
Just confirm.

The existence of the path and the security of the join are promised by runtime. 😄

@allencloud
Copy link
Collaborator

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Mar 15, 2019
@allencloud allencloud merged commit 8e84b8b into AliyunContainerService:master Mar 15, 2019
@Ace-Tang
Copy link
Contributor

We still should check if it is compatible for exist container

@Ace-Tang
Copy link
Contributor

I check the containerd shim will keep the runtime root, so it should not effect exist container

// Config contains shim specific configuration
type Config struct {
    Path          string
    Namespace     string
    WorkDir       string
    Criu          string
    RuntimeRoot   string
    SystemdCgroup bool
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature LGTM one maintainer or community participant agrees to merge the pull reuqest. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants