EAP 7/8 CONFIG_IS_FINAL on Galleon Build for image building

Solution Verified - Updated

Environment

  • Red Hat Enterprise Application Platform
    • 8.x
    • 7.x
  • Red hat OpenShift Container Platform (OCP)
    • 4.x

Issue

  • How does EAP 7/8's CONFIG_IS_FINAL on Galleon Build work?
  • I cannot find the ping protocol in the EAP 8 configuration

Resolution

Setting CONFIG_IS_FINAL to true, makes CONFIG_ADJUSTMENT_MODE go to none, meaning to change will be done at runtime on the configuration such as for messaging or clustering changes by not triggering the start-up scripts for changes, as detailed on EAP 7 image clustering in OCP 4.
The start-up scripts for changes will inject ping protocol in the jgroups stack for example so for both EAP 7 and EAP 8 the image will come without the ping protocol injected if the image is provisioned by Galleon.

EAP versionExample layer with clusteringdefault runtime image configuration
EAP 8cloud-default-configN/A - Default EAP 8 runtime image is empty
EAP 7web-clusteringDefault EAP 7 runtime image as KUBE_PING

Full example:

$ podman run --entrypoint=/bin/bash --rm -it  localhost/eap7:final
## same as $ podman run --entrypoint=/bin/bash --rm -it  localhost/eap8:final
[jboss@9d878063627d ~]$ cat /opt/eap/standalone/configuration/standalone-openshift.xml  | grep jgroups -A10
        <extension module="org.jboss.as.clustering.jgroups"/>
        <extension module="org.jboss.as.connector"/>
        <extension module="org.jboss.as.deployment-scanner"/>
        <extension module="org.jboss.as.ee"/>
        <extension module="org.jboss.as.jmx"/>
        <extension module="org.jboss.as.logging"/>
        <extension module="org.jboss.as.naming"/>
        <extension module="org.jboss.as.transactions"/>
        <extension module="org.wildfly.extension.clustering.web"/>
        <extension module="org.wildfly.extension.core-management"/>
        <extension module="org.wildfly.extension.elytron"/>
--
        <subsystem xmlns="urn:jboss:domain:jgroups:8.0">
            <channels default="ee">
                <channel name="ee" stack="tcp"/>
            </channels>
            <stacks>
                <stack name="tcp">
                    <transport type="TCP" socket-binding="jgroups-tcp"/>
                    <protocol type="MERGE3"/>
                    <protocol type="FD_SOCK"/>
                    <protocol type="FD_ALL"/>
                    <protocol type="VERIFY_SUSPECT"/>
                    <protocol type="pbcast.NAKACK2"/>
                    <protocol type="UNICAST3"/>
                    <protocol type="pbcast.STABLE"/>
                    <protocol type="pbcast.GMS"/>
                    <protocol type="UFC"/>
                    <protocol type="MFC"/>
--
                    <transport type="UDP" socket-binding="jgroups-udp"/>
                    <protocol type="MERGE3"/>
                    <protocol type="FD_SOCK"/>
                    <protocol type="FD_ALL"/>
                    <protocol type="VERIFY_SUSPECT"/>
                    <protocol type="pbcast.NAKACK2"/>
                    <protocol type="UNICAST3"/>
                    <protocol type="pbcast.STABLE"/>
                    <protocol type="pbcast.GMS"/>
                    <protocol type="UFC"/>
                    <protocol type="MFC"/>

Root Cause

$ cat opt/server/bin/launch/openshift-common.sh | grep -i "CONFIG_IS_FINAL"
# CONFIG_ADJUSTMENT_MODE is the mode used to do the environment variable replacement.
# The values are:
# -none     - no adjustment should be done. This cam be forced if $CONFIG_IS_FINAL = true
#               is passed in when starting the container
# -xml      - adjustment will happen via the legacy xml marker replacement
# -cli      - adjustment will happen via cli commands
# -xml_cli  - adjustment will happen via xml marker replacement if the marker is found. If not,
#               it will happen via cli commands. This is the default if not set by a consumer.
#
# Handling of the meanings of this is done by the launch scripts doing the config adjustment.
# Consumers of this script are expected to set this value.
if [ -z "${CONFIG_ADJUSTMENT_MODE}" ]; then
  export CONFIG_ADJUSTMENT_MODE="xml_cli"
fi
if [ -n "${CONFIG_IS_FINAL}" ] && [ "${CONFIG_IS_FINAL^^}" = "TRUE" ]; then
    export CONFIG_ADJUSTMENT_MODE="none"
fi
...
...
if [ -z "${CONFIG_ADJUSTMENT_MODE}" ]; then
  export CONFIG_ADJUSTMENT_MODE="xml_cli"
fi
if [ -n "${CONFIG_IS_FINAL}" ] && [ "${CONFIG_IS_FINAL^^}" = "TRUE" ]; then
    export CONFIG_ADJUSTMENT_MODE="none"
fi
Components
Tags

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.