Closed survivant closed 3 years ago
/cc @galderz, @geoand, @zakkak
and a little question. What that means those logs ? 6,98 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:25] classlist: 13 170,14 ms, 0,94 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:25] (cap): 753,21 ms, 0,94 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:25] setup: 2 835,91 ms, 0,94 GB
00:31:07,352 INFO [org.jbo.threads] JBoss Threads version 3.2.0.Final
[code-with-quarkus-1.0.0-SNAPSHOT-runner:25] (clinit): 1 588,20 ms, 5,04 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:25] (typeflow): 30 064,91 ms, 5,04 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:25] (objects): 59 123,31 ms, 5,04 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:25] (features): 2 051,67 ms, 5,04 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:25] analysis: 96 585,97 ms, 5,04 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:25] universe: 3 990,90 ms, 5,04 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:25] (parse): 18 654,62 ms, 5,72 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:25] (inline): 5 278,52 ms, 6,02 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:25] (compile): 50 585,12 ms, 6,98 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:25] compile: 78 410,49 ms, 6,98 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:25] image: 12 288,81 ms, 6,98 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:25] write: 2 631,13 ms, 6,98 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:25] [total]: 210 478,24 ms, 6,98 GB
just curious
@zakkak it looks like GraalVM does not like the Final
suffix that Mandrel adds
Yes, that's a known issue fixed in the latest Mandrel images.
@survivant can you please try with -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:20.3.1.2-Final-java11
or even better -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11
.
What I don't understand is why https://quarkus.io/guides/building-native-image#container-runtime still shows {mandrel-flavor}
instead of the right tag. This should have been fixed by https://github.com/quarkusio/quarkus/pull/15675
and a little question. What that means those logs ? 6,98 GB
It's the amount of memory used by native-image
at each step while building the native image.
it passed, but I don't see Docker building this application container image. Do I have to include docker dependances in my pom.xml ? and Another question. I'm on Windows. There is no point of building the native image if I don't use it in docker/podman ?
PS C:\junk\quarkus-native\code-with-quarkus> mvn package -Pnative -DskipTests "-Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11" "-Dquarkus.native.container-build=true"
....
[INFO] [io.quarkus.deployment.pkg.steps.NativeImageBuildRunner] docker run --env LANG=C --rm -v //c/junk/quarkus-native/code-with-quarkus/target/code-with-quarkus-1.0.0-SNAPSHOT-native-image-source-jar:/project:z quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11 -J-Djava.util.logging.manager=org.jboss.logmanager.LogManager -J-Dsun.nio.ch.maxUpdateArraySize=100 -J-Dvertx.logger-delegate-factory-class-name=io.quarkus.vertx.core.runtime.VertxLogDelegateFactory -J-Dvertx.disableDnsResolver=true -J-Dio.netty.leakDetection.level=DISABLED -J-Dio.netty.allocator.maxOrder=1 -J-Duser.language=fr -J-Duser.country=CA -J-Dfile.encoding=UTF-8 --initialize-at-build-time= -H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy\$BySpaceAndTime -H:+JNI -H:+AllowFoldMethods -jar code-with-quarkus-1.0.0-SNAPSHOT-runner.jar -H:FallbackThreshold=0 -H:+ReportExceptionStackTraces -H:-AddAllCharsets -H:EnableURLProtocols=http,https --enable-all-security-services -H:-UseServiceLoaderFeature -H:+StackTrace code-with-quarkus-1.0.0-SNAPSHOT-runner
[code-with-quarkus-1.0.0-SNAPSHOT-runner:59] classlist: 22 456,44 ms, 0,96 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:59] (cap): 1 801,57 ms, 0,96 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:59] setup: 6 705,08 ms, 0,96 GB
13:10:09,706 INFO [org.jbo.threads] JBoss Threads version 3.2.0.Final
[code-with-quarkus-1.0.0-SNAPSHOT-runner:59] (clinit): 2 428,66 ms, 5,62 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:59] (typeflow): 65 023,76 ms, 5,62 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:59] (objects): 100 149,74 ms, 5,62 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:59] (features): 3 202,74 ms, 5,62 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:59] analysis: 175 340,30 ms, 5,62 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:59] universe: 5 696,52 ms, 5,62 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:59] (parse): 33 680,38 ms, 6,75 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:59] (inline): 7 982,04 ms, 6,34 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:59] (compile): 56 326,06 ms, 7,25 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:59] compile: 102 421,78 ms, 7,25 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:59] image: 18 967,25 ms, 7,14 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:59] write: 3 758,94 ms, 7,14 GB
[code-with-quarkus-1.0.0-SNAPSHOT-runner:59] [total]: 336 560,33 ms, 7,14 GB
[WARNING] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] objcopy executable not found in PATH. Debug symbols will not be separated from executable.
[WARNING] [io.quarkus.deployment.pkg.steps.NativeImageBuildStep] That will result in a larger native image with debug symbols embedded in it.
[INFO] [io.quarkus.deployment.QuarkusAugmentor] Quarkus augmentation completed in 449098ms
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 07:39 min
[INFO] Finished at: 2021-04-09T09:13:39-04:00
[INFO] ------------------------------------------------------------------------
it passed, but I don't see Docker building this application container image. Do I have to include docker dependances in my pom.xml ?
If I understand correctly you are interested in https://quarkus.io/guides/building-native-image#creating-a-container
I'm on Windows. There is no point of building the native image if I don't use it in docker/podman ?
Correct, unless you build the native image without -Dquarkus.native.container-build=true
and by setting GRAALVM_HOME
to point to the local installation of GraalVM. This will allow you to generate a native image that can run on Windows. Note however that this is a bit more complex and has some extra requirements.
my goal is to try to use the native build for my docker image that I'll deploy in Kubernetes
What I'm using right now is this command line :
mvn clean package -Dquarkus.container-image.push=true
or this
docker build -f Dockerfile -t docker.private.com:5000/kubernetes-api:master .
docker push docker.private.com:5000/kubernetes-api:master
PS. I added this in my pom.xml demo
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-container-image-docker</artifactId>
</dependency>
when I'm build my demo with this command line
mvn package -Pnative -DskipTests "-Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11" "-Dquarkus.native.container-build=true"
it doesn't build the docker image. What is the param that is missing ?
I don't see anything missing :/
I can build a container image with:
curl -O -J https://code.quarkus.io/api/download
unzip code-with-quarkus.zip
cd code-with-quarkus
./mvnw quarkus:add-extension -Dextensions="container-image-docker"
./mvnw clean package \
-Pnative \
-Dquarkus.native.container-build=true \
-Dquarkus.container-image.build=true \
-Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11
$ docker images | head -n 2
Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg.
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/zakkak/code-with-quarkus 1.0.0-SNAPSHOT a9c48b1ba974 2 minutes ago 134 MB
Keep in mind that this is on Linux using podman though.
I found the issue... man.. it wasn't clear. check that
Your
./mvnw clean package \
-Pnative \
-Dquarkus.native.container-build=true \
-Dquarkus.container-image.build=true \
-Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11
Mine
./mvnw clean package \
-Pnative \
-Dquarkus.native.container-build=true \
-Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:20.3-java11
the param -Dquarkus.container-image.build=true was missing in my command line. Should it be enabled when we specify -Dquarkus.native.container-build=true ?
Uh right! I thought you had tried that, my bad.
the param -Dquarkus.container-image.build=true was missing in my command line. Should it be enabled when we specify -Dquarkus.native.container-build=true ?
-Dquarkus.container-image.build=true
indicates that you want to package your application in a container-Dquarkus.native.container-build=true
indicates that you want to build a native image of your application using a container builder image (instead of using a local installation of GraalVM`).So yes if you want a native application packaged in a container you need both.
I wanted to test the native mode with Quarkus. I followed this guide : https://quarkus.io/guides/building-native-image#container-runtime
PS. I'm on Windows 10 using docker to build/run images
I created a small project using quarkus code.io
quarkus-native.zip
I did 3 tests.
1 - compile without native (normal.. so not important for this issue)
2 - compile native
3 - compile native with madrel
here the logs for #2
here the logs for #3