sergehuber commented on code in PR #715:
URL: https://github.com/apache/unomi/pull/715#discussion_r2428262543
##########
docker/src/main/docker/entrypoint.sh:
##########
@@ -16,28 +16,110 @@
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
-# Wait for healthy ElasticSearch
-# next wait for ES status to turn to Green
-if [ "$UNOMI_ELASTICSEARCH_SSL_ENABLE" == 'true' ]; then
- schema='https'
+# Near the top of the file, add these default debug settings
+KARAF_DEBUG=${KARAF_DEBUG:-false}
+KARAF_DEBUG_PORT=${KARAF_DEBUG_PORT:-5005}
+KARAF_DEBUG_SUSPEND=${KARAF_DEBUG_SUSPEND:-n}
+
+# Before starting Karaf, add debug configuration
+if [ "$KARAF_DEBUG" = "true" ]; then
+ echo "Enabling Karaf debug mode on port $KARAF_DEBUG_PORT
(suspend=$KARAF_DEBUG_SUSPEND)"
+ export
JAVA_DEBUG_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=$KARAF_DEBUG_SUSPEND,address=*:$KARAF_DEBUG_PORT"
+ export KARAF_DEBUG=true
+fi
+
+# Determine search engine type from UNOMI_AUTO_START
+SEARCH_ENGINE="${UNOMI_AUTO_START:-elasticsearch}"
+export KARAF_OPTS="-Dunomi.autoStart=${UNOMI_AUTO_START}"
+
+if [ "$SEARCH_ENGINE" = "true" ]; then
+ SEARCH_ENGINE="elasticsearch"
+fi
+echo "SEARCH_ENGINE: $SEARCH_ENGINE"
+echo "KARAF_OPTS: $KARAF_OPTS"
+
+# Function to check cluster health for a specific node
+check_node_health() {
+ local node_url="$1"
+ local curl_opts="$2"
+ response=$(eval curl -v -fsSL ${curl_opts} "${node_url}" 2>&1)
+ if [ $? -eq 0 ]; then
+ echo "$response" | grep -o '"status"[ ]*:[ ]*"[^"]*"' | cut -d'"' -f4
+ else
+ echo ""
+ fi
+}
+
+# Configure connection parameters based on search engine type
+if [ "$SEARCH_ENGINE" = "opensearch" ]; then
+ # OpenSearch configuration
+ if [ -z "$UNOMI_OPENSEARCH_PASSWORD" ]; then
+ echo "Error: UNOMI_OPENSEARCH_PASSWORD must be set when using
OpenSearch"
+ exit 1
+ fi
+
+ schema='https'
+ auth_header="Authorization: Basic $(echo -n
"admin:${UNOMI_OPENSEARCH_PASSWORD}" | base64)"
+ health_endpoint="_cluster/health"
+ curl_opts="-k -H \"${auth_header}\" -H \"Content-Type: application/json\""
else
- schema='http'
+ # Elasticsearch configuration
+ if [ "$UNOMI_ELASTICSEARCH_SSL_ENABLE" = 'true' ]; then
+ schema='https'
+ else
+ schema='http'
+ fi
+
+ if [ -v UNOMI_ELASTICSEARCH_USERNAME ] && [ -v
UNOMI_ELASTICSEARCH_PASSWORD ]; then
+ auth_header="Authorization: Basic $(echo -n
"${UNOMI_ELASTICSEARCH_USERNAME}:${UNOMI_ELASTICSEARCH_PASSWORD}" | base64)"
+ curl_opts="-H \"${auth_header}\""
+ fi
+ health_endpoint="_cluster/health"
fi
-if [ -v UNOMI_ELASTICSEARCH_USERNAME ] && [ -v UNOMI_ELASTICSEARCH_PASSWORD ];
then
-
elasticsearch_addresses="$schema://$UNOMI_ELASTICSEARCH_USERNAME:$UNOMI_ELASTICSEARCH_PASSWORD@$UNOMI_ELASTICSEARCH_ADDRESSES/_cat/health?h=status"
+# Build array of node URLs
+if [ "$SEARCH_ENGINE" = "opensearch" ]; then
Review Comment:
Thanks for catching this, I fixed it.
##########
extensions/web-tracker/wab/yarn.lock:
##########
@@ -4,27 +4,27 @@
"@ampproject/remapping@^2.1.0":
version "2.2.0"
- resolved
"https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d"
Review Comment:
Not sure no, probably something yarn did by itself.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]