Run polyglot apps with WebLogic 14.1.1 and GraalVM EE

Run polyglot apps with WebLogic 14.1.1 and GraalVM EE

Published on: Category: Oracle

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
About the author Michel Schildmeijer

Michel started his career as a medical officer in the Royal Dutch Airforce, with a focus on pharma. After the air force, he continued in pharma, followed by time working in clinical pharmacology. While there, he transitioned to IT by learning UNIX and MUMPS, and developed a system for managing patients’ medical records. As his career developed, his responsibility shifted from a deep technical perspective to a more visionary role. At the end of 2011, Michel authored a book on WebLogic Administration for beginners. He joined Qualogy in April 2012 where he expanded his repertoire significantly, serving a wide range of customers with his knowledge about Java Application Servers, Middleware and Application Integration. He also increased his multiple-industry knowledge in his role as Solutions or IT architect by working for customers in a range of sectors, including financials, telecom, public transportation and government organizations. In 2012, he received the IT Industry-recognized title of Oracle ACE for being an ambassador and community leader in his area of expertise. In 2019, this was enhanced to Oracle ACE Director. Michel is asked regularly to speak about technology and the impact of innovation at national and international conferences such as KubeCon, Oracle OpenWorld, Groundbreakers Developers Tours and others. He contributes actively to the OpenSource community and solutions regarding containerization, CI/CD and DevOps. In October 2021, Michel took an exciting step in his career by becoming Business Unit Manager for Qualogy Managed Services. While he still has a finger on the pulse in terms of technology, he is expanding his scope by combining his experience with the new insights gained in his new position. Read more via blog: https://bit.ly/3fAxrqf | Medium: https://mschildmeijer.medium.com/ | Books: Oracle Weblogic Server 11gR1 PS2: Administration Essentials: https://bit.ly/3IhALmf | Oracle WebLogic Server 12c: First Look1: https://bit.ly/31olbpj

More posts by Michel Schildmeijer
Comments
Reply