Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bonita, add 2024.3 #17714

Merged
merged 3 commits into from
Oct 16, 2024
Merged

Conversation

rbioteau
Copy link
Contributor

@rbioteau rbioteau requested a review from a team as a code owner October 11, 2024 12:31

This comment has been minimized.

@tianon
Copy link
Member

tianon commented Oct 11, 2024

#16546 (comment) 😅

@rbioteau
Copy link
Contributor Author

#16546 (comment) 😅

To give some additional context, business decided to not published community edition for past releases.
This decision has now been reverted and we are back with our latest release.
Is the version skip an issue ?

Regards

Properly resolve host ip

This comment has been minimized.

Copy link

Diff for 158e6be:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 1715d18..59352d0 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -1,16 +1,22 @@
 Maintainers: Emmanuel Duchastenier <emmanuel.duchastenier@bonitasoft.org> (@educhastenier), Pascal Garcia <pascal.garcia@bonitasoft.org> (@passga), Anthony Birembaut <anthony.birembaut@bonitasoft.org> (@abirembaut), Romain Bioteau <romain.bioteau@bonitasoft.org> (@rbioteau)
-Architectures: amd64, arm64v8, ppc64le
 GitRepo: https://github.com/bonitasoft/bonita-distrib.git
 Directory: docker
 
 Tags: 2022.2-u0, 2022.2, 7.15.0, 7.15
+Architectures: amd64, arm64v8, ppc64le
 GitFetch: refs/heads/docker/2022.2
 GitCommit: 0fbc47d8fcb6629b943b4c1e00052ca14c3d1e1b
 
 Tags: 2023.1-u0, 2023.1, 8.0.0, 8.0
+Architectures: amd64, arm64v8, ppc64le
 GitFetch: refs/heads/docker/2023.1
 GitCommit: 31dcebbf22ebcce11f8e3a9b9444802136c36c03
 
-Tags: 2023.2-u0, 2023.2, 9.0.0, 9.0, latest
+Tags: 2023.2-u0, 2023.2, 9.0.0, 9.0
+Architectures: amd64, arm64v8, ppc64le
 GitFetch: refs/heads/docker/2023.2
 GitCommit: 397824cf4f302c37f3534908728a2b8321a31565
+
+Tags: 2024.3-u0, 2024.3, 10.2.0, 10.2, latest
+GitFetch: refs/heads/docker/2024.3
+GitCommit: 634a6e462dbcc7da8ec7ed47adf419b9a24bf744
diff --git a/_bashbrew-list b/_bashbrew-list
index 825caa1..dca6eff 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -4,10 +4,14 @@ bonita:8.0
 bonita:8.0.0
 bonita:9.0
 bonita:9.0.0
+bonita:10.2
+bonita:10.2.0
 bonita:2022.2
 bonita:2022.2-u0
 bonita:2023.1
 bonita:2023.1-u0
 bonita:2023.2
 bonita:2023.2-u0
+bonita:2024.3
+bonita:2024.3-u0
 bonita:latest
diff --git a/_bashbrew-list-build-order b/_bashbrew-list-build-order
index 9033db1..944890b 100644
--- a/_bashbrew-list-build-order
+++ b/_bashbrew-list-build-order
@@ -1,3 +1,4 @@
 bonita:7.15
 bonita:8.0
+bonita:9.0
 bonita:latest
diff --git a/bonita_latest/Dockerfile b/bonita_9.0/Dockerfile
similarity index 100%
copy from bonita_latest/Dockerfile
copy to bonita_9.0/Dockerfile
diff --git a/bonita_latest/files/config.sh b/bonita_9.0/files/config.sh
similarity index 100%
copy from bonita_latest/files/config.sh
copy to bonita_9.0/files/config.sh
diff --git a/bonita_latest/files/log4j2/log4j2-appenders.xml b/bonita_9.0/files/log4j2/log4j2-appenders.xml
similarity index 100%
copy from bonita_latest/files/log4j2/log4j2-appenders.xml
copy to bonita_9.0/files/log4j2/log4j2-appenders.xml
diff --git a/bonita_8.0/files/startup.sh b/bonita_9.0/files/startup.sh
similarity index 100%
copy from bonita_8.0/files/startup.sh
copy to bonita_9.0/files/startup.sh
diff --git a/bonita_7.15/templates/database.properties b/bonita_9.0/templates/database.properties
similarity index 100%
copy from bonita_7.15/templates/database.properties
copy to bonita_9.0/templates/database.properties
diff --git a/bonita_7.15/templates/jmxremote.access b/bonita_9.0/templates/jmxremote.access
similarity index 100%
copy from bonita_7.15/templates/jmxremote.access
copy to bonita_9.0/templates/jmxremote.access
diff --git a/bonita_7.15/templates/jmxremote.password b/bonita_9.0/templates/jmxremote.password
similarity index 100%
copy from bonita_7.15/templates/jmxremote.password
copy to bonita_9.0/templates/jmxremote.password
diff --git a/bonita_7.15/templates/server.xml b/bonita_9.0/templates/server.xml
similarity index 100%
copy from bonita_7.15/templates/server.xml
copy to bonita_9.0/templates/server.xml
diff --git a/bonita_latest/templates/setenv.sh b/bonita_9.0/templates/setenv.sh
similarity index 100%
copy from bonita_latest/templates/setenv.sh
copy to bonita_9.0/templates/setenv.sh
diff --git a/bonita_7.15/templates/tomcat-users.xml b/bonita_9.0/templates/tomcat-users.xml
similarity index 100%
copy from bonita_7.15/templates/tomcat-users.xml
copy to bonita_9.0/templates/tomcat-users.xml
diff --git a/bonita_latest/Dockerfile b/bonita_latest/Dockerfile
index 4ca6901..dc75d5e 100644
--- a/bonita_latest/Dockerfile
+++ b/bonita_latest/Dockerfile
@@ -1,11 +1,11 @@
-FROM alpine:3.20
+FROM eclipse-temurin:17-jre-alpine
 
 LABEL maintainer="Bonitasoft Runtime team <rd.engine@bonitasoft.com>"
 
 # Execute instructions less likely to change first
 
 # Install packages
-RUN apk add --no-cache tzdata curl unzip bash su-exec jattach openjdk11-jre gnupg
+RUN apk add --no-cache tzdata curl unzip bash su-exec jattach
 
 RUN mkdir /opt/custom-init.d/
 
@@ -23,12 +23,12 @@ ARG BONITA_SHA256
 ARG BASE_URL
 ARG BONITA_URL
 
-ENV BONITA_VERSION=${BONITA_VERSION:-9.0.0}
-ENV BRANDING_VERSION=${BRANDING_VERSION:-2023.2-u0}
-ENV BONITA_SHA256=${BONITA_SHA256:-c37be3ca64a07810609c97f75c47acb7fea2d29bafff181b447987514b53d140}
+ENV BONITA_VERSION=${BONITA_VERSION:-10.2.0}
+ENV BRANDING_VERSION=${BRANDING_VERSION:-2024.3-u0}
+ENV BONITA_SHA256=${BONITA_SHA256:-75ad51a50cba484d3f74637584bf5144bf0cf28c06ae7a5efe1a804cdc996d86}
 ENV ZIP_FILE=BonitaCommunity-${BRANDING_VERSION}.zip
