Skip to content

use docker build to generate images #825

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

Merged
merged 1 commit into from
Mar 31, 2025
Merged

Conversation

aojea
Copy link
Member

@aojea aojea commented Mar 28, 2025

Fixes: #821

/assign @cpanato @YifeiZhuang

This changes the way of building the image from ko to Dockerfile, despite ko is really simple and useful the app path inside the container is hardcoded and this cause conflict with all the existing ecosystem that depend in the app path to work

Instead of using bazel, that is something we'd like to get rid of, let's use a Dockerfile that is the standard and in this is case is very simple

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 28, 2025
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 28, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If the repository mantainers determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot requested review from justinsb and seans3 March 28, 2025 08:05
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 28, 2025
@@ -42,7 +45,7 @@ else
fi

if [[ "${COMPONENT:-ccm}" == "ccm" ]]; then
go run github.com/google/ko@v0.14.1 build --tags=${IMAGE_TAG} --base-import-paths --push=true ./cmd/cloud-controller-manager/
docker build --push -t ${IMAGE_REPO}/cloud-controller-manager:${IMAGE_TAG} .
Copy link
Member Author

Choose a reason for hiding this comment

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

we may want to do this optional via a env variable for local testing

@YifeiZhuang
Copy link
Contributor

I verified it works. Only thing is that I got permission issue ERROR: denied: Unauthenticated request. Unauthenticated requests do not have permission "artifactregistry.repositories.uploadArtifacts" on resource "projects/zivy-gke-dev-2/locations/us-central1/repositories/ccm-test" for the docker build approach, while using ko I didn't. So I had to run gcloud auth configure-docker us-central1-docker.pkg.dev. CI might be fine with that?

And I verified that the entry point is root([]).

/lgtm
/approve

Thanks a lot @aojea

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 28, 2025
@YifeiZhuang
Copy link
Contributor

YifeiZhuang commented Mar 28, 2025

oh, we used to have go-runner as entry point.

docker inspect registry.k8s.io/cloud-provider-gcp/cloud-controller-manager:v26.2.4  -f '{{.Config.Entrypoint}}'
[/go-runner]

docker inspect registry.k8s.io/cloud-provider-gcp/cloud-controller-manager:v30.0.0 -f '{{.Config.Entrypoint}}'
[/go-runner]

/approve cancel

@YifeiZhuang
Copy link
Contributor

@cpanato @aojea do we know we still need to build go-runner for OSS images?

@cpanato
Copy link
Member

cpanato commented Mar 28, 2025

@cpanato @aojea do we know we still need to build go-runner for OSS images?

afaik that is only used for the k8s images

Change-Id: I2c8839ba088342318ee93fb03527917f21a4aee5
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 29, 2025
@aojea aojea changed the title [WIP] use docker build to generate images use docker build to generate images Mar 29, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 29, 2025
@aojea
Copy link
Member Author

aojea commented Mar 29, 2025

go-runner is used in all the other cloud providers too https://grep.app/search?q=registry.k8s.io%2Fbuild-image%2Fgo-runner

is not a big change, just replacing the base image ,I have updated the PR to include go-runner PTAL

@YifeiZhuang
Copy link
Contributor

/lgtm
/approve

Thank you!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 31, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aojea, YifeiZhuang

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

@YifeiZhuang YifeiZhuang merged commit 9fbeafd into kubernetes:master Mar 31, 2025
6 of 7 checks passed
@@ -0,0 +1,16 @@
ARG GOARCH="amd64"
Copy link
Member

Choose a reason for hiding this comment

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

we want to build only amd64?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just make this as a stopgap, feel free to improve it

YifeiZhuang pushed a commit to YifeiZhuang/cloud-provider-gcp that referenced this pull request Apr 9, 2025
Change-Id: I2c8839ba088342318ee93fb03527917f21a4aee5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

32.2.3 image seems broken
4 participants