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

4.x: Native image update #7711

Merged
merged 10 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,25 @@ jobs:
- name: Test archetypes
run: etc/scripts/test-archetypes.sh
packaging:
timeout-minutes: 30
timeout-minutes: 60
strategy:
matrix:
os: [ ubuntu-20.04, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v3.13.0
- uses: graalvm/setup-graalvm@v1
with:
distribution: ${{ env.JAVA_DISTRO }}
java-version: ${{ env.JAVA_VERSION }}
java-version: 21
distribution: graalvm-community
github-token: ${{ secrets.GITHUB_TOKEN }}
native-image-job-reports: true
cache: maven
- name: Build Helidon
run: etc/scripts/github-compile.sh
- name: JAR packaging
run: etc/scripts/test-packaging-jar.sh
- name: JLink packaging
run: etc/scripts/test-packaging-jlink.sh
- name: Native-Image packaging
run: etc/scripts/test-packaging-native.sh
4 changes: 2 additions & 2 deletions applications/parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
<version.plugin.failsafe>3.1.2</version.plugin.failsafe>
<version.plugin.helidon>4.0.0-M2</version.plugin.helidon>
<version.plugin.helidon-cli>4.0.0-M2</version.plugin.helidon-cli>
<version.plugin.jar>3.0.2</version.plugin.jar>
<version.plugin.nativeimage>0.9.16</version.plugin.nativeimage>
<version.plugin.jar>3.3.0</version.plugin.jar>
<version.plugin.nativeimage>0.9.27</version.plugin.nativeimage>
<version.plugin.os>1.5.0.Final</version.plugin.os>
<version.plugin.protobuf>0.6.1</version.plugin.protobuf>
<version.plugin.resources>3.3.1</version.plugin.resources>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

# 1st stage, build the app
FROM ghcr.io/graalvm/graalvm-ce:ol9-java21-22.3.1 as build

# Install native-image
RUN gu install native-image
FROM ghcr.io/graalvm/graalvm-community:21.0.0-ol9 as build

WORKDIR /usr/share

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<source src="/common/sources.xml"/>
<output>
<model>
<value key="mainClass">${package}.Main</value>
<value key="parent-artifactId">helidon-mp</value>
<list key="dependencies">
<map>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

package {{package}};

/**
* Main entry point of the application.
* This class is registered as the main class in the jar manifest, as well as the main class of the module.
*/
public class Main {
/**
* Main method. Starts CDI (and the application).
*
* @param args ignored
*/
public static void main(String[] args) {
io.helidon.Main.main(args);
}
}
2 changes: 2 additions & 0 deletions archetypes/helidon/src/main/archetype/mp/custom/custom-mp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
<value>jakarta.cdi</value>
<value>jakarta.inject</value>
<value>jakarta.ws.rs</value>
<value>io.helidon</value>
<value>io.helidon.microprofile.config</value>
<value>io.helidon.microprofile.server</value>
</list>
</model>
</output>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"resources": [
{
"pattern": "META-INF/helidon/media-types.properties"
},
{
"pattern": "io/helidon/common/media/type/default-media-types.properties"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"resources": [
{
"pattern": "mp-meta-config.yaml"
},
{
"pattern": "mp-meta-config.properties"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,51 @@
{
"pattern": "application.properties"
},
{
"pattern": "application.yaml"
},
{
"pattern": "application.json"
},
{
"pattern": "application.conf"
},
{
"pattern": "application.yml"
},
{
"pattern": "meta-config.properties"
},
{
"pattern": "meta-config.json"
},
{
"pattern": "meta-config.yaml"
},
{
"pattern": "meta-config.yml"
},
{
"pattern": "meta-config.conf"
},
{
"pattern": "config-profile.yaml"
},

{
"pattern": "config-profile.properties"
},

{
"pattern": "config-profile.json"
},

{
"pattern": "config-profile.conf"
},

{
"pattern": "config-profile.yml"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2020 Oracle and/or its affiliates.
# Copyright (c) 2020, 2023 Oracle and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -14,4 +14,4 @@
# limitations under the License.
#

Args=--initialize-at-build-time=org.slf4j -H:EnableURLProtocols=https
Args=--enable-https

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@
},
{
"pattern": "config-profile-.*\\.yaml$"
},
{
"pattern": "application.yml"
},
{
"pattern": "meta-config.yml"
},
{
"pattern": "config-profile.yml"
},
{
"pattern": "config-profile-.*\\.yml$"
}
]
}

This file was deleted.

11 changes: 9 additions & 2 deletions dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<version.lib.google-oauth-client>1.33.3</version.lib.google-oauth-client>
<version.lib.google-error-prone>2.3.3</version.lib.google-error-prone>
<version.lib.google-protobuf>3.21.7</version.lib.google-protobuf>
<version.lib.graalvm>22.3.0</version.lib.graalvm>
<version.lib.graalvm>23.1.0</version.lib.graalvm>
<version.lib.graphql-java>18.6</version.lib.graphql-java>
<version.lib.graphql-java.extended.scalars>18.3</version.lib.graphql-java.extended.scalars>
<version.lib.gson>2.9.0</version.lib.gson>
Expand Down Expand Up @@ -95,6 +95,7 @@
<version.lib.jgit>6.7.0.202309050840-r</version.lib.jgit>
<version.lib.junit>5.9.3</version.lib.junit>
<version.lib.kafka>3.4.0</version.lib.kafka>
<version.lib.kotlin>1.8.0</version.lib.kotlin>
<version.lib.log4j>2.18.0</version.lib.log4j>
<version.lib.logback>1.4.0</version.lib.logback>
<version.lib.mariadb-java-client>2.6.2</version.lib.mariadb-java-client>
Expand Down Expand Up @@ -915,7 +916,7 @@
</dependency>
<dependency>
<groupId>org.graalvm.sdk</groupId>
<artifactId>graal-sdk</artifactId>
<artifactId>nativeimage</artifactId>
<version>${version.lib.graalvm}</version>
</dependency>
<dependency>
Expand Down Expand Up @@ -953,6 +954,12 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<!-- required transitively by okhttp (used in OpenTelemetry through Jaeger) -->
<artifactId>kotlin-stdlib</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${version.lib.kotlin}</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-binding</artifactId>
Expand Down
14 changes: 4 additions & 10 deletions docs/includes/guides/graalnative.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,16 @@ include::{rootdir}/includes/prerequisites.adoc[tag=prerequisites-graal]
== Install GraalVM and the Native Image Command

After {graalvm-doc-url}/docs/getting-started/[downloading and installing] GraalVM,
set the `GRAALVM_HOME` environment variable to point at your GraalVM installation.
set the `GRAALVM_HOME` environment variable to point at your GraalVM installation,
or use the GraalVM installation as your Java home.

[source,bash]
----
# Your path might be different
export GRAALVM_HOME=/usr/local/graalvm-jdk-21+35.1/Contents/Home/
----

Then install the optional `native-image` command:

[source,bash]
----
$GRAALVM_HOME/bin/gu install native-image
----

And verify:
Then verify:

[source,bash]
----
Expand Down Expand Up @@ -130,7 +124,7 @@ mvn package -Pnative-image
----

[TIP]
This uses the `helidon-maven-plugin` to perform the native compilation using your installed
This uses the `org.graalvm.buildtools:native-maven-plugin` to perform the native compilation using your installed
copy of GraalVM. It might take a while to complete.

Once it completes start the application using the native executable (no JVM!):
Expand Down
Loading