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

AppCDS: Make container-based generation opt-out #25427

Merged
merged 1 commit into from
May 11, 2022

Conversation

benkard
Copy link
Contributor

@benkard benkard commented May 6, 2022

This change adds a new configuration key, quarkus.package.appcds-use-container, which defaults to true and can be set to false to avoid the use of a container when building an AppCDS archive.

This is useful in cases where the build happens in an environment without full control of a container system, such as hosted CI solutions.

@quarkus-bot quarkus-bot bot added the area/core label May 6, 2022
@quarkus-bot

This comment has been minimized.

@benkard benkard force-pushed the feature/appcds-nodocker branch from 1c65aef to 39161dd Compare May 6, 2022 18:26
@quarkus-bot

This comment has been minimized.

@geoand
Copy link
Contributor

geoand commented May 7, 2022

Thanks for this.

Can elaborate a little more on the reasoning? Why would one need quarkus.package.create-appcds=true and quarkus.package.appcds-use-container=false?

@benkard
Copy link
Contributor Author

benkard commented May 7, 2022

My personal use case is a CI pipeline that runs in Bitbucket Pipelines. Bitbucket Pipelines gives me access to a restricted Docker daemon with some peculiarities about it. One such peculiarity is that the user ID that you pass to the container using docker run --user maps to something other than the same UID in the container running the build, which makes the attempt by the AppCDS container to write its output file fail. Even if I work around this by creating all directories beforehand and applying chmod 0777 to everything I can find creation of the AppCDS archive still fails for other reasons related to the managed Docker daemon. In this environment I also cannot run my own Docker daemon because my pipeline runs in a restricted container itself.

On the other hand I can select the container that the build pipeline itself runs in, so I can easily make it use the same exact container image that I use as my target Jib base image (or one derived from it). I checked—creating the AppCDS archive in the build container itself works fine. It is only when I add Jib to the mix that it fails because the Jib target image is detected as an image to run the AppCDS build in (which is usually what you want, just not in my particular case) and so it attempts to use Docker to do the AppCDS, which fails due to the above-mentioned reasons.

(You could also use it to build entirely without a container runtime, which is one of the advantages of using Jib.)

Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

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

Thanks

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@geoand
Copy link
Contributor

geoand commented May 11, 2022

@benkard mind rebasing this onto main?

Thanks

This change adds a new configuration key,
quarkus.package.appcds-use-container, which defaults to true and can be
set to false to avoid the use of a container when building an AppCDS
archive.

This is useful in cases where the build happens in an environment
without full control of a container system, such as hosted CI solutions.
@benkard benkard force-pushed the feature/appcds-nodocker branch from 39161dd to b2020b7 Compare May 11, 2022 06:59
@geoand geoand merged commit 9873e60 into quarkusio:main May 11, 2022
@quarkus-bot quarkus-bot bot added this to the 2.10 - main milestone May 11, 2022
@gsmet gsmet modified the milestones: 2.10 - main, 2.9.1.Final May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants