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

Remote Container build does not copy all build artifacts #41020

Closed
hijoft opened this issue Jun 6, 2024 · 6 comments · Fixed by #41201
Closed

Remote Container build does not copy all build artifacts #41020

hijoft opened this issue Jun 6, 2024 · 6 comments · Fixed by #41201
Assignees
Labels
area/native-image kind/bug Something isn't working
Milestone

Comments

@hijoft
Copy link

hijoft commented Jun 6, 2024

We are building a Quarkus native image in Gitlab Pipeline using Gradle and "remote container build" with Docker.
Since we added https://quarkus.io/extensions/io.quarkiverse.poi/quarkus-poi/ extension and configured the Dockerfile according to Quarkus-POI guidelines (install and copy libraries), we faced java.awt.Font NoClassDefFoundError errors during generation of an Excel sheet.

ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-7) HTTP Request to /reports/api/v1/download?start=2023-01&end=2024-12&source=ALL failed, error id: 6dc1b7cd-0365-4e01-b08c-b18f861228d9-1: java.lang.NoClassDefFoundError: Could not initialize class java.awt.Font

Debugging has shown the *.so files generated next to the *-runner application files are not copied back to the build output directory from the remote container. Building it locally by using just "container build" works as expected and the runtime error did not appear with the required *.so files next to the *-runner application file.

Debugging the build process confirmed: only the *-runner file is copied back from the container.
buildstep

Digging into the source we found there is no option to preserve the other produced build artifacts, just the executable will be copied back.

protected void postBuild(Path outputDir, String nativeImageName, String resultingExecutableName) {

It would be great to have all build artifacts preserved for further steps in the build process.
For now we just copy the libs from a different location, but it would be great to just use them from remote container build.

$ java --version
openjdk 17.0.10 2024-01-16
OpenJDK Runtime Environment (build 17.0.10+7-alpine-r0)
OpenJDK 64-Bit Server VM (build 17.0.10+7-alpine-r0, mixed mode, sharing)

$ docker version
Client:
Version: 20.10.22
API version: 1.41
Go version: go1.18.9
Git commit: 3a2c30b
Built: Thu Dec 15 22:21:58 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.22
API version: 1.41 (minimum version 1.12)
Go version: go1.18.9
Git commit: 42c8b31
Built: Thu Dec 15 22:26:12 2022
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.15
GitCommit: 5b842e528e99d4d4c1686467debf2bd4b88ecd86
runc:
Version: 1.1.4
GitCommit: v1.1.4-0-g5fd4c4d
docker-init:
Version: 0.19.0
GitCommit: de40ad0

Build command:

./gradlew build -Dquarkus.package.type=native -Dquarkus.native.remote-container-build=true -Dquarkus.native.native-image-xmx=8g -x test`

@quarkus-bot
Copy link

quarkus-bot bot commented Jun 6, 2024

/cc @Karm (mandrel), @galderz (mandrel), @zakkak (mandrel,native-image)

@geoand geoand added the kind/bug Something isn't working label Jun 6, 2024
@Karm
Copy link
Member

Karm commented Jun 6, 2024

It requires a similar fix to this one, i.e. to copy the libs. Note that it is paramount to those libs coming from the same build as the main executable.

@geoand
Copy link
Contributor

geoand commented Jun 6, 2024

@Karm do you plan on working on that?

@Karm
Copy link
Member

Karm commented Jun 6, 2024

@geoand My Gradle-fu is weak, but I'll try 👍

@Karm Karm self-assigned this Jun 6, 2024
@geoand
Copy link
Contributor

geoand commented Jun 6, 2024

🙏

@Karm
Copy link
Member

Karm commented Jun 11, 2024

I have the issue reproduced, fixing shortly...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/native-image kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants