Skip to content

Conversation

@ZYecho
Copy link
Contributor

@ZYecho ZYecho commented Jun 19, 2019

Signed-off-by: zhangyue [email protected]

Ⅰ. Describe what this PR did

add a doc to describe this feature https://www.yuque.com/zhangyue-jlgo3/kb/epa5ml

Ⅱ. Does this pull request fix one issue?

None.

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

using current test case.

Ⅳ. Describe how to verify it

 ~/go/src/github.com/alibaba/pouch$ sudo pouch pull hello-world
hello-world:latest:                                                               resolved       |++++++++++++++++++++++++++++++++++++++| 
index-sha256:41a65640635299bab090f783209c1e3a3f11934cf7756b09cb2f1e02147c6ed8:    done           |++++++++++++++++++++++++++++++++++++++| 
manifest-sha256:92c7f9c92844bbbb5d0a101b22f7c2a7949e40f8ea90c8b3bc396879d95e899a: done           |++++++++++++++++++++++++++++++++++++++| 
layer-sha256:1b930d010525941c1d56ec53b97bd057a67ae1865eebf042686d2a2d18271ced:    done           |++++++++++++++++++++++++++++++++++++++| 
config-sha256:fce289e99eb9bca977dae136fbe2a82b6b7d4c372474c9235adc1741675f587e:   done           |++++++++++++++++++++++++++++++++++++++| 
elapsed: 2.1 s 

sudo ctr -a /var/run/containerd.sock content ls | grep 1b930d010525941c1d56ec53b97bd057a67ae1865eebf042686d2a2d18271ced
sha256:1b930d010525941c1d56ec53b97bd057a67ae1865eebf042686d2a2d18271ced	977 B	2 minutes	containerd.io/uncompressed=sha256:af0b15c8625bb1938f1d7b17081031f649fd14e6b233688eea3c5483994a66a3

hello-world only has one layer, and we can see that the layer don't any any fc ref point to it, so it will be deleted by containerd gc.

and other content keep original

sudo ctr -a /var/run/containerd.sock content ls
DIGEST									SIZE	AGE		LABELS
sha256:1b930d010525941c1d56ec53b97bd057a67ae1865eebf042686d2a2d18271ced	977 B	2 seconds	containerd.io/uncompressed=sha256:af0b15c8625bb1938f1d7b17081031f649fd14e6b233688eea3c5483994a66a3
sha256:41a65640635299bab090f783209c1e3a3f11934cf7756b09cb2f1e02147c6ed8	2.13 kB	3 seconds	containerd.io/gc.ref.content.0=sha256:92c7f9c92844bbbb5d0a101b22f7c2a7949e40f8ea90c8b3bc396879d95e899a,containerd.io/gc.ref.content.2=sha256:d1fd2e204af0a2bca3ab033b417b29c76d7950ed29a44e427d1c4d07d14f04f9,containerd.io/gc.ref.content.4=sha256:5a4bdadd9acd8779ed6fcf007a4e7ed7f919056a92c3c67824b4fded06ef0a6e,containerd.io/gc.ref.content.6=sha256:577ad4331d4fac91807308da99ecc107dcc6b2254bc4c7166325fd01113bea2a,containerd.io/gc.ref.content.8=sha256:26cbbd7458900f0d0e7bf460a08ebcb79c185b4a6c7a2c5eb45ea688cd7140c2,containerd.io/gc.ref.content.7=sha256:b0735fcb32a0e9f647c8758bfce2bf8b0e71a097549c7d3945d9ad978fd0dfec,containerd.io/gc.ref.content.1=sha256:1e44d8bca6fb0464794555e5ccd3a32e2a4f6e44a20605e4e82605189904f44d,containerd.io/gc.ref.content.3=sha256:d0d4c5389b53875b0f2364f94c466f77cf6f02811fb02f0477b97d609fb50568,containerd.io/gc.ref.content.5=sha256:12cf9ef90835465316cb0b3729c36bfd8654d7f2f697e23432fddfaa7d7e31b5
sha256:92c7f9c92844bbbb5d0a101b22f7c2a7949e40f8ea90c8b3bc396879d95e899a	524 B	3 seconds	containerd.io/gc.ref.content.0=sha256:fce289e99eb9bca977dae136fbe2a82b6b7d4c372474c9235adc1741675f587e
sha256:fce289e99eb9bca977dae136fbe2a82b6b7d4c372474c9235adc1741675f587e	1.51 kB	3 seconds	containerd.io/gc.ref.snapshot.overlayfs=sha256:af0b15c8625bb1938f1d7b17081031f649fd14e6b233688eea3c5483994a66a3

Ⅴ. Special notes for reviews

when manifest is in schema 1 (application/vnd.docker.distribution.manifest.v1+prettyjws), this feature is not enable now.

@codecov
Copy link

codecov bot commented Jun 19, 2019

Codecov Report

Merging #2915 into master will increase coverage by 0.04%.
The diff coverage is 69.28%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2915      +/-   ##
=========================================
+ Coverage   68.85%   68.9%   +0.04%     
=========================================
  Files         291     291              
  Lines       18259   18387     +128     
=========================================
+ Hits        12573   12670      +97     
- Misses       4231    4247      +16     
- Partials     1455    1470      +15
Flag Coverage Δ
#criv1alpha2_test 38.68% <67.14%> (+0.34%) ⬆️
#integration_test_0 36.41% <62.14%> (+0.15%) ⬆️
#integration_test_1 35.84% <62.14%> (+0.17%) ⬆️
#integration_test_2 36.39% <62.14%> (+0.2%) ⬆️
#integration_test_3 35.93% <64.28%> (+0.19%) ⬆️
#node_e2e_test 34.43% <67.14%> (+0.22%) ⬆️
#unittest 27.78% <0%> (-0.23%) ⬇️
Impacted Files Coverage Δ
daemon/mgr/image.go 61.72% <100%> (+0.35%) ⬆️
ctrd/image.go 67.74% <69.06%> (+0.21%) ⬆️
apis/server/utils.go 71.15% <0%> (-3.85%) ⬇️
daemon/mgr/container.go 59.72% <0%> (-0.63%) ⬇️
cri/v1alpha2/cri.go 68.81% <0%> (-0.26%) ⬇️
ctrd/container.go 53.91% <0%> (+0.38%) ⬆️
cri/stream/runtime.go 70.23% <0%> (+2.38%) ⬆️
ctrd/watch.go 78.37% <0%> (+5.4%) ⬆️
cri/stream/portforward/httpstream.go 77.77% <0%> (+6.83%) ⬆️
ctrd/snapshotter_key.go 100% <0%> (+10%) ⬆️

@ZYecho ZYecho force-pushed the reverse-fetch-unpack branch 4 times, most recently from 7993700 to e7ac6a9 Compare June 19, 2019 10:29
@ZYecho ZYecho force-pushed the reverse-fetch-unpack branch from e7ac6a9 to 4a7fddb Compare June 19, 2019 12:07
@ZYecho ZYecho changed the title [wip]feature: stat snapshot before fetch feature: stat snapshot before fetch Jun 19, 2019
@ZYecho ZYecho closed this Jun 21, 2019
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.

2 participants