Run polyglot apps with WebLogic 14.1.1 and GraalVM EEGepubliceerd: Auteur: Michel Schildmeijer Categorie: Oracle
Deze blog is alleen beschikbaar in het Engels.
This article is recovered from the deleted Oracle Community blog: in Architecture, Development, Operations and Cloud Solutions on 17-jul-2020 12:52:30
This made me curious, so I decided to research and develop a way to roll out a WebLogic platform running with GraalVM, on Oracle's managed Kubernetes Engine.
GraalVM is a solution in the form of a virtual machine for running polyglot applications. In other words, it can run Java and non-Java applications in a Graal Virtual Machine. GraalVM has the following characteristics:
- The same JVM commands, flags, and options
- High performance
- Fully Java compliant
- Run languages natively in JVM – so there is no Java implementation like this:
- Jython --> Python - Graalpython
- JRuby --> Ruby – Truffleruby
- Also works with low-level system languages such as C, C++, and Fortran
For the multiple language support, GraalVM has multiple layers consisting of compilers and frameworks to translate a certain language so it can be interpreted by the JVM. The following image is an example of how a low-level language is processed:
Implementation of GraalVM EE:
Requirements and necessary steps
To run it on Kubernetes, I had to prepare the following:
- Obtain the GraalVM EE software package
- Build a GraalVM EE Docker image and push it to my private container registry
- Build a WebLogic 14 image using the GraalVM EE image and push it to my private registry
- Create a WebLogic 14 domain on Kubernetes using the WebLogic Kubernetes Operator
GraalVM EE software
Now, GraalVM is partial OpenSource; this is the Community Edition (GraalVM CE). But if you want to use GraalVM with WebLogic, GraalVM EE is required. At the time of writing this blog, the current version is 19.3.2, and can be downloaded fromedelivery.oracle.com. Package is to be downloaded as V995577-01.tar,gz. But as you can see, the latest versions are already updated to 21.
Because there is no GraalVM EE container image publicly available, I built one myself, using docker build tools.
Build a layered container image structure
Flow of building and pushing images
As you can see in this illustration, several images need to be built before it can run it on Kubernetes.
Build the GraalVM image
The GraalVM image uses the Oracle Linux 8 Slim Distro, which caused some issues for me. Now, the aim is to keep your images as light weighted as possible. However, I needed to install a few extra packages:
- diff --> because the Introspection job of the WebLogic Kubernetes Operator uses this command to inspect the generated SerializedSystemIni.dat. If diff is not installed, the job fails.
Build, tag and push it:
Build the WebLogic 14 GraalVM image
Next, the WebLogic 14.1.1 image needs to be built with our previous GraalVM image. To make use of the GraalVM image, specify it is used as the builder.
FROM fra.ocir.io/frce4kd4ndqf/graalvm-ee:19.3.2 as builder
Dockerfile (part of it, not all)
The WebLogic image is now provided with GraalVM.
After you've done this, you can follow the steps as described in New Oracle WebLogic 14.1.1 on Oracle Kubernetes Engine, but beware to specify in your domain resource creation your own build and pushed WebLogic GraalVM image
After setting up, all WebLogic 14 GraalVM Pods are running in Kubernetes.
Testing WebLogic / GraalVM
I found some applications which ran on Payara and on GitHub, I saw this test application from https://github.com/ninckblokje/polyglot-jakarta-ee-weblogic, so I borrowed this, build it with Maven and deployed it. Thanks to Jeroen Ninck Blok (https://twitter.com/ninckblokje).
So this is a very simple example, but I will try to set up some more complicated testcases in the near future.
Considering the rapid changes in the IT-world, especially regarding how infrastructure and application landscapes are designed, developed, build and operated, a lot still needs to be clarified of what the future will look like. Will customers still use WebLogic in the future, or are small-sized application servers like Payara the future? Or will everything run in containers…? In my opinion, this is still a very interesting development to be researched.