Skip to content

Commit ebb569d

Browse files
Merge main into v1.10-branch with known resolved conflicts
2 parents ec68ea2 + 72ac948 commit ebb569d

File tree

11 files changed

+119
-34
lines changed

11 files changed

+119
-34
lines changed

.github/workflows/code-quality.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ jobs:
3434

3535
- name: golangci-lint
3636
if: "${{ !cancelled() }}"
37-
uses: golangci/golangci-lint-action@v7
37+
uses: golangci/golangci-lint-action@v8
3838
with:
3939
args: --timeout=5m
40-
version: v2.0.2
40+
version: v2.1.6
4141
only-new-issues: true
4242
working-directory: ${{ matrix.component }}
4343

DEPENDENCIES.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Upgrading Go Version and Dependencies in Kubeflow
2+
3+
This guide outlines the steps to upgrade the Go version and dependencies in the Kubeflow project, including the necessary changes in the red-hat-data-services/kubeflow fork.
4+
5+
## Upgrading Go Version
6+
7+
Upgrading the Go version should be done in a separate PR to isolate the changes and make review easier.
8+
9+
> [!IMPORTANT]
10+
> Images are to be built in the [ubi8/go-toolset](https://catalog.redhat.com/software/containers/ubi8/go-toolset/5ce8713aac3db925c03774d1) container.
11+
> It contains a customized FIPS-compatible version of Go, that however lags behind the latest upstream Go version.
12+
> Always use a Go version that has a supporting go-toolset image available.
13+
14+
1. Begin by reading [Go release notes](https://go.dev/doc/devel/release) to identify potential incompatibilities.
15+
16+
2. Update the Go version in the following files:
17+
- `components/**` `/` `go.mod`: Update the `go` directive at the top of the file.
18+
- `components/**` `/` `Dockerfile`: Update the Go version in the base image.
19+
20+
3. Run the following commands to update and verify the build:
21+
22+
```shell
23+
go mod tidy
24+
make test
25+
```
26+
27+
4. Commit these changes and create a pull request for the Go version upgrade.
28+
29+
> [!WARNING]
30+
> Use the `Manifest List Digest` and not the `Image Digest` when locating sha256 in the Red Hat Image Catalog entry.
31+
32+
5. After merging the Go upgrade PR, update the fork at https://github.com/red-hat-data-services/kubeflow:
33+
- Locate all `Dockerfile.konflux` files in the repository.
34+
- Update the Go version in each of these files to match the new version.
35+
- Refer to the [ubi8/go-toolset](https://catalog.redhat.com/software/containers/ubi8/go-toolset/5ce8713aac3db925c03774d1) in Red Hat image catalog to locate `sha256` hash
36+
- Create a pull request in the fork repository with these changes.
37+
38+
6. Review CI/CD configuration files (especially openshift/release OCP-CI yamls) that specify a Go version.
39+
40+
## Upgrading Dependencies
41+
42+
Upgrading dependencies can be done separately from the Go version upgrade. However, some dependency upgrades may require a newer Go version.
43+
44+
1. To update all dependencies to their latest minor or patch versions:
45+
46+
````shell
47+
go get -u ./...
48+
````
49+
50+
To update to major versions, you'll need to update import paths manually and run `go get` for each updated package.
51+
52+
2. Run `go mod tidy` to clean up the `go.mod` and `go.sum` files, pay attention to not increasing required Go version, e.g.:
53+
54+
````shell
55+
go mod tidy -go=1.21.9
56+
go: go.opentelemetry.io/auto/[email protected] requires [email protected], but 1.21.9 is requested
57+
````
58+
59+
(The above suggests to either bump the required Go version or to use an older version of dependency.)
60+
61+
3. Verify that the project still builds and tests pass:
62+
63+
````shell
64+
make test
65+
````
66+
67+
4. Review the changes in `go.mod` and `go.sum`. Pay special attention to major version upgrades, as they may include breaking changes.
68+
69+
5. If any dependencies require a newer Go version, you may need to upgrade Go first following the steps in the "Upgrading Go Version" section.
70+
71+
6. Commit the changes to `go.mod` and `go.sum`, and create a pull request for the dependency upgrades.

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@ repository](https://github.com/kubeflow/kubeflow).
77

88
Follow the instructions in the [REBASE.md](./REBASE.md) file to understand how
99
to rebase this repository without conflicts.
10+
11+
## Dependency updates
12+
13+
Follow the instructions in the [DEPENDENCIES.md](./DEPENDENCIES.md) file to
14+
understand how to update the dependencies of this repository.
15+
16+
Go version is to be kept in sync across all of go.mod file, Dockerfile, and the
17+
Go version used by Dockerfile.konflux files in the
18+
[red-hat-data-services/kubeflow](https://github.com/red-hat-data-services/kubeflow) fork.

components/notebook-controller/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77

88
# Build arguments
99
ARG SOURCE_CODE=.
10-
ARG GOLANG_VERSION=1.22
10+
ARG GOLANG_VERSION=1.23
1111

1212
# Use ubi8/go-toolset as base image
13+
# https://catalog.redhat.com/software/containers/ubi8/go-toolset/5ce8713aac3db925c03774d1
14+
# image sets GOTOOLCHAIN=local so it won't end up downloading if go.mod requests different version
1315
FROM registry.access.redhat.com/ubi8/go-toolset:${GOLANG_VERSION} as builder
1416
ARG TARGETOS
1517
ARG TARGETARCH

components/notebook-controller/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ run-culling: generate fmt vet manifests
9292
##@ Build
9393
.PHONY: docker-build
9494
docker-build: test ## Build docker image with the manager.
95-
cd .. && ${CONTAINER_ENGINE} build . -t ${IMG}:${TAG} -f ./notebook-controller/Dockerfile
95+
cd .. && ${CONTAINER_ENGINE} build . --platform="${ARCH}" -t ${IMG}:${TAG} -f ./notebook-controller/Dockerfile
9696

9797
.PHONY: docker-push
9898
docker-push: ## Push docker image with the manager.

components/notebook-controller/go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/kubeflow/kubeflow/components/notebook-controller
22

3-
go 1.22
3+
go 1.23.0
44

5-
toolchain go1.22.9
5+
toolchain go1.23.6
66

77
require (
88
github.com/go-logr/logr v1.4.1
@@ -52,11 +52,11 @@ require (
5252
go.uber.org/multierr v1.11.0 // indirect
5353
go.uber.org/zap v1.26.0 // indirect
5454
golang.org/x/exp v0.0.0-20220827204233-334a2380cb91 // indirect
55-
golang.org/x/net v0.33.0 // indirect
55+
golang.org/x/net v0.38.0 // indirect
5656
golang.org/x/oauth2 v0.12.0 // indirect
57-
golang.org/x/sys v0.28.0 // indirect
58-
golang.org/x/term v0.27.0 // indirect
59-
golang.org/x/text v0.21.0 // indirect
57+
golang.org/x/sys v0.31.0 // indirect
58+
golang.org/x/term v0.30.0 // indirect
59+
golang.org/x/text v0.23.0 // indirect
6060
golang.org/x/time v0.3.0 // indirect
6161
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
6262
google.golang.org/appengine v1.6.7 // indirect

components/notebook-controller/go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
149149
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
150150
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
151151
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
152-
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
153-
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
152+
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8=
153+
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8=
154154
golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4=
155155
golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4=
156156
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -166,15 +166,15 @@ golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7w
166166
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
167167
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
168168
golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
169-
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
170-
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
171-
golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
172-
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
169+
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
170+
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
171+
golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y=
172+
golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g=
173173
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
174174
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
175175
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
176-
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
177-
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
176+
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY=
177+
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4=
178178
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
179179
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
180180
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

components/odh-notebook-controller/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77

88
# Build arguments
99
ARG SOURCE_CODE=.
10-
ARG GOLANG_VERSION=1.22
10+
ARG GOLANG_VERSION=1.23
1111

1212
# Use ubi8/go-toolset as base image
13+
# https://catalog.redhat.com/software/containers/ubi8/go-toolset/5ce8713aac3db925c03774d1
14+
# image sets GOTOOLCHAIN=local so it won't end up downloading if go.mod requests different version
1315
FROM registry.access.redhat.com/ubi8/go-toolset:${GOLANG_VERSION} as builder
1416
ARG TARGETOS
1517
ARG TARGETARCH

components/odh-notebook-controller/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ include makefile-vars.mk
44
# Image URL to use all building/pushing image targets
55
IMG ?= quay.io/opendatahub/odh-notebook-controller
66
TAG ?= $(shell git describe --tags --always)
7+
ARCH ?= linux/amd64
78

89
KF_IMG ?= quay.io/opendatahub/kubeflow-notebook-controller
910
KF_TAG ?= $(KF_TAG)
@@ -115,7 +116,7 @@ run: manifests generate fmt vet certificates ktunnel ## Run a controller from yo
115116

116117
.PHONY: docker-build
117118
docker-build: test ## Build docker image with the manager.
118-
cd ../ && ${CONTAINER_ENGINE} build . -t ${IMG}:${TAG} -f odh-notebook-controller/Dockerfile
119+
cd ../ && ${CONTAINER_ENGINE} build . --platform="${ARCH}" -t ${IMG}:${TAG} -f odh-notebook-controller/Dockerfile
119120

120121
.PHONY: docker-push
121122
docker-push: ## Push docker image with the manager.

components/odh-notebook-controller/go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module github.com/opendatahub-io/kubeflow/components/odh-notebook-controller
22

3-
go 1.22.0
3+
go 1.23.0
44

5-
toolchain go1.22.9
5+
toolchain go1.23.6
66

77
require (
88
github.com/go-logr/logr v1.4.2
@@ -66,11 +66,11 @@ require (
6666
go.opentelemetry.io/otel/metric v1.35.0 // indirect
6767
go.uber.org/multierr v1.11.0 // indirect
6868
golang.org/x/exp v0.0.0-20220827204233-334a2380cb91 // indirect
69-
golang.org/x/net v0.33.0 // indirect
69+
golang.org/x/net v0.38.0 // indirect
7070
golang.org/x/oauth2 v0.12.0 // indirect
71-
golang.org/x/sys v0.30.0 // indirect
72-
golang.org/x/term v0.27.0 // indirect
73-
golang.org/x/text v0.21.0 // indirect
71+
golang.org/x/sys v0.31.0 // indirect
72+
golang.org/x/term v0.30.0 // indirect
73+
golang.org/x/text v0.23.0 // indirect
7474
golang.org/x/time v0.3.0 // indirect
7575
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
7676
google.golang.org/appengine v1.6.7 // indirect

0 commit comments

Comments
 (0)