From a092f874273b22fe7a65fe990481a6523f734082 Mon Sep 17 00:00:00 2001 From: Tomas Langer Date: Fri, 20 Oct 2023 00:44:29 +0200 Subject: [PATCH] AOT update, remove aot site, update guides for native image (#7859) --- docs/includes/guides/graalnative.adoc | 2 + docs/mp/aot.adoc | 117 ------------------------ docs/se/aot.adoc | 122 -------------------------- docs/se/introduction.adoc | 7 -- docs/sitegen.yaml | 12 --- 5 files changed, 2 insertions(+), 258 deletions(-) delete mode 100644 docs/mp/aot.adoc delete mode 100644 docs/se/aot.adoc diff --git a/docs/includes/guides/graalnative.adoc b/docs/includes/guides/graalnative.adoc index 2e5212aa5a0..9bb10eb6532 100644 --- a/docs/includes/guides/graalnative.adoc +++ b/docs/includes/guides/graalnative.adoc @@ -173,3 +173,5 @@ HotSpot VM might be more appropriate. For information about creating custom Java runtime images see xref:{guidesdir}/jlink-image.adoc[Custom Runtime Images with `jlink`]. + +NOTE: When building Helidon using native-image, we check features on classpath, and warn if there is a problem or restriction of support diff --git a/docs/mp/aot.adoc b/docs/mp/aot.adoc deleted file mode 100644 index be0afdab800..00000000000 --- a/docs/mp/aot.adoc +++ /dev/null @@ -1,117 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// - - Copyright (c) 2021, 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. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -/////////////////////////////////////////////////////////////////////////////// - -= GraalVM native image -:description: Helidon AOT using GraalVM native-image -:keywords: helidon, aot, native, native-image, image, executable, mp -:rootdir: {docdir}/.. - -include::{rootdir}/includes/mp.adoc[] - -Helidon applications can be compiled into a native executable using GraalVM -native image. - -When using applications created using the CLI, or when you configure Helidon -application pom as a parent of your module, you can use the following steps to -build a native image from your application: - -1. Create an environment variable `GRAALVM_HOME` pointing to your installation of - GraalVM, or use a GraalVM JDK to build your project -2. Add configuration to initialize your packages at build time (see below) -3. Run Maven command `mvn clean package -Pnative-image` -4. Execute the native executable created in `target` directory of your project - -== Initialize at build time -Helidon MP requires the types of all beans created within CDI to be initialized at builder time, to achieve that: - -1. Create `src/main/resources/META-INF/native-image/groupId/artifactId/native-image.properties` file (`groupId` and `artifactId` - of the module you are building should be used) -2. Add the following line to the file: -```properties -Args=--initialize-at-build-time=your.application.package -``` - -== AOT supported modules - -Some Helidon components are not (yet) supported in native image, some have -restrictions. The following table lists all Helidon features and their support -for native image. - -.Helidon MP features in AOT -[cols="^1,^2s,<6,<6"] -|=== -|{nbsp} |Feature ^|Component ^|AOT note - -|✅ |CDI |CDI |{nbsp} -|✅ |Config |Config |{nbsp} -|✅ |{nbsp} |Encryption |{nbsp} -|✅ |{nbsp} |YAML |{nbsp} -|✅ |Fault Tolerance |Fault Tolerance |{nbsp} -|✅ |Health |Health |{nbsp} -|✅ |{nbsp} |Built-ins |{nbsp} -|✅ |JAX-RS |JAX-RS |{nbsp} -|✅ |JPA |JPA |{nbsp} -|❓ |{nbsp} |EclipseLink |Not yet tested. -|🔶 |{nbsp} |Hibernate |Experimental support, tested on limited use cases with Helidon Oracle and H2 JDBC modules -|🔶 |JTA |JTA |Experimental support, tested on limited use cases -|✅ |Messaging |Messaging |{nbsp} -|✅ |Metrics |Metrics |{nbsp} -|✅ |Open API |Open API |{nbsp} -|🔶 |REST Client |REST Client |Does not support execution of default methods on interfaces. -|✅ |Security |Security |{nbsp} -|✅ |{nbsp} |Integration: Jersey |{nbsp} -|✅ |{nbsp} |Integration: WebServer |{nbsp} -|✅ |{nbsp} |Integration: gRPC |{nbsp} -|✅ |{nbsp} |JWT Auth |{nbsp} -|✅ |{nbsp} |OIDC |{nbsp} -|✅ |{nbsp} |Provider: ABAC |{nbsp} -|✅ |{nbsp} |Provider/ABAC/Policy: EL |Requires reflection configuration for used classes. -|✅ |{nbsp} |Provider/ABAC: Role |{nbsp} -|✅ |{nbsp} |Provider/ABAC: Scope |{nbsp} -|✅ |{nbsp} |Provider/ABAC: Time |{nbsp} -|❓ |{nbsp} |Provider: Google Login |Not yet tested. -|✅ |{nbsp} |Provider: Header |{nbsp} -|✅ |{nbsp} |Provider: HTTP Basic |{nbsp} -|✅ |{nbsp} |Provider: HTTP Digest |{nbsp} -|✅ |{nbsp} |Provider: HTTP Signatures |{nbsp} -|❓ |{nbsp} |Provider: IDCS Role Mapper |Not yet tested. -|✅ |{nbsp} |Provider: JWT |{nbsp} -|✅ |Server |Server |{nbsp} -|✅ |{nbsp} |Access Log |{nbsp} -|✅ |{nbsp} |CORS |{nbsp} -|✅ |Tracing |Tracing |{nbsp} -|✅ |{nbsp} |Integration: Jersey Server |{nbsp} -|✅ |{nbsp} |Integration: Jersey Client |{nbsp} -|✅ |{nbsp} |Jaeger |{nbsp} -|✅ |{nbsp} |Zipkin |{nbsp} -|✅ |Web Client |Web Client |{nbsp} -|✅ |{nbsp} |Metrics |{nbsp} -|✅ |{nbsp} |Security |{nbsp} -|✅ |{nbsp} |Tracing |{nbsp} -|✅ |{nbsp} |Websocket |Server only. -|✅ |gRPC Server |gRPC Server |{nbsp} -|✅ |{nbsp} |Metrics |{nbsp} -|✅ |gRPC Client |gRPC Client |{nbsp} -|✅ |{nbsp} |Metrics |{nbsp} -|✅ |Scheduling |Scheduling |{nbsp} -|✅ |OCI |OCI Integration |Modules with group id `io.helidon.integrations.oci` -|✅ |Vault |Hashicorp Vault Integration |{nbsp} -|✅ |Long Running Actions |Client |{nbsp} -|✅ |{nbsp} |Coordinator |Only with external database -|=== - diff --git a/docs/se/aot.adoc b/docs/se/aot.adoc deleted file mode 100644 index c4341c2294a..00000000000 --- a/docs/se/aot.adoc +++ /dev/null @@ -1,122 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// - - 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. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -/////////////////////////////////////////////////////////////////////////////// - -= GraalVM Native Image -:description: Helidon AOT using GraalVM native-image -:keywords: helidon, aot, native, native-image, image, executable, se -:rootdir: {docdir}/.. - -include::{rootdir}/includes/se.adoc[] - -== Contents -- <> -- <> - -== Overview - -Helidon applications can be compiled into a native executable using GraalVM -native image. - -When using applications created using the CLI, or when you configure Helidon -application pom as a parent of your module, you can use the following steps to -build a native image from your application: - -1. Create an environment variable `GRAALVM_HOME` pointing to your installation of - GraalVM with `native-image` installed -2. Run Maven command `mvn clean package -Pnative-image` -3. Execute the native executable created in `target` directory of your project - -== AOT Supported Modules - -Some Helidon components are not (yet) supported in native image, some have -restrictions. The following table lists all Helidon features and their support -for native image. - -.Helidon SE features in AOT -[cols="^1,^2s,<6,<6"] -|=== -| |Feature ^|Component ^|AOT note - -|✅ |Config |Config |{nbsp} -|✅ |{nbsp} |Encryption |{nbsp} -|✅ |{nbsp} |HOCON |{nbsp} -|✅ |{nbsp} |Object Mapping |{nbsp} -|✅ |{nbsp} |YAML |{nbsp} -|❓ |{nbsp} |etcd |Not yet tested. -|✅ |{nbsp} |git |{nbsp} -|✅ |Db Client |Db Client |{nbsp} -|✅ |{nbsp} |Health Check |{nbsp} -|🔶 |{nbsp} |JDBC |Tested with Helidon modules for Oracle and H2 driver (see examples) -|✅ |{nbsp} |Metrics |{nbsp} -|✅ |{nbsp} |Tracing |{nbsp} -|✅ |{nbsp} |mongo |{nbsp} -|✅ |Health |Health |{nbsp} -|✅ |{nbsp} |Built-ins |{nbsp} -|✅ |Messaging |Messaging |{nbsp} -|✅ |Metrics |Metrics |{nbsp} -|✅ |OpenAPI |OpenAPI |{nbsp} -|✅ |Security |Security |{nbsp} -|✅ |{nbsp} |Integration: Jersey |{nbsp} -|✅ |{nbsp} |Integration: WebServer |{nbsp} -|✅ |{nbsp} |Integration: gRPC |{nbsp} -|✅ |{nbsp} |OIDC |{nbsp} -|✅ |{nbsp} |Provider: ABAC |{nbsp} -|✅ |{nbsp} |Provider/ABAC/Policy: EL |Requires reflection configuration for used classes. -|✅ |{nbsp} |Provider/ABAC: Role |{nbsp} -|✅ |{nbsp} |Provider/ABAC: Scope |{nbsp} -|✅ |{nbsp} |Provider/ABAC: Time |{nbsp} -|❓ |{nbsp} |Provider: Google Login |Not yet tested. -|✅ |{nbsp} |Provider: Header |{nbsp} -|✅ |{nbsp} |Provider: HTTP Basic |{nbsp} -|✅ |{nbsp} |Provider: HTTP Digest |{nbsp} -|✅ |{nbsp} |Provider: HTTP Signatures |{nbsp} -|❓ |{nbsp} |Provider: IDCS Role Mapper |Not yet tested. -|✅ |{nbsp} |Provider: JWT |{nbsp} -|✅ |Tracing |Tracing |{nbsp} -|✅ |{nbsp} |Integration: Jersey Server |{nbsp} -|✅ |{nbsp} |Integration: Jersey Client |{nbsp} -|✅ |{nbsp} |Jaeger |{nbsp} -|✅ |{nbsp} |Zipkin |{nbsp} -|✅ |WebClient |WebClient |{nbsp} -|✅ |{nbsp} |Web Client |{nbsp} -|✅ |{nbsp} |Jackson |{nbsp} -|✅ |{nbsp} |JSON-B |{nbsp} -|✅ |{nbsp} |JSON-P |{nbsp} -|✅ |{nbsp} |Metrics |{nbsp} -|✅ |{nbsp} |Multi-part |{nbsp} -|✅ |{nbsp} |Security |{nbsp} -|✅ |{nbsp} |Tracing |{nbsp} -|✅ |WebServer |WebServer |{nbsp} -|✅ |{nbsp} |Access Log |{nbsp} -|✅ |{nbsp} |CORS |{nbsp} -|✅ |{nbsp} |Jackson |{nbsp} -|✅ |{nbsp} |Jersey |{nbsp} -|✅ |{nbsp} |JSON-B |{nbsp} -|✅ |{nbsp} |JSON-P |{nbsp} -|✅ |{nbsp} |Multi-part |{nbsp} -|❓ |{nbsp} |Prometheus |Not yet tested. -|✅ |{nbsp} |Websocket |Server only. -|✅ |gRPC Server |gRPC Server |{nbsp} -|✅ |{nbsp} |Metrics |{nbsp} -|✅ |gRPC Client |gRPC Client |{nbsp} -|✅ |{nbsp} |Metrics |{nbsp} -|✅ |Scheduling |Scheduling |{nbsp} -|✅ |OCI |OCI Integration |Modules with group id `io.helidon.integrations.oci` -|✅ |Vault |Hashicorp Vault Integration |{nbsp} -|=== - diff --git a/docs/se/introduction.adoc b/docs/se/introduction.adoc index f805fd67411..8940e310928 100644 --- a/docs/se/introduction.adoc +++ b/docs/se/introduction.adoc @@ -34,13 +34,6 @@ Helidon SE supports a number of additional Helidon features: [PILLARS] ==== -//aot -[CARD] -.Ahead-of-Time Compilation (AOT) -[icon=save,link=aot.adoc] --- -Use GraalVM native image to compile Helidon applications into a native executable. --- //config [CARD] .Config diff --git a/docs/sitegen.yaml b/docs/sitegen.yaml index 818784cbafa..a1401af2148 100644 --- a/docs/sitegen.yaml +++ b/docs/sitegen.yaml @@ -126,12 +126,6 @@ backend: glyph: type: "icon" value: "warning" - - type: "PAGE" - title: "GraalVM Native Image" - source: "aot.adoc" - glyph: - type: "icon" - value: "save" - type: "PAGE" title: "GraphQL Server" source: "graphql.adoc" @@ -355,12 +349,6 @@ backend: glyph: type: "icon" value: "warning" - - type: "PAGE" - title: "GraalVM Native Image" - source: "aot.adoc" - glyph: - type: "icon" - value: "save" - type: "PAGE" title: "GraphQL Server" source: "graphql.adoc"