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

Quarkus image build fails when using fake registry name with quarkus.kubernetes.deploy=true #26385

Closed
spolti opened this issue Jun 27, 2022 · 11 comments · Fixed by #26460
Closed
Assignees
Milestone

Comments

@spolti
Copy link
Contributor

spolti commented Jun 27, 2022

Describe the bug

When trying to building a application tagging for a non existing registry or using a image name that was not pushed yet, Quarkus Jib build will fail.

Use case: using minikube remote docker daemon to be able to build and deploy on Minikube without the need to push the container to a registry.

The issue below only happens in case you tag the image and set the kubernetes deployment to true together.
If only the Container image is done, it will work.

[WARNING] [io.quarkus.container.image.jib.deployment.JibProcessor] Base image 'registry.access.redhat.com/ubi8/openjdk-11-runtime:1.11' does not use a specific image digest - build may not be reproducible
[INFO] [io.quarkus.container.image.jib.deployment.JibProcessor] Using base image with digest: sha256:0aca47bf03430b5ee5033d67ba9b38871470af00fa7d80a38c1cc0ae34270935
[WARNING] [io.quarkus.container.image.jib.deployment.JibProcessor] GET https://dev.local/v2/ failed and will be retried
[WARNING] [io.quarkus.container.image.jib.deployment.JibProcessor] GET https://dev.local/v2/ failed and will be retried
[WARNING] [io.quarkus.container.image.jib.deployment.JibProcessor] GET https://dev.local/v2/ failed and will be retried
[WARNING] [io.quarkus.container.image.jib.deployment.JibProcessor] GET https://dev.local/v2/ failed and will be retried
[WARNING] [io.quarkus.container.image.jib.deployment.JibProcessor] GET https://dev.local/v2/ failed and will be retried
[WARNING] [io.quarkus.container.image.jib.deployment.JibProcessor] GET https://dev.local/v2/ failed and will be retried

Expected behavior

Build is finished with no errors.

Actual behavior

Jib tries do validate the registry or query the image metadata leading the image build to fail.

How to Reproduce?

1- enable minikube remote docker daemon
2- build the application with the following properties:

quarkus build -Dquarkus.container-image.build=true -DskipTests  \
    -Dquarkus.container-image.group=kogito \
    -Dquarkus.container-image.name=serverless-workflow-greeting-quarkus \
    -Dquarkus.container-image.tag=1.0-native \
    -Dquarkus.container-image.registry=dev.local \ # required to skip knative image verification
    -Dquarkus.kubernetes.deployment-target=knative \
    -Dquarkus.knative.name=greeting-quarkus-cli \
    -Dquarkus.kubernetes.deploy=true \
    -Dquarkus.kubernetes.namespace=serverless-workflow-greeting-quarkus

Output of uname -a or ver

Linux 5.18.5-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jun 16 14:51:11 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "17.0.3" 2022-04-19 OpenJDK Runtime Environment 21.9 (build 17.0.3+7) OpenJDK 64-Bit Server VM 21.9 (build 17.0.3+7, mixed mode, sharing)

GraalVM version (if different from Java)

version from Quarkus native builder image

Quarkus version or git rev

2.10.0.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.2 (ea98e05a04480131370aa0c110b8c54cf726c06f)

Additional information

No response

@spolti spolti added the kind/bug Something isn't working label Jun 27, 2022
@spolti
Copy link
Contributor Author

spolti commented Jun 27, 2022

/assign @iocanel

@quarkus-bot
Copy link

quarkus-bot bot commented Jun 27, 2022

/cc @geoand, @iocanel

@geoand
Copy link
Contributor

geoand commented Jun 27, 2022

For minikube, we pretty much already handle this case: https://quarkus.io/guides/deploying-to-kubernetes#deploying-to-minikube

Essentially for Minikube we don't push to a registry but instead but to the docker daemon.

How is this case different?

@spolti
Copy link
Contributor Author

spolti commented Jun 27, 2022

Essentially for Minikube we don't push to a registry but instead but to the docker daemon.

That's the point, the registry a.b.c and image I tag it shouldn't be verified at build time, which in this case, is happening.
Due this the build is failing at it's very early stage, but if you remove the property to deploy on k8s, the build proceeds as expected.

@geoand
Copy link
Contributor

geoand commented Jun 28, 2022

Can you try adding quarkus.container-image.push=false?

The way things stand now, when you specify a registry, Quarkus will try to push the container image.
I suppose we could have some additional kubernetes specific property to prevent this...

@spolti
Copy link
Contributor Author

spolti commented Jun 29, 2022

Hi @geoand sry for the delay, I got the same behavior.

@geoand geoand self-assigned this Jun 30, 2022
geoand added a commit to geoand/quarkus that referenced this issue Jun 30, 2022
Before this change, we handled Minikube in a special way in order to
take advantage of the fact that the Minikube docker daemon already
contained the built container image.

This change introduces a way for users to opt in to this same feature
by setting quarkus.kubernetes.prevent-container-image-push

Resolves: quarkusio#26385
@geoand
Copy link
Contributor

geoand commented Jun 30, 2022

I have opened #26460. Can you check it out?

@iocanel
Copy link
Contributor

iocanel commented Jul 4, 2022

Can you try adding quarkus.container-image.push=false?
This is the way!

This should be working as expcted, as I recently fixed some bugs around it. If not, then @spolti is either using a version prior to the fix or we have a regression.

geoand added a commit to geoand/quarkus that referenced this issue Jul 5, 2022
This change makes sure that quarkus.container-image.push=false is
 taken into account and always prevents container images from being
 pushed, even if a kubernetes extension requests a deployment.

Resolves: quarkusio#26385
@quarkus-bot quarkus-bot bot added this to the 2.11 - main milestone Jul 5, 2022
geoand added a commit that referenced this issue Jul 5, 2022
Make quarkus.container-image.push=false effective in all k8s extensions
@gsmet gsmet modified the milestones: 2.11 - main, 2.10.2.Final Jul 5, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jul 5, 2022
This change makes sure that quarkus.container-image.push=false is
 taken into account and always prevents container images from being
 pushed, even if a kubernetes extension requests a deployment.

Resolves: quarkusio#26385
(cherry picked from commit 7612dde)
@spolti
Copy link
Contributor Author

spolti commented Jul 11, 2022

Hi @geoand, @iocanel sry for the late reply.
With the changes mentioned in the PR the issue is fixed.

Thanks very much for the assistance.

@iocanel
Copy link
Contributor

iocanel commented Jul 11, 2022

Yay!

@geoand
Copy link
Contributor

geoand commented Jul 12, 2022

Excellent!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants