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

Feat-multi-arch-containers #5533

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

duncdrum
Copy link
Contributor

@duncdrum duncdrum commented Nov 2, 2024

enables a long overdue feature: multi-arch containers for existdb/existdb
backport will remove a release blocker for 6.3.1

sidessteps docker maven plugin bug, deploy is green again.
see fabric8io/docker-maven-plugin#1835

fixes outdated JRE patches, bumps base image to Debian 12
see #5450
close #4151
close #5532
close #4153

dependencies are part of distroless base image
enable experimental image push for testing
@duncdrum duncdrum added the docker issues related to our container images label Nov 2, 2024
@duncdrum duncdrum added this to the eXist-6.3.1 milestone Nov 2, 2024
@duncdrum
Copy link
Contributor Author

The codacy issue here is pointless. We are trying to generate moving tag latest images. So they are based on latest base images from upstream on purpose

@duncdrum duncdrum force-pushed the feat-multi-arch-containers branch 2 times, most recently from 44ac3cd to edfc10e Compare November 12, 2024 13:03
@duncdrum
Copy link
Contributor Author

Deploy in my fork:

Screenshot 2024-11-12 at 15 49 10

images tested locally, all good.

Screenshot 2024-11-12 at 15 53 21

@duncdrum duncdrum marked this pull request as ready for review November 12, 2024 14:54
@duncdrum duncdrum requested a review from a team as a code owner November 12, 2024 14:54
@dizzzz
Copy link
Member

dizzzz commented Nov 12, 2024

Ubuntu build fails, any idea ?
Don't have a laptop around to check the logs ...

@duncdrum
Copy link
Contributor Author

@dizzzz some timeout with building distribution packages, I restarted it. Pretty sure it's unrelated to the changes in here.

Copy link
Member

@line-o line-o left a comment

Choose a reason for hiding this comment

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

@duncdrum is this good to go? Should we wait for the back port to 6.x.x?

@duncdrum
Copy link
Contributor Author

@line-o this is good to go. There are problems with the back port, but I m 99,9% certain that these will not affect the contents of this PR, which also fixes our broken ci.

@line-o
Copy link
Member

line-o commented Nov 18, 2024

@duncdrum would you have the time to edit the commit message of edfc10e

to

[bugfix] workaround to deploy images to dockerhub

fixes #5450

sidesteps [docker maven plugin bug](https://github.com/fabric8io/docker-maven-plugin/issues/1835)

If you do not have time I would volunteer to do this.

@duncdrum
Copy link
Contributor Author

@line-o go ahead I ll be afk a lot this week. Thanks for the help

Copy link

sonarcloud bot commented Nov 19, 2024

@line-o line-o self-requested a review November 19, 2024 12:29
Copy link
Member

@line-o line-o left a comment

Choose a reason for hiding this comment

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

LGTM


FROM gcr.io/distroless/java17:latest

# Copy over dependencies for Apache FOP, missing from GCR's JRE
Copy link
Contributor

@adamretter adamretter Nov 19, 2024

Choose a reason for hiding this comment

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

This change breaks XSL:FO in eXist-db when using Apache FOP. Unfortunately, the gcr.io/distroless/java17-debian12:latest image you have chosen to update to does not include these libraries. Please test a proper XSL-FO to PDF transformation with these changes, and you will see the error.

Copy link
Member

Choose a reason for hiding this comment

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

This PR switches from gcr.io/distroless/java17:latest to gcr.io/distroless/java17-debian12:latest
The lines stating they would be needed for FOP are commented out (lines 24-27 and 32-41) and select a different base image debian:bullseye-slim.
So, even if those additional libraries were needed for PDF-generation using XSL:FO they are already missing and nothing is changed from the status quo.
It, therefore, would be beneficial to create an additional Dockerfile that has all that is needed for this specific use-case. This could also be provided by a third party.
This is all just under the pretense that this is really needed for PDF generation and the adoption rate would also show us how common it is.

Copy link
Contributor

Choose a reason for hiding this comment

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

@line-o It looks like they are only commented out because they were recently done so in a prior Pull Request that looks like it broke this.

I pointed out the problems in #4895 would break Apache FOP here, here, and here.

The response was that the base image now contains the required libraries, however, I have now checked the base image, and it is clear that that is not the case. See below:

Screenshot 2024-11-21 at 11 23 13

We can see in the above image that /usr/lib inside the base image does not contain the previously required libraries.

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 they are no longer included that's a bug likely introduced when moving to debian 12. see GoogleContainerTools/distroless#321 or GoogleContainerTools/distroless#789 from 2019 and 2021 for relevant discussions. I will check the java-base image and move the discussion to the distroless repo

Copy link
Contributor

@adamretter adamretter Nov 21, 2024

Choose a reason for hiding this comment

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

I don't see it as a bug with Debian 12 or GCR. Simply, GCR has never included these libraries as many Java Applications don't need them. However, we do need them for eXist-db, which is why previously we explicitly installed them into a base Debian image and then copied them into our derivative of GCR.

Copy link
Contributor

Choose a reason for hiding this comment

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

@duncdrum I can't see it in the GCR java-base images (see below)... Where are you seeing it?

Screenshot 2024-11-21 at 15 43 57 Screenshot 2024-11-21 at 15 41 33

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adamretter https://github.com/GoogleContainerTools/distroless/blob/main/java/BUILD#L117 here actually. I also remember and tested that the files were present after the discussions 3-4 years ago. If they no longer are it's a bug. Only libssl should no longer be included on Debian 12 Java images. I won't have time to look into this for another week or so. But I will check again. In the meantime I don't see how keeping a failing deploy tank running is helping. More fixes should come in a separate PR.

Copy link
Contributor

@adamretter adamretter Nov 21, 2024

Choose a reason for hiding this comment

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

@duncdrum Interesting that the files even though listed in that BUILD file don't seem to have ever been in the published GCR images as far as I can see.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to be sure @adamretter You are checking in subsequent layers as well, and not seeing the dependencies?

Copy link
Contributor

Choose a reason for hiding this comment

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

You are checking in subsequent layers as well, and not seeing the dependencies?

@duncdrum Yes, I think so. What do you see when you look in the image?

@@ -21,7 +21,7 @@
#

# Use JDK 17 in Debian Bullseye (as our production image gcr.io/distroless/java:17 is based on Debian Bullseye with just a JRE)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this comment is out of date if you are switching the non-debug build to bookworm also.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, better remove the name of a specific build of Debian from the comment, otherwise we will need to change it everytime the base image changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docker issues related to our container images needs 6.x.x backport
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

[CI] Change docker setup does this need to be there ? [feature] multi-arch docker images
5 participants