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

Optionally use public images #274

Merged
merged 4 commits into from Apr 21, 2023

Conversation

smuda
Copy link
Contributor

@smuda smuda commented Mar 9, 2023

- Description of the problem which is fixed/What is the use case
Current build assumes the developer is a RH employee and uses images not publicly available.

Closes #268

- What I did

  • Updated Dockerfile to take images as arguments
  • Updated current make target to include (the same) images as arguments when building docker images.
  • Added documentation about building docker images from public images.

- How to verify it
Build with existing make targets:

make docker-build
make docker-buildx

Build with public images:

export BUILDER_IMAGE=registry.ci.openshift.org/openshift/release:golang-1.18
export TARGET_IMAGE=registry.ci.openshift.org/origin/4.10:base
make docker-build
make docker-buildx

- Description for the changelog

Added support for overriding images in Makefile.

@openshift-ci openshift-ci bot requested review from bpradipt and jensfr March 9, 2023 20:47
@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 9, 2023
@openshift-ci
Copy link

openshift-ci bot commented Mar 9, 2023

Hi @smuda. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

Makefile Show resolved Hide resolved
@bpradipt
Copy link
Contributor

@cpmeadors @jensfr ptal

@bpradipt
Copy link
Contributor

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 10, 2023
Copy link
Contributor

@bpradipt bpradipt left a comment

Choose a reason for hiding this comment

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

/lgtm
Thanks @smuda

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 15, 2023
@cpmeadors
Copy link
Contributor

I am concerned with these changes. I understand the desire to have everything build-able for the community. No one thinks we should have private RH images required. The problem I see is that this is working around a problem that cause by internal RH build processes. The proper solution is to use all publicly available resources here and fix downstream.

@gkurz gkurz added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 15, 2023
@smuda
Copy link
Contributor Author

smuda commented Mar 15, 2023

I agree this is a workaround and it would be much better to have public images that is always used. Could you give me URL's for such images? I'd be happy to adjust the PR accordingly.

@gkurz
Copy link
Member

gkurz commented Mar 23, 2023

Hi @smuda, thanks for working on this !

My overall concern with the approach you've taken is that it looks over-engineered. Especially, I don't quite understand the goal of the new docker-build-public and docker-buildx-public targets, which are basically duplicating existing targets and applying them to the public images.

It seems that we'd just want something like :

BUILDER_IMAGE  ?= registry.ci.openshift.org/openshift/release:golang-1.18
TARGET_IMAGE   ?= registry.ci.openshift.org/origin/4.10:base

and have docker-build and docker-buildx to use these.

The targets would work as is for upstream and downstream would have to do something like :

make BUILDER_IMAGE=registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.18-openshift-4.11 TARGET_IMAGE=registry.ci.openshift.org/ocp/4.11:base

Am I missing something ?

@gkurz gkurz removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 23, 2023
@gkurz
Copy link
Member

gkurz commented Mar 23, 2023

/hold

@openshift-ci openshift-ci bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed lgtm Indicates that a PR is ready to be merged. labels Mar 23, 2023
@openshift-ci
Copy link

openshift-ci bot commented Mar 24, 2023

New changes are detected. LGTM label has been removed.

@smuda smuda force-pushed the feature/optionally-use-public-images branch from e1371cd to 4eb64d1 Compare March 24, 2023 03:39
@smuda
Copy link
Contributor Author

smuda commented Mar 24, 2023

Yes, I might have over-engineered a bit. 😀 I've simplified Makefile changes to simply allow overriding the images and added documentation to DEVELOPMENT.md with the appropriate public images.

The PR still does not address @cpmeadors comment about always having public images, but perhaps it's a step in the right direction?

@bpradipt
Copy link
Contributor

@gkurz ptal

@gkurz
Copy link
Member

gkurz commented Apr 14, 2023

@gkurz ptal

Ack @bpradipt . Sorry @smuda for the delay...

@@ -22,6 +22,17 @@ In summary:
- log in from the command line with the provided command
- use "oc registry login" to save the token locally

### Using public images

If you cannot login to registry.ci.openshift.org, a temporary solution is to use
Copy link
Member

Choose a reason for hiding this comment

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

Nit: trailing space at end of line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed trailing whitespace.

@@ -1,5 +1,7 @@
# Use OpenShift golang builder image
FROM registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.18-openshift-4.11 AS builder
ARG BUILDER_IMAGE=${BUILDER_IMAGE:-registry.ci.openshift.org/ocp/builder:rhel-8-golang-1.18-openshift-4.11}
ARG TARGET_IMAGE=${TARGET_IMAGE:-registry.ci.openshift.org/ocp/4.11:base}
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need to duplicate the default values here ? AFAICT you'll get the default values from the Makefile.

@cpmeadors can you think of a case where this Dockerfile would be used standalone ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If my memory serves me right, it's required during automatic tests.

Copy link
Member

Choose a reason for hiding this comment

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

@smuda That rings a bell indeed. Let's add a comment in both places stating that changes should be propagated to the other file as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added a comment about keeping them in sync.

@smuda smuda force-pushed the feature/optionally-use-public-images branch from 6f286b4 to 0d423f1 Compare April 20, 2023 03:48
@openshift-ci
Copy link

openshift-ci bot commented Apr 20, 2023

@smuda: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/sandboxed-containers-operator-e2e 0d423f1 link false /test sandboxed-containers-operator-e2e

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@gkurz gkurz added lgtm Indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Apr 21, 2023
Copy link
Member

@gkurz gkurz left a comment

Choose a reason for hiding this comment

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

Thanks @smuda !

@gkurz gkurz merged commit 2edbc9d into openshift:main Apr 21, 2023
2 of 3 checks passed
@smuda smuda deleted the feature/optionally-use-public-images branch April 22, 2023 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Images in Dockerfile not acessible to public
4 participants