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: split image pull interface #2608

Merged
merged 1 commit into from
Dec 26, 2018
Merged

feature: split image pull interface #2608

merged 1 commit into from
Dec 26, 2018

Conversation

Ace-Tang
Copy link
Contributor

Actually, there is no real Pull interface in containerd, image pull
do not need to unpack but only run a container need. Split Pull
operation into two operations, fetch and unpack. Let pouchd deal with
pulled image.

Signed-off-by: Ace-Tang aceapril@126.com

Ⅰ. Describe what this PR did

Ⅱ. 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

@codecov
Copy link

codecov bot commented Dec 24, 2018

Codecov Report

Merging #2608 into master will decrease coverage by <.01%.
The diff coverage is 86.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2608      +/-   ##
==========================================
- Coverage   69.45%   69.44%   -0.01%     
==========================================
  Files         279      279              
  Lines       18833    18834       +1     
==========================================
- Hits        13080    13079       -1     
+ Misses       4287     4286       -1     
- Partials     1466     1469       +3
Flag Coverage Δ
#criv1alpha1test 31.86% <40.9%> (-0.01%) ⬇️
#criv1alpha2test 36.14% <40.9%> (-0.08%) ⬇️
#integrationtest 41.21% <86.36%> (+0.11%) ⬆️
#nodee2etest 33.21% <86.36%> (-0.13%) ⬇️
#unittest 26.78% <0%> (-0.01%) ⬇️
Impacted Files Coverage Δ
ctrd/image.go 78.18% <100%> (-0.95%) ⬇️
daemon/mgr/image.go 60.05% <83.33%> (+0.42%) ⬆️
daemon/mgr/snapshot.go 89.85% <0%> (-4.35%) ⬇️
apis/server/utils.go 71.15% <0%> (-3.85%) ⬇️
pkg/meta/store.go 67.44% <0%> (-1.56%) ⬇️
cri/v1alpha2/cri_wrapper.go 65.59% <0%> (-1.21%) ⬇️
cri/v1alpha2/cri.go 69.05% <0%> (-0.87%) ⬇️
daemon/mgr/container_utils.go 83.92% <0%> (-0.6%) ⬇️
ctrd/container.go 58.89% <0%> (-0.4%) ⬇️
daemon/mgr/container.go 59.42% <0%> (+0.21%) ⬆️
... and 6 more

@chuanchang
Copy link
Contributor

LGTM

Copy link
Contributor

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

oops. I miss that. If there is any error from unpack and StoreImageReference, we should send it to the stream. Otherwise, the user doesn't know failure during the unpack.

And we can't close stream in the FetchImage. it should be closed at outside.

https://github.com/alibaba/pouch/blob/2e1112858fcf9c2e32b36a58d69023ca138939a8/ctrd/image.go#L220-L245

@Ace-Tang
Copy link
Contributor Author

@fuweid , I move close json stream to daemon package

Actually, there is no real Pull interface in containerd, image pull
do not need to unpack but only run a container need. Split Pull
operation into two operations, fetch and unpack. Let pouchd deal with
pulled image.

Signed-off-by: Ace-Tang <aceapril@126.com>
Copy link
Contributor

@fuweid fuweid left a comment

Choose a reason for hiding this comment

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

LGTM

@fuweid fuweid merged commit 28bca82 into AliyunContainerService:master Dec 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants