-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Update cri-api dependency to v0.26.0-beta.0 #7656
Conversation
Hi @ruiwen-zhao. 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 Once the patch is verified, the new status will be reflected by the 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. |
2064dc5
to
3ac255e
Compare
docs/cri/architecture.md
Outdated
@@ -1,7 +1,7 @@ | |||
# Architecture of The CRI Plugin | |||
This document describes the architecture of the `cri` plugin for `containerd`. | |||
|
|||
This plugin is an implementation of Kubernetes [container runtime interface (CRI)](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.proto). Containerd operates on the same node as the [Kubelet](https://kubernetes.io/docs/reference/generated/kubelet/). The `cri` plugin inside containerd handles all CRI service requests from the Kubelet and uses containerd internals to manage containers and container images. | |||
This plugin is an implementation of Kubernetes [container runtime interface (CRI)](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/cri-api/pkg/apis/runtime/v1/api.proto). Containerd operates on the same node as the [Kubelet](https://kubernetes.io/docs/reference/generated/kubelet/). The `cri` plugin inside containerd handles all CRI service requests from the Kubelet and uses containerd internals to manage containers and container images. | |||
|
|||
The `cri` plugin uses containerd to manage the full container lifecycle and all container images. As also shown below, `cri` manages pod networking via [CNI](https://github.com/containernetworking/cni) (another CNCF project). | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update this too: https://github.com/containerd/containerd/blob/main/RELEASES.md#kubernetes-support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I update the "Kubernetes Support" section like the following?
| Kubernetes Version | containerd Version | CRI Version |
|--------------------|--------------------|--------------|
| 1.20 | 1.5.0+ | v1alpha2 |
| 1.21 | 1.5.0+ | v1alpha2 |
| 1.22 | 1.5.5+ | v1alpha2 |
| 1.23 | 1.6.0+, 1,5.8+ | v1, v1alpha2 |
| 1.24 | 1.6.4+, 1.5.11+ | v1, v1alpha2 |
| 1.25 | 1.6.4+, 1.5.11+ | v1, v1alpha2 |
| 1.26 | ??? | v1 |
I assume this change will go to 1.7 so the containerd version here should be 1.7.0+? But we do want to support k8s 1.26 with 1.6.x containerd right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good.
The containerd version will be v1.7.0+ .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right but with 1.6 being the LTS version, I guess we want to include 1.6.x for 1.26 as well? If thats the case do we know which patch version of 1.6.x should we use here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and I guess 1.6.4+
is fine, assuming that the CRI v1 implementation of K v1.26 is compatible with K v1.25 and v1.24?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes that should be the case. I put
| 1.26 | 1.7.0+, 1.6.4+ | v1 |
here.
/ok-to-test |
3ac255e
to
93789d0
Compare
Needs a rebase |
93789d0
to
b03562a
Compare
You need to commit the changes to the vendoring in this PR as the project checks tries to validate |
oh so I need to run |
b03562a
to
ea51064
Compare
The windows failure seems to be related...
Only windows tests are failing, but not the linux ones. So I am guessing windows tests are using their own config.toml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
per offline discussion..
let's keep (or at least try to keep) cri v1alpha2 in containerd until containerd v2.. this because we have a number of older clients still using containerd and they may need to update to the latest containerd for certain scenarios.. without moving up k/k and all the other clients still using cri v1alpha2 .. we can and should deprecate / provide notice from instrumented..
plan would be to vendor the v1alpha2 apis from one version of cri-api and v1 can go ahead and move up
I was doing some golang research but didn't really find a way to do this. To make sure I captured it correct, we would like
I tried using something like
but i can't make it point to a directory under cri-api. Did i miss something here? |
nod.. sans a go package trick.. since grpc only registers ServiceName: "runtime.v1alpha2.RuntimeService", let's just fork the v1alpha2 api for now through containerd v2.. maybe into containerd/containerd/pkg/cri/v1alpha2 do the renaming of the package import directory in a couple files and good to go I think! |
b346115
to
6991a27
Compare
1557a73
to
1dbc1c0
Compare
protobuf check fails with
I am just copying the existing proto file instead of re-generating the proto, so I guess that caused some problem. |
Project checks fails with
Not too much info here... |
|
1dbc1c0
to
f5e9c62
Compare
Thanks @samuelkarp for the pointers! I added containerd header to constant.go and removed gogoproto references from cri-api proto (some how I cannot verify if it works locally so has to push it to the PR and see) One thing I want to call out here is that, by applying the manual fixes to the copied cri-api code, we are creating a divergence between the containerd-owned cri-api v1alpha2 code and the real cri-api code. I don't think this is a big problem because v1alpha2 is deprecated and no one will be changing it anymore. So the divergence will not increase. If this kind of divergence is not acceptable in any way, an alternative of maintaining v1alpha2 dependency while picking up the latest v1 cri-api is to create a github fork repo pointing to 0.25.x cri-api, which still has v1alpha2 code. And make contaienrd's v1alpha2 dependency point to that fork. Update: So removing gogproto refs will make the proto check fail again because the generated go code is different than the copied-over one... |
f3d813e
to
4a4ec93
Compare
Ok cool, finally made protobuf check happy by excluding pkg/cri/v1alpha2 from multiple checks in Makefile. Updated the details in the PR description. |
Code scanning is failing because cri-api code returns Password in one of the methods:
Is Code scanning configured anywhere and I can exclude this file from the check, just like vendor? |
I don't think we should do this. Rather than copying the generated
We should probably exclude this field from logging rather than adjust the check. |
Yes we can do that technically. But I think that the cri-api go code should be treated in the same way as vendor. Containerd has been using the cri-api go code built by k8s already.
Maybe I am looking at wrong places but I don't think instrumented_server logs
But looking at the code where the check fails, instrumented_service only logs
Note that Similar goes to the other failure, it only logs the image name:
What also confuses me is that this PR does not change the cri-api v1alpha2 code, why this check only fails now? |
Regarding code scanning failures, sync'ed with @samuelkarp offline. For all the 10 scanning failures, the tool thinks the error message returned from I dont know what throws off Code Scanning in this case. But I am gonna update my PR to run Code Scanning on only the first commit, and see if it solves the problem. |
933aa30
to
e7d84d8
Compare
this all sounds familiar I may have had to do the override to approve this before.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM on green
So even with only one commit, Code Scanning still fails. I will add back the other commit now. |
My preference would be to regenerate the Go code for consistency with the rest of the protos in containerd. However, if we must consume it exactly, let's move it into a clearly-marked "third party" folder and then apply the exception at that level. |
Signed-off-by: ruiwen-zhao <ruiwen@google.com>
3f3d1df
to
234bf99
Compare
Signed-off-by: ruiwen-zhao <ruiwen@google.com>
Makes sense. I moved the v1alpha2 proto files to third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/ instead. Also updated PR description. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM on green cleared the scanning checks.. we do pass passwords through for pull authentication, and did have to remove passwords from logs way back around the start of the cri plugin... but we are not logging passwords in the code path any more. That we are having an error on pull request is necessary to report to the caller.
Signed-off-by: ruiwen-zhao ruiwen@google.com
This PR includes:
1 is needed because v0.26.0-beta.0 does not have support for v1alpha2 apis. Since containerd still has clients that might need v1alpha2 api, we need to preserve the code. Therefore, I copied the cri-api v1alpha2 to containerd internal directory. More specifically, I
a. Copied vendor/k8s.io/cri-api/pkg/apis/runtime/v1 with cri-api v0.25.34 to
third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/
b. Modified Makefile to exclude pkg/cri/v1alpha2 from
protos
andproto-fmt
checkc. Modified Makefile to exclude
third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2
from PACKAGES, API_PACKAGES, and NON_API_PACKAGES, so that it can be excluded frombin/protoc-gen-go-fieldpath
checkc. Added containerd file header to
third_party/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/constants.go
2 was done by
a. Running
go get k8s.io/cri-api@1cee3924915eebf375ed6a2dd13aef6378158862
, and thengo mod tidy
andgo mod sum
.b. Adding place-holder (Unimplemented-error-returning) implementations for
ListPodSandboxMetrics
andListMetricDescriptors