-ENV BASE_URL=${BASE_URL:-https://github.com/bonitasoft/bonita-platform-releases/releases/download}
-ENV BONITA_URL=${BONITA_URL:-${BASE_URL}/${BRANDING_VERSION}/BonitaCommunity-${BRANDING_VERSION}.zip}
+ENV BASE_URL=${BASE_URL:-https://search.maven.org/remotecontent?filepath=org/bonitasoft/distrib/bundle-tomcat}
+ENV BONITA_URL=${BONITA_URL:-${BASE_URL}/${BONITA_VERSION}/bundle-tomcat-${BONITA_VERSION}.zip}
 
 ## Must copy files first because the bundle is either taken from url or from local /opt/files if present
 RUN mkdir /opt/files
@@ -80,11 +80,11 @@ ENV ACCESSLOGS_MAX_DAYS=30
 ENV HTTP_MAX_THREADS=20
 
 COPY templates /opt/templates
-VOLUME ["/opt/bonita/conf/logs"]
+
 # exposed ports (Tomcat, JMX)
 EXPOSE 8080 9000
 
 # command to run when the container starts
-ENTRYPOINT ["/opt/files/startup.sh"]
+ENTRYPOINT ["/__cacert_entrypoint.sh", "/opt/files/startup.sh"]
 CMD ["/opt/bonita/server/bin/catalina.sh","run"]
 
diff --git a/bonita_latest/files/config.sh b/bonita_latest/files/config.sh
index 1073806..dde08c9 100755
--- a/bonita_latest/files/config.sh
+++ b/bonita_latest/files/config.sh
@@ -22,11 +22,6 @@ then
 	DB_VENDOR='postgres'
 	DB_HOST=$POSTGRES_PORT_5432_TCP_ADDR
 	DB_PORT=$POSTGRES_PORT_5432_TCP_PORT
-elif [ -n "$MYSQL_PORT_3306_TCP_PORT" ]
-then
-	DB_VENDOR='mysql'
-	DB_HOST=$MYSQL_PORT_3306_TCP_ADDR
-	DB_PORT=$MYSQL_PORT_3306_TCP_PORT
 else
 	DB_VENDOR=${DB_VENDOR:-h2}
 fi
@@ -39,9 +34,6 @@ case $DB_VENDOR in
 	"postgres")
 		DB_PORT=${DB_PORT:-5432}
 		;;
-	"mysql")
-		DB_PORT=${DB_PORT:-3306}
-		;;
 	*)
 		;;
 esac
@@ -101,6 +93,10 @@ cp ${BONITA_TPL}/setenv.sh ${BONITA_PATH}/setup/tomcat-templates/setenv.sh
 cp ${BONITA_TPL}/database.properties ${BONITA_PATH}/setup/database.properties
 cp ${BONITA_TPL}/server.xml ${BONITA_PATH}/server/conf/server.xml
 
+echo "Remote JMX Access is : ${JMX_REMOTE_ACCESS}"
+echo "Remote IP valve : ${REMOTE_IP_VALVE_ENABLED}"
+echo "Tomcat Max thread value : ${HTTP_MAX_THREADS}"
+
 # replace variables
 find ${BONITA_PATH}/setup/platform_conf/initial -name "*.properties" | xargs -n10 sed -i \
     -e 's/^#bonita.runtime.admin.username\s*=.*/'"bonita.runtime.admin.username=${TECH_USER_USERNAME}"'/' \
diff --git a/bonita_latest/files/startup.sh b/bonita_latest/files/startup.sh
index 3b45084..d93a59e 100755
--- a/bonita_latest/files/startup.sh
+++ b/bonita_latest/files/startup.sh
@@ -1,5 +1,8 @@
-#!/bin/bash
+#!/usr/bin/env bash
+# Shebang needs to be `bash`, see https://github.com/adoptium/containers/issues/415 for details
+
 set -eo pipefail
+
 # only execute bonita specific customization when the executable is tomcat
 # it allows to not run this script when CMD is overridden
 if [[ "$1" == "/opt/bonita/server/bin/catalina.sh" ]]
diff --git a/bonita_latest/templates/database.properties b/bonita_latest/templates/database.properties
index 518f69a..bcb498f 100644
--- a/bonita_latest/templates/database.properties
+++ b/bonita_latest/templates/database.properties
@@ -10,7 +10,7 @@
 # Bonita database properties
 #########################################
 
-# valid values are (h2, postgres, sqlserver, oracle, mysql)
+# Valid values are: h2, postgres in Community edition, and also sqlserver, oracle, mysql in Subscription editions
 db.vendor={{DB_VENDOR}}
 # when using h2, no server or port setting is needed since connexion is made using file protocol mode using relative directory:
 db.server.name={{DB_HOST}}
@@ -24,7 +24,7 @@ db.password={{DB_PASS}}
 ###################################
 # Business Data database properties
 ###################################
-# valid values are (h2, postgres, sqlserver, oracle, mysql)
+# Valid values are: h2, postgres in Community edition, and also sqlserver, oracle, mysql in Subscription editions
 bdm.db.vendor={{DB_VENDOR}}
 bdm.db.server.name={{DB_HOST}}
 bdm.db.server.port={{DB_PORT}}
