Skip to content

Commit

Permalink
switch release/api generator images to ghcr (#11528) (#11530)
Browse files Browse the repository at this point in the history
Also update the go version in api generator image to 1.23
The previous version used 1.20.5, in this version the go generate
command would fail on the current go mod (using 1.22), because it
expects the go version to be in the format "x.y" insted of "x.y.z", in
1.23 this is no longer an issue.

Signed-off-by: Humair Khan <[email protected]>
  • Loading branch information
HumairAK authored Jan 16, 2025
1 parent f26c1ae commit 33fca73
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Contact one of Bobgy, capri-xiyue or zijianjoy if this remote image needs an update.
PREBUILT_REMOTE_IMAGE=gcr.io/ml-pipeline-test/api-generator:latest
# Contact one of chensun, HumairAK, zijianjoy if this remote image needs an update.
PREBUILT_REMOTE_IMAGE=ghcr.io/kubeflow/kfp-api-generator:1.0

.PHONY: all
all: golang python
Expand Down
2 changes: 1 addition & 1 deletion backend/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

# Generate client code (go & json) from API protocol buffers
FROM golang:1.22 as generator
FROM golang:1.23 as generator
ENV GRPC_GATEWAY_VERSION v1.9.6
ENV GO_SWAGGER_VERSION v0.18.0
ENV GOLANG_PROTOBUF_VERSION v1.5.1
Expand Down
6 changes: 3 additions & 3 deletions backend/api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

IMAGE_TAG=kfp-api-generator
# Contact chensun or zijianjoy if this remote image needs an update.
REMOTE_IMAGE=gcr.io/ml-pipeline-test/api-generator
# Image generated by https://github.com/kubeflow/pipelines/pull/10580
REMOTE_IMAGE=ghcr.io/kubeflow/kfp-api-generator

# Keep in sync with the version used in test/release/Dockerfile.release
PREBUILT_REMOTE_IMAGE=gcr.io/ml-pipeline-test/api-generator@sha256:41fd3e60ba40430a4c3d87e03be817c5f63b2dfed23059ec9d6bca62ce0cc39c
PREBUILT_REMOTE_IMAGE=ghcr.io/kubeflow/kfp-api-generator:1.0

CONTAINER_ENGINE ?= docker

Expand Down
8 changes: 5 additions & 3 deletions backend/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ API definitions in this folder are used to generate [`v1beta1`](https://www.kube

API generator image is defined in [Dockerfile](`./Dockerfile`). If you need to update the container, follow these steps:

1. Update the [Dockerfile](`./Dockerfile`) and build the image by running `docker build -t gcr.io/ml-pipeline-test/api-generator:latest .`
1. Push the new container by running `docker push gcr.io/ml-pipeline-test/api-generator:latest` (requires to be [authenticated](https://cloud.google.com/container-registry/docs/advanced-authentication)).
1. Login to GHCR container registry: `echo "<PAT>" | docker login ghcr.io -u <USERNAME> --password-stdin`
* Replace `<PAT>` with a GitHub Personal Access Token (PAT) with the write:packages and `read:packages` scopes, as well as `delete:packages` if needed.
1. Update the [Dockerfile](`./Dockerfile`) and build the image by running `docker build -t ghcr.io/kubeflow/kfp-api-generator:$VERSION .`
1. Push the new container by running `docker push ghcr.io/kubeflow/kfp-api-generator:$VERSION` (requires to be [authenticated](https://cloud.google.com/container-registry/docs/advanced-authentication)).
1. Update the `PREBUILT_REMOTE_IMAGE` variable in the [Makefile](./Makefile) to point to your new image.
1. Similarly, push a new version of the release tools image to `gcr.io/ml-pipeline-test/release:latest` and run `make push` in [test/release/Makefile](../../test/release/Makefile).
1. Similarly, push a new version of the release tools image to `ghcr.io/kubeflow/kfp-release:$VERSION` and run `make push` in [test/release/Makefile](../../test/release/Makefile).
4 changes: 2 additions & 2 deletions backend/src/v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ it should have the following content:
For example:

```makefile
export DEV_IMAGE_PREFIX=gcr.io/ml-pipeline-test/kfp-
export DEV_IMAGE_PREFIX=ghcr.io/kubeflow-test/kfp-/kfp-
```

Then after images are built, they will be pushed to locations like
`gcr.io/ml-pipeline-test/kfp-driver`.
`ghcr.io/kubeflow-test/kfp-driver`.

The `.env` file is ignored by git, it's your local development configuration.
Expand Down
2 changes: 1 addition & 1 deletion kubernetes_platform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

PREBUILT_REMOTE_IMAGE=gcr.io/ml-pipeline-test/api-generator:latest
PREBUILT_REMOTE_IMAGE=ghcr.io/kubeflow/kfp-api-generator:1.0

.PHONY: all
all: golang python
Expand Down
2 changes: 1 addition & 1 deletion test/release/Dockerfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Based on KFP backend api client generator dockerfile
# Keep in sync with the version used in backend/api/Makefile
FROM gcr.io/ml-pipeline-test/api-generator@sha256:41fd3e60ba40430a4c3d87e03be817c5f63b2dfed23059ec9d6bca62ce0cc39c
FROM ghcr.io/kubeflow/kfp-api-generator:1.0

# install nvm & node 12
# Reference: https://stackoverflow.com/a/28390848
Expand Down
2 changes: 1 addition & 1 deletion test/release/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

REMOTE=gcr.io/ml-pipeline-test/release@sha256:ed1a4dbe536e7e161ad0d846b5681aacc0e0e7f285985cb1808c5c8987bcfeb0
REMOTE=ghcr.io/kubeflow/kfp-release:1.0

CONTAINER_ENGINE ?= docker

Expand Down
2 changes: 1 addition & 1 deletion test/release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The script `./release.sh` is a wrapper

The script `./bump-version-docker.sh`

1. Runs `./bump-version-in-place.sh` in gcr.io/ml-pipeline-test/release:latest image.
1. Runs `./bump-version-in-place.sh` in ghcr.io/kubeflow/kfp-release:$VERSION image.

The script `./bump-version-in-place.sh` does the following:

Expand Down
2 changes: 1 addition & 1 deletion test/release/bump-version-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if [[ -z "$TAG_NAME" ]]; then
fi

pushd "${REPO_ROOT}"
RELEASE_IMAGE=${RELEASE_IMAGE:-gcr.io/ml-pipeline-test/release@sha256:ed1a4dbe536e7e161ad0d846b5681aacc0e0e7f285985cb1808c5c8987bcfeb0}
RELEASE_IMAGE=${RELEASE_IMAGE:-ghcr.io/kubeflow/kfp-release:1.0}
docker run -it --rm \
--user $(id -u):$(id -g) \
--mount type=bind,source="$(pwd)",target=/go/src/github.com/kubeflow/pipelines \
Expand Down
2 changes: 1 addition & 1 deletion test/release/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fi
echo "Running the bump version script in cloned repo"
echo -n "$TAG" > ./VERSION

PREBUILT_REMOTE_IMAGE=gcr.io/ml-pipeline-test/release@sha256:ed1a4dbe536e7e161ad0d846b5681aacc0e0e7f285985cb1808c5c8987bcfeb0
PREBUILT_REMOTE_IMAGE=ghcr.io/kubeflow/kfp-release:1.0
pushd ./test/release
make release-in-place
popd
Expand Down

0 comments on commit 33fca73

Please sign in to comment.