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

Upgrade the kubebuilder to v3.2.0 and Kubernetes Go libraries to v1.22.2 #1861

Merged
merged 4 commits into from
May 22, 2022

Conversation

tenzen-y
Copy link
Member

@tenzen-y tenzen-y commented May 4, 2022

What this PR does / why we need it:
I upgraded the kubebuilder to v3.2.0, the Kubernetes Go libraries to v1.22.2, and other dependent libraries.
Also, I fixed envtest for the experiment controller.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1858

Checklist:

  • Docs included if any changes are user facing

@google-oss-prow google-oss-prow bot requested a review from anencore94 May 4, 2022 16:00
@google-oss-prow google-oss-prow bot requested a review from sperlingxx May 4, 2022 16:00
@tenzen-y tenzen-y force-pushed the upgrade-kubebuiler-version branch 4 times, most recently from 4c6badb to 7b44a36 Compare May 4, 2022 17:13
@tenzen-y tenzen-y force-pushed the upgrade-kubebuiler-version branch from 7b44a36 to 46b6ad3 Compare May 21, 2022 06:15
@tenzen-y tenzen-y force-pushed the upgrade-kubebuiler-version branch from 76fd8b3 to a61185e Compare May 21, 2022 15:18
@google-oss-prow google-oss-prow bot added size/XL and removed size/L labels May 21, 2022
@tenzen-y tenzen-y changed the title [WIP] Upgrade kubebuilder version from v2.3.0 to v3.2.0 Upgrade kubebuilder version from v2.3.0 to v3.2.0 May 21, 2022
@tenzen-y
Copy link
Member Author

This PR is ready for review, but we can not run kubeflow-katib-presubmit because the Go version of test-infra is 1.14, as described in kubeflow/testing#974.

go: downloading cloud.google.com/go v0.81.0
go: downloading gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
go: downloading golang.org/x/text v0.3.6
../../../../pkg/mod/k8s.io/client-go@v0.22.2/plugin/pkg/client/auth/exec/metrics.go:21:2: package io/fs is not in GOROOT (/usr/local/go/src/io/fs)

https://argo.kubeflow-testing.com/workflows/kubeflow-test-infra/kubeflow-katib-presubmit-e2e-v1beta1-1861-d2f2d60-1248-25a9?tab=workflow&nodeId=kubeflow-katib-presubmit-e2e-v1beta1-1861-d2f2d60-1248-25a9-2154460364&sidePanel=logs%3Akubeflow-katib-presubmit-e2e-v1beta1-1861-d2f2d60-1248-25a9-2154460364%3Amain

@tenzen-y
Copy link
Member Author

/retest

To avoid the `timeout waiting for process kube-apiserver to stop` error, we must use the `context.WithCancel`.
Ref: kubernetes-sigs/controller-runtime#1571 (comment)
@tenzen-y tenzen-y force-pushed the upgrade-kubebuiler-version branch 2 times, most recently from e6c3e12 to 84725ee Compare May 22, 2022 06:18
@tenzen-y tenzen-y changed the title Upgrade kubebuilder version from v2.3.0 to v3.2.0 [WIP] Upgrade kubebuilder version from v2.3.0 to v3.2.0 May 22, 2022
@tenzen-y tenzen-y force-pushed the upgrade-kubebuiler-version branch 2 times, most recently from 60fecbb to fe95b18 Compare May 22, 2022 06:58
To avoid the `../../../../pkg/mod/k8s.io/client-go@v0.22.2/plugin/pkg/client/auth/exec/metrics.go:21:2: package io/fs is not in GOROOT (/usr/local/go/src/io/fs)` error,
we must use Go v1.16 or later, but as described in kubeflow/training-operator#1581,
we do not have permission to update `public.ecr.aws/j1r0q0g6/kubeflow-testing:latest` so we need to update it in this.
@tenzen-y tenzen-y force-pushed the upgrade-kubebuiler-version branch from fe95b18 to faeb84f Compare May 22, 2022 07:09
@tenzen-y tenzen-y changed the title [WIP] Upgrade kubebuilder version from v2.3.0 to v3.2.0 Upgrade kubebuilder version from v2.3.0 to v3.2.0 May 22, 2022
@tenzen-y tenzen-y changed the title Upgrade kubebuilder version from v2.3.0 to v3.2.0 Upgrade kubebuilder version and kubernetes Go libraries version May 22, 2022
@tenzen-y tenzen-y changed the title Upgrade kubebuilder version and kubernetes Go libraries version Upgrade kubebuilder and kubernetes Go libraries version May 22, 2022
@tenzen-y tenzen-y changed the title Upgrade kubebuilder and kubernetes Go libraries version Upgrade the kubebuilder to v3.2.0 and Kubernetes Go libraries to v1.22.2 May 22, 2022
@@ -76,6 +76,13 @@ if [ $? -ne 1 ]; then
exit 1
fi

# TODO (tenzen-y): Once the changes on https://github.com/kubeflow/testing/pull/974 are reflected in the `public.ecr.aws` registry, we must remove this process.
# To avoid the `../../../../pkg/mod/k8s.io/client-go@v0.22.2/plugin/pkg/client/auth/exec/metrics.go:21:2: package io/fs is not in GOROOT (/usr/local/go/src/io/fs)` error,
Copy link
Member

Choose a reason for hiding this comment

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

Is this still needed after kubeflow/testing#974?

Copy link
Member Author

@tenzen-y tenzen-y May 22, 2022

Choose a reason for hiding this comment

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

@johnugeorge Thanks for your comments.

Yes, as Jeffwan says, since public.ecr.aws/j1r0q0g6/kubeflow-testing:latest image was manually updated, we can not update its image by merging kubeflow/testing#974.

However, I forget the image public.ecr.aws/j1r0q0g6/kubeflow-testing:latest was manually updated in the past.

kubeflow/training-operator#1581 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -76,6 +76,13 @@ if [ $? -ne 1 ]; then
exit 1
fi

# TODO (tenzen-y): Once the changes on https://github.com/kubeflow/testing/pull/974 are reflected in the `public.ecr.aws` registry, we must remove this process.
# To avoid the `../../../../pkg/mod/k8s.io/client-go@v0.22.2/plugin/pkg/client/auth/exec/metrics.go:21:2: package io/fs is not in GOROOT (/usr/local/go/src/io/fs)` error,
Copy link
Member

Choose a reason for hiding this comment

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

Also, wondering why this error is happening only for Golang version <1.6?

Copy link
Member Author

@tenzen-y tenzen-y May 22, 2022

Choose a reason for hiding this comment

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

The io/fs package was introduced in Go v1.16.

File Systems
The new io/fs package defines the fs.FS interface, an abstraction for read-only trees of files. The standard library packages have been adapted to make use of the interface as appropriate.

https://go.dev/doc/go1.16#library

@johnugeorge
Copy link
Member

Thanks for clarifying.

Can you create an issue to ensure that we remove the hack after the image update ?

@tenzen-y
Copy link
Member Author

Thanks for clarifying.

Can you create an issue to ensure that we remove the hack after the image update ?

Sure.

@johnugeorge
Copy link
Member

Thanks @tenzen-y for this fix!

/lgtm
/approve

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: johnugeorge, tenzen-y

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit 779b331 into kubeflow:master May 22, 2022
@tenzen-y tenzen-y deleted the upgrade-kubebuiler-version branch May 22, 2022 19:19
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.

Failed to start envtest on Mac with macOS 12 Monterey
2 participants