Skip to content

cri-integration tests: Pull images once#5313

Merged
fuweid merged 1 commit intocontainerd:masterfrom
claudiubelu:pull-images-once
May 13, 2021
Merged

cri-integration tests: Pull images once#5313
fuweid merged 1 commit intocontainerd:masterfrom
claudiubelu:pull-images-once

Conversation

@claudiubelu
Copy link
Copy Markdown
Contributor

@claudiubelu claudiubelu commented Apr 6, 2021

Most of the tests are pulling and deleting the same test images, which can be quite inefficient, especially on Windows nodes, where the images are larger than the Linux ones (a nanoserver Container image is ~250MB in size). We can instead pull them
only once, and reuse them. This will reduce the test run time on Windows considerably.

Additionally, some of the test images are currently hosted on dockerhub (busybox image), which has introduced image ratelimiting in November 2020, which means that test runners could potentially hit that limit faster with the current implementation. This will reduce that risk.

Some tests are specifically deleting images, so we always have to ensure that they are pulled.

@k8s-ci-robot
Copy link
Copy Markdown

Hi @claudiubelu. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 6, 2021

Build succeeded.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 6, 2021

Build succeeded.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 12, 2021

Build succeeded.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 19, 2021

Build succeeded.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 19, 2021

Build succeeded.

@claudiubelu claudiubelu changed the title WIP: Pull images once cri-integration tests: Pull images once Apr 19, 2021
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 19, 2021

Build succeeded.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 20, 2021

Build succeeded.

@kzys
Copy link
Copy Markdown
Member

kzys commented Apr 21, 2021

I think we will merge #5403 before this change.

@claudiubelu claudiubelu force-pushed the pull-images-once branch 3 times, most recently from c9f71dc to a104d48 Compare April 28, 2021 09:09
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 28, 2021

Build succeeded.

Most of the tests are pulling and deleting the same test images, which
can be quite inefficient, especially on Windows nodes, where the images
are larger than the Linux ones (a nanoserver Container image is ~250MB
in size). We can instead pull them only once, and reuse them. This will
reduce the test run time on Windows considerably.

Additionally, some of the test images are currently hosted on dockerhub
(busybox image), which has introduced image ratelimiting in November 2020,
which means that test runners could potentially hit that limit faster with
the current implementation. This will reduce that risk.

Some tests are specifically deleting images, so we always have to ensure
that they are pulled.

Signed-off-by: Claudiu Belu <[email protected]>
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 28, 2021

Build succeeded.

Comment on lines -55 to -57
defer func() {
assert.NoError(t, imageService.RemoveImage(&runtime.ImageSpec{Image: img}))
}()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We no longer remove images after this change. I'm personally fine but want to highlight the behavior change just in case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

yeah, I think that was the purpose of the PR--to simply reuse images throughout the test run rather than keep removing, re-pulling on various tests. On Windows these images can be much larger, so has more impact.

Copy link
Copy Markdown
Member

@kzys kzys left a comment

Choose a reason for hiding this comment

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

LGTM!

/ok-to-test

Copy link
Copy Markdown
Member

@estesp estesp 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
Copy link
Copy Markdown
Member

fuweid commented May 13, 2021

The change LGTM.

Since we doesn't add t.Parallel() in integration/ folder, the pull image once is ok.

@fuweid
Copy link
Copy Markdown
Member

fuweid commented May 13, 2021

Thanks @claudiubelu !

@fuweid fuweid merged commit c7e4747 into containerd:master May 13, 2021
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