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

CRI Pinned image support #7944

Merged
merged 1 commit into from
Jun 11, 2023
Merged

CRI Pinned image support #7944

merged 1 commit into from
Jun 11, 2023

Conversation

adisky
Copy link
Contributor

@adisky adisky commented Jan 10, 2023

Signed-off-by: Aditi Sharma adi.sky17@gmail.com

This PR marks containerd sandbox/pause image as Pinned image, pinned images are not garbage collected by Kubelet.
Currently it only marks sandbox image as pinned.

fixes: #6352

@k8s-ci-robot
Copy link

Hi @adisky. 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.

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.

pkg/cri/labels/labels.go Outdated Show resolved Hide resolved
@adisky
Copy link
Contributor Author

adisky commented Jan 10, 2023

@dcantah Thanks for review, do you have any idea why sandboxed tests are getting failed? they are failing in general or only on this PR?

@adisky
Copy link
Contributor Author

adisky commented Jan 10, 2023

cc @SergeyKanzhelev @mikebrow

@ruiwen-zhao
Copy link
Member

@dcantah Thanks for review, do you have any idea why sandboxed tests are getting failed? they are failing in general or only on this PR?

The sandboxed test will run the same integration test with sandbox servers. So I think you need to make the same changes on pkg/cri/sbserver as well.

@samuelkarp
Copy link
Member

@adisky

do you have any idea why sandboxed tests are getting failed? they are failing in general or only on this PR?

The new test you added is failing:

=== RUN   TestContainerdSandboxImage
    containerd_image_test.go:215: make sure the pause image exist
    containerd_image_test.go:218: ensure correct labels are set on pause image
    containerd_image_test.go:219: 
        	Error Trace:	/home/runner/work/containerd/containerd/containerd_image_test.go:219
        	Error:      	Not equal: 
        	            	expected: ""
        	            	actual  : "pinned"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1 +1 @@
        	            	-
        	            	+pinned
        	Test:       	TestContainerdSandboxImage
    containerd_image_test.go:221: pause image should be seen by cri plugin
    containerd_image_test.go:225: verify pinned field is set for pause image
    containerd_image_test.go:226: 
        	Error Trace:	/home/runner/work/containerd/containerd/containerd_image_test.go:226
        	Error:      	Should be true
        	Test:       	TestContainerdSandboxImage
--- FAIL: TestContainerdSandboxImage (0.00s)

@ruiwen-zhao is correct; the test will run for both the server and sbserver implementations. It looks like you haven't implemented your changes for sbserver yet, so the new test fails.

Copy link
Member

@akhilerm akhilerm left a comment

Choose a reason for hiding this comment

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

Should the same set of changes for image_pull in server package done to the sbserver also?

pkg/cri/labels/labels.go Show resolved Hide resolved
pkg/cri/labels/labels.go Show resolved Hide resolved
@adisky
Copy link
Contributor Author

adisky commented Jan 16, 2023

@ruiwen-zhao is correct; the test will run for both the server and sbserver implementations. It looks like you haven't implemented your changes for sbserver yet, so the new test fails.

@ruiwen-zhao @samuelkarp
I haven't read the sandbox API proposal but heard it wont require the pause container? So Does it makes sense to add these changes in sbserver?

@ruiwen-zhao
Copy link
Member

ruiwen-zhao commented Jan 17, 2023

@ruiwen-zhao is correct; the test will run for both the server and sbserver implementations. It looks like you haven't implemented your changes for sbserver yet, so the new test fails.

@ruiwen-zhao @samuelkarp I haven't read the sandbox API proposal but heard it wont require the pause container? So Does it makes sense to add these changes in sbserver?

The proposal is here: #4131. I am not sure if we have removed the requirement for pause container with current implementation.

I think the current requirement is that all new changes to cri/server will need to be made on cri/sbserver as well. You just need to copy your changes under cri/server over to cri/sbserver.

@adisky
Copy link
Contributor Author

adisky commented Jan 19, 2023

@ruiwen-zhao @pacoxu can you take a look again? added implementation to sbserver as well

@ruiwen-zhao
Copy link
Member

Details

Thanks @adisky for updating the code! Looks good except for one comment above.

@samuelkarp samuelkarp added the area/cri Container Runtime Interface (CRI) label Jan 31, 2023
@samuelkarp
Copy link
Member

/ok-to-test

@adisky
Copy link
Contributor Author

adisky commented Feb 16, 2023

looks like flake
/test pull-containerd-node-e2e

@adisky
Copy link
Contributor Author

adisky commented Feb 16, 2023

ERROR: (gcloud.auth.activate-service-account) There was a problem refreshing your current auth tokens: ('invalid_grant: Invalid JWT Signature.', {'error': 'invalid_grant', 'error_description': 'Invalid JWT Signature.'})

/test pull-containerd-node-e2e

@mikebrow
Copy link
Member

a couple lint issues to address:20

Running [/home/runner/golangci-lint-1.52.2-linux-amd64/golangci-lint run --out-format=github-actions --timeout=8m] in [] ...
21
Error: const imageLabelKey is unused (unused)
22
Error: const imageLabelValue is unused (unused)

@mikebrow
Copy link
Member

cri-o related PR cri-o/cri-o#6903

@adisky adisky force-pushed the new-pinned-image branch from e284b09 to fa3e709 Compare May 31, 2023 11:19
Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

LGTM on green w/rebase

@mikebrow
Copy link
Member

mikebrow commented Jun 1, 2023

@adisky sorry looks like another merge conflict on helpers.go could you rebase one more time :)

Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
@adisky adisky force-pushed the new-pinned-image branch from fa3e709 to fe4f8bd Compare June 2, 2023 04:28
@adisky
Copy link
Contributor Author

adisky commented Jun 2, 2023

Thank @mikebrow for review, rebased

Also linking the discussion we had on containerd slack
https://cloud-native.slack.com/archives/CGEQHPYF4/p1685533468086829

Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

LGTM

@samuelkarp
Copy link
Member

@mikebrow @dmcgowan Any objection to backporting this (or at least the logic setting the pinned property based on the io.cri-containerd.pinned label) to 1.7 and 1.6?

@samuelkarp samuelkarp added cherry-pick/1.6.x Change to be cherry picked to release/1.6 branch cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Jun 21, 2023
@samuelkarp
Copy link
Member

Thanks @ruiwen-zhao for opening #8718 and #8720.

@thaJeztah thaJeztah added cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch and removed cherry-pick/1.6.x Change to be cherry picked to release/1.6 branch cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cri Container Runtime Interface (CRI) cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch ok-to-test
Projects
Development

Successfully merging this pull request may close these issues.

Implement Pinned image support