2020-07-16 22_32_52-Clipboard.png

 

 

As Oracle announced on Oracle OpenWorld 2019 ( why does that seem like ages ago?? ) WebLogic 14 version, and later that years this release, also was announced this version was certified to run with GraalVM. Now that makes WebLogic more than only the Java EE application server that it used to be, because now other application technologies such as JavaScript, Ruby or Python could theoretically run on WebLogic.

 

This made me curious and I decided to research and develop a way to rollout a WebLogic platform running with GraalVM, on Oracle's managed Kubernetes Engine.

 

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 regsitry
  • Create a WebLogic 14 domain on Kubernetes using the WebLogic Kubernetes Operator

 

 

 

 

GraalVM EE  software

 

Now GraalVM is partial OpenSource, thats the Communtiy Edition ( GraalVM CE), but for using it with WebLogic, the GraalVM EE is required. At time of writing this blog the version is 19.3.2, to be downloaded fro edelivery.oracle.com. Package is to be downloaded as  V995577-01.tar,gz.

Because there is no GraalVM EE container image public available, I built one myself, using docker build tools.

 

Build a layered container Image structure

 

Flow of building and pushing images

containerbuildflow.png

 

As to be seen in this flow, several images need to be build, for running 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 lightweighted 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, diff is used. If not there, the job fails.

 

Dockerfile Graalvm

FROM oraclelinux:8-slim

# Note: If you are behind a web proxy, set the build variables for the build:
#       E.g.:  docker build --build-arg "https_proxy=..." --build-arg "http_proxy=..." --build-arg "no_proxy=..." ...

ARG GRAALVM_VERSION=19.3.2
ARG JAVA_VERSION=java11
#ARG GRAALVM_PKG=https://github.com/mnemonic01/wlsk8s/graalvm-ee-$GRAALVM_VERSION.tar.gz
#ARG GRAALVM_PKG=https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-$GRAALVM_VERSION/graalvm-ce-$JAVA_VERSION-linux-amd64-$GRAALVM_VERSION.tar.gz
ENV GRAALVM_PKG=V995577-01.tar
ENV LANG=en_US.UTF-8 JAVA_HOME=/graalvm-ee-$JAVA_VERSION-$GRAALVM_VERSION/

RUN microdnf remove -y coreutils-single
RUN microdnf update -y oraclelinux-release-el8 \
    && microdnf --enablerepo ol8_codeready_builder install bzip2-devel coreutils diffutils ed gcc gcc-c++ gcc-gfortran gzip file fontconfig less libcurl-devel make openssl openssl-devel readline-devel shadow-utils tar zip\
    vi which xz-devel zlib-devel findutils glibc-static libstdc++ libstdc++-devel libstdc++-static zlib-static \
    && microdnf clean all


RUN fc-cache -f -v

ADD gu-wrapper.sh /usr/local/bin/gu
COPY V995577-01.tar /tmp
#RUN gunzip /opt/${GRAALVM_PKG} | tar x -C /opt/* \
RUN mv /tmp/V995577-01.tar /opt && tar -xvf /opt/V995577-01.tar \
    # Set alternative links
    && mkdir -p "/usr/java" \
    && ln -sfT "$JAVA_HOME" /usr/java/default \
    && ln -sfT "$JAVA_HOME" /usr/java/latest \
    && for bin in "$JAVA_HOME/bin/"*; do \
    base="$(basename "$bin")"; \
[ ! -e "/usr/bin/$base" ]; \
    alternatives --install "/usr/bin/$base" "$base" "$bin" 20000; \
    done \
    && chmod +x /usr/local/bin/gu

CMD java -version
--------------->

 

Build:

Tag and push it:

 

Build the WebLogic 14 GraalVM Image

Next, the WebLogic 14.1.1 image needs to be build with our previous GraalVM image. To make use of the GraalVM image, specify it is used as builder

FROM fra.ocir.io/frce4kd4ndqf/graalvm-ee:19.3.2 as builder

 

Dockerfile(part of it, not all)

 

#FROM oracle/jdk:11 as builder
FROM fra.ocir.io/frce4kd4ndqf/graalvm-ee:19.3.2 as builder

# Labels
# ------
LABEL "provider"="Oracle"                                               \
      "maintainer"="Monica Riccelli <monica.riccelli@oracle.com>"       \
      "issues"="https://github.com/oracle/docker-images/issues"         \
      "port.admin.listen"="7001"                                        \
      "port.administration"="9002"


# Common environment variables required for this build (do NOT change)
# --------------------------------------------------------------------
ENV ORACLE_HOME=/u01/oracle \
    USER_MEM_ARGS="-Djava.security.egd=file:/dev/./urandom" \
    PATH=$PATH:${JAVA_HOME}/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin

# Setup filesystem and oracle user
# Adjust file permissions, go to /u01 as user 'oracle' to proceed with WLS installation
# ------------------------------------------------------------
RUN mkdir -p /u01 && \
    chmod a+xr /u01 && \
    adduser -b /u01 -d /u01/oracle -m -s /bin/bash oracle

# Environment variables required for this build (do NOT change)
# -------------------------------------------------------------
ENV FMW_PKG=fmw_14.1.1.0.0_wls_Disk1_1of1.zip \
    FMW_JAR=fmw_14.1.1.0.0_wls.jar

# Copy packages
# -------------
COPY $FMW_PKG install.file oraInst.loc /u01/
RUN chown oracle:oracle -R /u01

# Install
# ------------------------------------------------------------
USER oracle

RUN cd /u01 && ${JAVA_HOME}/bin/jar xf /u01/$FMW_PKG && cd - && \
    ${JAVA_HOME}/bin/java -jar /u01/$FMW_JAR -silent -responseFile /u01/install.file -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME INSTALL_TYPE="WebLogic Server" && \
    rm /u01/$FMW_JAR /u01/$FMW_PKG /u01/install.file && \
    rm -rf /u01/oracle/cfgtoollogs

 

Image WebLogic now 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 is runnig fine in Kubernetes

 

 

Testing WebLogic / GraalVM

I did not have any representative application available. Of course, some Java appplication wil run on 14, but it is also nice to see a Javascript application will run, or a Python application.

 

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 is with maven and deployed it. Thanks to Jeroen Ninck Blok https://twitter.com/ninckblokje

 

 

 

So this is a very simple example but  in the coming time I will try to set up some more complicated testcases.

 

Conlusion

In all the rapid changes in the world of IT regarding how infrastucture and application landscapes are designed, developed, build and operated, a lot need to be clear of what the future will be. Will customers still use WebLogic in the future, or are small size like Payara the future, or will everything run in containers....? Still a very interesting develoment to be researched.