Run polyglot apps with WebLogic 14.1.1 and GraalVM EE

Run polyglot apps with WebLogic 14.1.1 and GraalVM EE

Gepubliceerd: 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

During Oracle OpenWorld 2019 (why does that seem like ages ago?), Oracle announced the WebLogic 14 version. Later that year, they announced that this version was also certified to run with GraalVM. This makes WebLogic more than the Java EE application server it used to be, because other application technologies such as JavaScript, Ruby or Python can now (theoretically) run on WebLogic. 

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 Basics

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:

  • Works with JavaScript, Python, Ruby, R, Java, Scala...
  • 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
Image: GraalVM Technology layers

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:

- coreutils

- zip

- 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.

Dockerfile GraalVM

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 did not have any representative applications available. Of course, some Java applications will run on 14, but it’s also nice that JavaScript or Python applications run as well.

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.

Conclusion

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.

Michel Schildmeijer
Over auteur Michel Schildmeijer

Having started in the pharmacy sector, Michel transitioned to IT in 1996, where he worked on a UNIX TTY terminal-based system and the MUMPS language. He currently works as a solutions architect at Qualogy, with a focus on middleware, application integration and service-oriented architecture. His passion for middleware started in 2000, when he worked as a support analyst in the financial sector with BEA WebLogic and Tuxedo. Michel is an expert on the WebLogic platform. He serves customers in his role as architect and advises them in all aspects of their IT landscape. He became an Oracle ACE in 2012 and wrote two books about WebLogic: Oracle WebLogic Server 11gR1 PS2: Administration Essentials and Oracle WebLogic Server 12c: First Look. He is a well-known speaker at national and international conferences and is recognized as an official Oracle Speaker. Since a few years, he is also an active contributor to the OpenSource community and solutions regarding containerization and DevOps. Furthermore, he is a well-known expert in several communities. He speaks regularly at events in the EMEA region and worldwide, such as KubeCon, Continuous Delivery Summit, Oracle OpenWorld, Groundbreakers Developers Tours and several other tech conferences. Read more at: http://www.qualogy.nl/techblog/author/michel-schildmeijer and https://community.oracle.com/blogs/mnemonic

Meer posts van Michel Schildmeijer
Reacties
Reactie plaatsen