Closed chainhead closed 1 year ago
Why does this happen and what is the workaround?
It seems you're using an older Quarkus release that is unable to detect the new GraalVM version scheme (Java version 20.X.Y instead of GraalVM version 23.X.Y). The best way to fix this is to upgrade to the latest version of Quarkus.
Having said that, the following no longer makes sense in the context of the graalvm-community
and graalvm
distributions:
version: "20.0.1"
java-version: '20'
components: 'native-image'
You can set a specific java-version
(e.g., 20.0.1
), or major version (e.g., 20
), version
is no longer needed. Since native-image
is now included by default, you also no longer need components: 'native-image'
.
Hope this helps!
This means, there are two fixes I need to do - Quarkus update and GH Action update for GraalVM set-up. Can you please guide me?
pom.xml
and let mvn
do its magic? <properties>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>2.12.2.Final</quarkus.platform.version> <!-- change this? -->
<skipITs>true</skipITs>
<surefire-plugin.version>3.0.0-M7</surefire-plugin.version>
</properties>
Dockerfile
? I see there is a 2.0
available.# Change base image to 2.0 tag
FROM quay.io/quarkus/quarkus-micro-image:1.0
WORKDIR /work/
RUN chown 1001 /work \
&& chmod "g+rwX" /work \
&& chown 1001:root /work
COPY --chown=1001:root target/*-runner /work/application
EXPOSE 8080
USER 1001
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
java-version
seems to be required - anyway, I can get the Action to use the 'latest'?- id: setup
name: Set-up GraalVM
uses: graalvm/setup-graalvm@v1
with:
distribution: 'graalvm-community'
java-version: '20'
cache: 'maven'
github-token: ${{ secrets.GITHUB_TOKEN }}
So, the following worked.
pom.xml
<properties>
<compiler-plugin.version>3.11.0</compiler-plugin.version> <!-- changed this -->
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
<quarkus.platform.version>3.2.0.Final</quarkus.platform.version> <!-- changed this -->
<skipITs>true</skipITs>
<surefire-plugin.version>3.0.0-M7</surefire-plugin.version>
</properties>
publish.yaml
- id: setup
name: Set-up GraalVM
uses: graalvm/setup-graalvm@v1
with:
distribution: 'graalvm-community'
java-version: '20'
cache: 'maven'
github-token: ${{ secrets.GITHUB_TOKEN }}
Further, I will experiment the latest Quarkus base image.
Thanks.
anyway, I can get the Action to use the 'latest'?
You mean the latest Java version? You can use java-version: 'dev'
, which gives you a GraalVM dev build, which in turn are moved to the latest Java version whenever GraalVM is ready.
I meant, current LTS version that is automatically referred to.
Ah ok, no, we don't have that. Given that there are years in between LTS releases, I'm not sure how useful an latest-lts
label would be.
1 pipeline less to manage. :)
It may cause more harm than it is useful. Also, it's not something setup-java supports, so I'm not sure we want to support it here. Maybe file a feature request and collect some upvotes? :)
Hi, The following is a snippet of my GH action where, I am downloading the GraalVM CE and building the image for a native micro Quarkus application with
maven
.The build keeps failing as shown below.
I did try with
graalvm
andmandrel
distribution (this issue #48 ) notwithstanding). I get the same error.Why does this happen and what is the workaround?