Visit Azul.com Support

Registering a New Compiler Engine in Cloud Native Compiler

Since different versions of Azul Zulu Prime JVMs may require different compiled code, a Cloud Native Compiler must be able to produce different versions of compiled code simultaneously. You do not need to create a separate Cloud Native Compiler instance for each application or different Java version.

Cloud Native Compiler (CNC) does not have its own compiler - it is just server-side infrastructure for running the JIT compiler that ships inside of Azul Zulu Prime Builds of OpenJDK. This compiler is uploaded to the CNC service from the JVM in the form of a Compiler Engine.

Each version of Azul Zulu Prime JVM contains a signed Compiler Engine distributable. Cloud Native Compiler comes with the Compiler Engine for Azul Zulu Prime JDK 21.09.1.0 pre-installed. You can manually upload other Compiler Engines to your Cloud Native Compiler or let the JVM auto-upload any missing compiler engines on startup. Compiler Engines are signed to prevent malicious versions of Compiler Engines from being installed.

If an Azul Zulu Prime JVM connects to a Cloud Native Compiler that does not have the corresponding Compiler Engine installed, the JVM will automatically switch to performing optimizations on the client VM.

Note
A Cloud Native Compiler service does not keep any persistent record of compiler engines. If you restart a Cloud Native Compiler service, it only contains the Azul Zulu Prime JDK 21.09.1.0 compiler engine. If a JVM requests compilations from a Cloud Native Compiler service that does not have the corresponding compiler engine, the JVM switches to local JIT compilation and starts auto-uploading the compiler engine for future use.

Auto-Uploading Compiler Engines

For JVMs connecting to a CNC service in the same Kubernetes cluster, or connecting to a CNC service that is fronted by an external load-balancer, auto-uploading works with no additional configuration.

For JVMs connecting to a CNC service in an external Kubernetes cluster with no external load-balancer, pass the IP address and port of the Cloud Native Compiler service’s gateway service in the --XX:CNCEngineUploadAddress flag. See Connecting a JVM to a Cloud Native Compiler for how to get the IP address of the gateway service. Make sure you use the port that is mapped to 8080 in the gateway service.

Manuall Registering a New Compiler Engine

If you need to manually upload a new Compiler Engine to a Cloud Native Compiler service, you can do with the etc/connected-compiler/bin/upload-compiler-engine script in your Azul Platform Prime installation directory.

Note
You must run the upload-compiler-engine script on a Linux system.

For example, if your JVM node is running in the same cluster as the Cloud Native Compiler service:

 
./etc/connected-compiler/bin/upload-compiler-engine http://10.10.100.100:8080

If your JVM is outside of the CNC cluster and you cluster is fronted by an external load-balancer, use the IP address of the CNC cluster and port 8080.

If your JVM is outside fo the CNC cluster and the CNC cluster is not fronted by a load-balancer, look for the gateway service and use the service’s IP address and the port mapped to 8080.

 
service/gateway NodePort 10.233.15.55 <none> 8080:31951/TCP,50051:30926/TCP 52d

In this example the correct connection url is http://:10.233.15.55:8080.

Inspecting the Installed Compiler Engines

Each Compiler Engine has a Compiler Engine ID. You can view all of the Compiler Engines that are installed on a Cloud Native Compiler by calling the /compiler-engines REST API on the gateway service’s 8080 port when calling from inside the cluster or the external port that is mapped to 8080 when calling from outside the cluster.