diff --git a/bonita_latest/templates/setenv.sh b/bonita_latest/templates/setenv.sh
index 505e4ca..032e8ad 100755
--- a/bonita_latest/templates/setenv.sh
+++ b/bonita_latest/templates/setenv.sh
@@ -9,6 +9,18 @@ JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/sun.nio.ch=ALL-UNNAMED
 JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.management/sun.management=ALL-UNNAMED"
 JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED"
 
+# Add the JAVA 9 specific start-up parameters required by Xstream serialization
+JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.time=ALL-UNNAMED"
+JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.time.chrono=ALL-UNNAMED"
+JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.base/java.text=ALL-UNNAMED"
+
+# Add the JAVA 9 specific start-up parameters required by Webservice connector/Xstream serialization
+JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED"
+JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.xml/com.sun.org.apache.xerces.internal.xni=ALL-UNNAMED"
+
+# Add the JAVA 9 specific start-up parameters required by Salesforce connector/Xstream serialization
+JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED"
+
 # Set some JVM system properties required by Bonita
 
 LOGGING_MANAGER="-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager"
@@ -19,10 +31,10 @@ H2_DATABASE_DIR="-Dorg.bonitasoft.h2.database.dir=${CATALINA_HOME}/../h2_databas
 INCIDENT_LOG_OPTS="-Dorg.bonitasoft.engine.incident.folder=${INCIDENT_LOG_DIR_PATH:-$CATALINA_HOME/logs}"
 HEAPDUMP_OPTS="-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${HEAPDUMP_PATH:-$CATALINA_HOME/logs}"
 
-# Define the RDMBS vendor use by Bonita Engine to store data. Valid values are: h2, postgres, sqlserver, oracle, mysql.
+# Define the RDMBS vendor use by Bonita Engine to store data. Valid values are: h2, postgres
 DB_OPTS="-Dsysprop.bonita.db.vendor=h2"
 
-# Define the RDMBS vendor use by Bonita Engine to store Business Data. Valid values are: h2, postgres, sqlserver, oracle, mysql.
+# Define the RDMBS vendor use by Bonita Engine to store Business Data. Valid values are: h2, postgres
 # If you use different DB engines by tenants, please update directly bonita-tenant-community-custom.properties
 BDM_DB_OPTS="-Dsysprop.bonita.bdm.db.vendor=h2"
 
@@ -36,8 +48,18 @@ TRANSACTION_XATIMEOUT_OPTS="-Dbonita.runtime.transaction.xa-timeout={{TRANSACTIO
 
 # Optional JMX remote access Configuration. Used to enable remote JMX agent in tomcat to monitor Heap Memory, Threads, CPU Usage, Classes, and configure various MBeans.
 if [ "$JMX_REMOTE_ACCESS" = 'true' ]; then
-        host=$(echo $(hostname -i) | xargs)
-        JMX_REMOTE_ACCESS_OPTS="-Dcom.sun.management.jmxremote -Djava.rmi.server.hostname=${host} -Dcom.sun.management.jmxremote.port=9000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=${CATALINA_HOME}/conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=${CATALINA_HOME}/conf/jmxremote.access"
+  host=$(ip address | awk '
+         		$1 != "inet" { next } # only lines with ip addresses
+         		$NF == "lo" { next } # skip loopback devices
+         		$2 ~ /^127[.]/ { next } # skip loopback addresses
+         		$2 ~ /^169[.]254[.]/ { next } # skip link-local addresses
+         		{
+         			gsub(/\/.+$/, "", $2)
+         			print $2
+         			exit
+         		}
+         	')
+  JMX_REMOTE_ACCESS_OPTS="-Djava.rmi.server.hostname=${host} -Dcom.sun.management.jmxremote.port=9000 -Dcom.sun.management.jmxremote.rmi.port=9000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.password.file=${CATALINA_HOME}/conf/jmxremote.password -Dcom.sun.management.jmxremote.access.file=${CATALINA_HOME}/conf/jmxremote.access"
 fi
 
 # Pass the JVM system properties to Tomcat JVM using CATALINA_OPTS variable

Relevant Maintainers:

@tianon tianon merged commit f622084 into docker-library:master Oct 16, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants