Helidon MP project for HOL.
With JDK11+
mvn package
java -jar target/helidon-quickstart-mp.jar
curl -X GET http://localhost:8081/vaccinated/Dino
true
curl -X GET http://localhost:8081/vaccinated/GoodBoy
false
curl -s http://localhost:8081/health
{"outcome":"UP",...
. . .
# Prometheus Format
curl -s http://localhost:8081/metrics
# TYPE base:gc_g1_young_generation_count gauge
. . .
# JSON Format
curl -H 'Accept: application/json' http://localhost:8081/metrics
{"base":...
. . .
docker build -t helidon-quickstart-mp .
docker run --rm -p 8080:8080 helidon-quickstart-mp:latest
Exercise the application as described above
kubectl cluster-info # Verify which cluster
kubectl get pods # Verify connectivity to cluster
kubectl create -f app.yaml # Deploy application
kubectl get service helidon-quickstart-mp # Verify deployed service
GraalVM allows you to compile your programs ahead-of-time into a native executable. See https://www.graalvm.org/docs/reference-manual/aot-compilation/ for more information.
You can build a native executable in 2 different ways:
- With a local installation of GraalVM
- Using Docker
Download Graal VM at https://www.graalvm.org/downloads, the version
currently supported for Helidon is 20.1.0
.
# Setup the environment
export GRAALVM_HOME=/path
# build the native executable
mvn package -Pnative-image
You can also put the Graal VM bin
directory in your PATH, or pass
-DgraalVMHome=/path
to the Maven command.
See https://github.com/oracle/helidon-build-tools/tree/master/helidon-maven-plugin#goal-native-image for more information.
Start the application:
./target/helidon-quickstart-mp
Build the "native" Docker Image
docker build -t helidon-quickstart-mp-native -f Dockerfile.native .
Start the application:
docker run --rm -p 8080:8080 helidon-quickstart-mp-native:latest
You can build a custom Java Runtime Image (JRI) containing the application jars and the JDK modules on which they depend. This image also:
- Enables Class Data Sharing by default to reduce startup time.
- Contains a customized
start
script to simplify CDS usage and support debug and test modes.
You can build a custom JRI in two different ways:
- Local
- Using Docker
# build the JRI
mvn package -Pjlink-image
See https://github.com/oracle/helidon-build-tools/tree/master/helidon-maven-plugin#goal-jlink-image for more information.
Start the application:
./target/helidon-quickstart-mp/bin/start
Build the "jlink" Docker Image
docker build -t helidon-quickstart-mp-jlink -f Dockerfile.jlink .
Start the application:
docker run --rm -p 8080:8080 helidon-quickstart-mp-jlink:latest
See the start script help:
docker run --rm helidon-quickstart-mp-jlink:latest --help