WildFly Glow: Next-Gen Evolution in Provisioning

In the ever-evolving landscape of application provisioning, WildFly project introduces a groundbreaking provisioning tooling: WildFly Glow. An advanced successor to WildFly Galleon, WildFly Glow automatically combines the Galleon Feature-packs and Layers that your application needs! Let’s dive into the features and capabilities of WildFly Glow.

Automatic Identification of WildFly Galleon Layers

WildFly Glow is your next-generation tool you can use to set up a WildFly distribution tailer for your needs. You can use it through the WildFly Glow command line tool or the WildFly Maven Plugin (starting with version 5.0.0 Beta).

Traditionally, tailoring a WildFly server to meet specific application requirements requires the manual identification of WildFly Galleon Layers. Check this article for more details: Provisioning WildFly with Galleon

However, WildFly Glow revolutionizes this process by automating the identification of Layers, from your application. When you build your artifacts, WildFly Glow scans them to figure out what features and configurations your distribution requires. It uses Galleon provisioning artifacts like Feature-packs and Layers to achieve this.

These layers have rules that define what should be inside your deployment for the layer to be necessary. The rules also indicate whether a layer has High Availability capabilities.

At the end of the scanning procedure WildFly Glow can either print a report of the scan or continue with provisioning WildFly in multiple ways, such as standard distribution, Bootable or Docker image.

Finally, WildFly Glow maintains a centralized repository of knowledge for each WildFly version, detailing the compatible Galleon Feature-packs. This information, readily available in a dedicated GitHub project, serves as a valuable resource for developers, ensuring seamless compatibility and optimal utilization of WildFly’s extensible features.

How to use WildFly Glow

In order to use WildFly Glow, start by downloading its CLI from the available releases: https://github.com/wildfly/wildfly-glow/releases

Unzip WildFly Glow in a folder of your like. As you can see, it includes a shell to run the CLI (wildfly-glow), a JAR file with the libraries (wildfly-glow.jar) and also a sample application (kitchensink.war) that you can use to experiment the tool:

.
├── examples
│   └── kitchensink.war
├── README.html
├── wildfly-glow
└── wildfly-glow.jar

You can launch WildFly Glow by executing its shell command (wildfly-glow) . Without any argument, it will list the available commands:

wildfly glow tutotial

Let’s check the available commands one-by-one.

Scanning your application

Firstly, we will learn how to scan your application to see the list of feature packs and Galleon layers your application needs. That will only generate a report. Nothing will be provisioned:

./wildfly-glow scan ./examples/kitchensink.war
Wildfly Glow is scanning...
context: bare-metal
enabled profile: none
galleon discovery
- feature-packs
   org.wildfly:wildfly-galleon-pack:31.0.0.Final
- layers
   ee-core-profile-server
   jpa
   ejb-lite
   jaxrs
   jsf
   h2-driver

The information from the scan command is useful if you want only to note (and build yourself) a WildFly distribution.

Provisioning a WildFly Server

Next, we will take one step further the scan command by adding the option --provision=SERVER . The provision command will download and install a WildFly distribution using the layers that your application requires. For example:

./wildfly-glow scan ./examples/kitchensink.war --provision=SERVER
Wildfly Glow is scanning...
context: bare-metal
enabled profile: none
galleon discovery
- feature-packs
   org.wildfly:wildfly-galleon-pack:31.0.0.Final
- layers
   ee-core-profile-server
   jpa
   ejb-lite
   jaxrs
   jsf
   h2-driver

The outcome of this operation will be a WildFly distribution with your application running on top of it:

wildfly glow tutorial

Provisioning a WildFly Bootable JAR

WildFly Glow also enables you to create a Bootable JAR application without choosing the list of layers/feature packs. To do that, you have only to use as provision’s argument BOOTABLE_JAR:

./wildfly-glow scan ./examples/kitchensink.war --provision=BOOTABLE_JAR

You can then run your Bootable JAR application as follows:

java -jar kitchensink-31.0.0.Final-bootable.jar

To learn more about WildFly Bootable JAR check this article: Turn your WildFly application in a Bootable JAR

Building a Docker Image of your application

Finally, you can also use WildFly Glow to produce a Dockerfile that you can use to start your application as a Container Image.

./wildfly-glow scan ./examples/kitchensink.war --provision=DOCKER_IMAGE --cloud

Besides, if your Docker daemon is up and running, WildFly Glow will also build your Docker Image

docker images
REPOSITORY                               TAG            IMAGE ID       CREATED         SIZE
wildfly-glow-image-server-31_0_0_final   latest         62c0906b234c   6 seconds ago   663MB

You can then run your application with Docker as follows:

docker run wildfly-glow-image-server-31_0_0_final:latest

Provision using WildFly Maven Plugin

Besides the Glow CLI, you can also trigger the provision of a WildFly Server from WildFly Maven plugin. You can do that since version 5.0.Beta2 of the plugin. The element which allows provisioning is <discover-provisioning-info> as you can see from the following example:

<plugin>
	<groupId>org.wildfly.plugins</groupId>
	<artifactId>wildfly-maven-plugin</artifactId>
	<configuration>
        <version>5.0.0.Beta2</version>
	    <discover-provisioning-info>
		<version>31.0.0.Final</version>
	    </discover-provisioning-info>
	    <name>ROOT.war</name>
<plugin>

The above example optionally includes the Server release to provision. if you don’t add the server version, WildFly will pick up the latest version. Then, in order to compile the application and provision WildFly, just execute:

mvn install wildfly:provision

Conclusion

WildFly Glow represents a paradigm shift in the provisioning landscape, offering an automated and intelligent approach to the identification of Galleon Layers and Feature-packs. By streamlining the provisioning process, Glow empowers developers to focus more on building robust applications and less on intricate server configurations.

Found the article helpful? if so please follow us on Socials