test code block
test what kind of formats the copy button on code blocks work. so far only json
dockerfile
FROM alpine
# Install OpenJDK 21
RUN apk add --no-cache openjdk21
# Allow changing the username at build time, default to highbyte
ARG USERNAME=highbyte
RUN adduser -D $USERNAME
# Create necessary directories and chown before we drop root
RUN mkdir -p /usr/local/highbyte/appData \
/usr/local/highbyte/runtime \
/usr/local/highbyte/configuration \
&& chown -R $USERNAME:$USERNAME /usr/local/highbyte
# Backend Runtime Application
COPY --chown=$USERNAME:$USERNAME ./runtime /usr/local/highbyte/runtime
# Frontend Configuration GUI
COPY --chown=$USERNAME:$USERNAME ./configuration /usr/local/highbyte/configuration
# Don't run as root
USER $USERNAME
WORKDIR /usr/local/highbyte/runtime
EXPOSE 45245
ENTRYPOINT [ \
"java", \
"-cp", \
"intelligencehub-runtime.jar:lib/*", \
"com.highbyte.intelligencehub.runtime.Main" \
]
# options: ["start", "stop"]
CMD ["start"]
# Persist the users config between container restarts
VOLUME ["/usr/local/highbyte/appData"]
cert config
[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
prompt = no
[req_distinguished_name]
CN = hbmqtt1
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1 = hbmqtt1
DNS.2 = hbmqtt2[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
prompt = no
[req_distinguished_name]
CN = hbmqtt1
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1 = hbmqtt1
DNS.2 = hbmqtt2[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
prompt = no
[req_distinguished_name]
CN = hbmqtt1
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1 = hbmqtt1
DNS.2 = hbmqtt2
bad json
{
"a":"a1"
"b":"b1"
}
js
const payload = event.value;
stage.setValue(payload);
json
{
"a":"a1",
"b":"b1"
}
yaml
services:
testOtel:
image: highbyte:${IMAGE_VERSION}
container_name: testOtel
hostname: testOtel
ports:
- 45000:45245
- 45001:8885
- 45002:1885
- 45003:9001
volumes:
- testOtelVol:/usr/local/highbyte/appData
networks:
- demonet
environment:
- JDK_JAVA_OPTIONS="-javaagent:lib/opentelemetry-javaagent.jar"
- OTEL_EXPORTER_OTLP_ENDPOINT=http://lgtm:4317
- OTEL_SERVICE_NAME=HighByteIntelligenceHubTest
- OTEL_EXPORTER_OTLP_PROTOCOL=grpc
- OTEL_METRICS_EXPORTER=otlp
- OTEL_LOGS_EXPORTER=otlp
- OTEL_METRIC_EXPORT_INTERVAL=30000
- OTEL_TRACES_SAMPLER=always_off
- OTEL_INSTRUMENTATION_ENABLED=false
- OTEL_INSTRUMENTATION_RUNTIME_METRICS_ENABLED=true
- OTEL_INSTRUMENTATION_LOGBACK_APPENDER_ENABLED= "false"
- OTEL_INSTRUMENTATION_LOG4J_APPENDER_ENABLED= "false"
- OTEL_INSTRUMENTATION_JUL_APPENDER_ENABLED= "false"
- OTEL_INSTRUMENTATION_LOG4J_CONTEXT_DATA_ENABLED= "false"
- OTEL_JAVAAGENT_EXTENSIONS= "com.highbyte.intelligencehub.runtime.otel"
- OTEL_JAVAAGENT_LOGGING= "application"
volumes:
testOtelVol:
networks:
demonet:
external: true
name: demonet
batch script
@echo off
setlocal enabledelayedexpansion
pushd %~dp0
set "OTEL_AGENT_JAR="
set "JAVA_OPTS="
set "OTEL_ENDPOINT=http://localhost:4318"
:parse_args
for %%A in (%*) do (
if "%%A"=="otel" (
set "OTEL_AGENT_JAR=opentelemetry-javaagent.jar"
set "NEXT_IS_ENDPOINT=true"
) else if "%%A"=="help" (
call :print_usage
exit /b 0
) else if defined NEXT_IS_ENDPOINT (
set "OTEL_ENDPOINT=%%A"
set "NEXT_IS_ENDPOINT="
) else (
echo Unknown argument: %%A
call :print_usage
exit /b 1
)
)
goto end_parse_args
:end_parse_args
REM Set OTEL_AGENT_PROPERTIES dynamically based on OTEL_ENDPOINT
set OTEL_AGENT_PROPERTIES=-Dotel.exporter.otlp.endpoint=!OTEL_ENDPOINT! ^
-Dotel.service.name=HighByteIntelligenceHub ^
-Dotel.exporter.otlp.protocol=http/protobuf ^
-Dotel.metrics.exporter=otlp ^
-Dotel.logs.exporter=otlp ^
-Dotel.metrics.exporter.interval=30000 ^
-Dotel.traces.sampler=always_off ^
-Dotel.instrumentation.enabled=false ^
-Dotel.instrumentation.runtime-metrics.enabled=true ^
-Dotel.instrumentation.logback-appender.enabled=false ^
-Dotel.instrumentation.log4j-appender.enabled=false ^
-Dotel.instrumentation.jul-appender.enabled=false ^
-Dotel.instrumentation.log4j-context-data.enabled=false ^
-Dotel.javaagent.extensions=com.highbyte.intelligencehub.runtime.otel ^
-Dotel.javaagent.logging=application
if not "!OTEL_AGENT_JAR!"=="" (
set "JAVA_OPTS=!JAVA_OPTS! -javaagent:lib\!OTEL_AGENT_JAR! !OTEL_AGENT_PROPERTIES!"
echo Starting HighByte Intelligence Hub with OpenTelemetry agent...
echo JAVA_OPTS: !JAVA_OPTS!
)
java !JAVA_OPTS! -cp "intelligencehub-runtime.jar;lib/*" com.highbyte.intelligencehub.runtime.Main start
popd
exit /b 0
:print_usage
echo Usage: %~nx0 ^[otel^|help]
echo otel [collector endpoint]: Use OpenTelemetry agent to collect metrics. Optionally specify a collector endpoint.
echo help: Show this help message.
command line
docker create --name TestStart2P -e PUBLIC_hostname=TestStart1P -e HIGHBYTE_STORE_PASSWORD=highbyte -e URI="jdbc:postgresql://pg:5432/test1ha?user=postgres&password=HighByte#1" --network testha --mount type=bind,source=.\start.sh,target=/usr/local/highbyte/runtime/start.sh,readonly -p 47001:45245 -it highbyte:4.3.0r start otel http://lgtm:4318 ha start -n node2Primary
shell script
#!/bin/sh
cd "$(dirname "$0")" || exit 1
print_usage() {
echo "Usage: $0 [otel|help]"
echo " otel [collector endpoint]: Use OpenTelemetry agent to collect metrics. Optionally specify a collector endpoint."
echo " help: Show this help message."
}
OTEL_AGENT_JAR=""
JAVA_OPTS=""
OTEL_ENDPOINT="http://localhost:4318"
MAIN_CLASS="com.highbyte.intelligencehub.runtime.Main"
ARGS="start"
NODE=""
DB_ARG=""
DB_ENDPOINT="URI"
NODE_NAME="node1Primary"
echo "VIEW_INPUT: $@"
# Parse arguments manually
while [ $# -gt 0 ]; do
case "$1" in
otel)
OTEL_AGENT_JAR="opentelemetry-javaagent.jar"
if [ -n "$2" ]; then
OTEL_ENDPOINT="$2"
shift
fi
;;
help)
print_usage
exit 0
;;
ha)
MAIN_CLASS="com.highbyte.intelligencehub.runtime.HAMain"
if [ "$2" = "start" ] || [ "$2" = "create" ]; then
ARGS="$2"
shift
fi
if [ "$2" = "-n" ]; then
NODE="-n $3"
shift 2
else
NODE="-n $NODE_NAME"
fi
if [ "$2" = "-j" ]; then
DB_ARG="-j $3"
shift 2
else
DB_ARG="-j env:$DB_ENDPOINT"
fi
;;
*)
echo "Unknown argument: $1"
print_usage
exit 1
;;
esac
shift
done
OTEL_AGENT_PROPERTIES="-Dotel.exporter.otlp.endpoint=${OTEL_ENDPOINT} \
-Dotel.service.name=HighByteIntelligenceHub \
-Dotel.exporter.otlp.protocol=http/protobuf \
-Dotel.metrics.exporter=otlp \
-Dotel.logs.exporter=otlp \
-Dotel.metrics.exporter.interval=30000 \
-Dotel.traces.sampler=always_off \
-Dotel.instrumentation.enabled=false \
-Dotel.instrumentation.runtime-metrics.enabled=true \
-Dotel.instrumentation.logback-appender.enabled=false \
-Dotel.instrumentation.log4j-appender.enabled=false \
-Dotel.instrumentation.jul-appender.enabled=false \
-Dotel.instrumentation.log4j-context-data.enabled=false \
-Dotel.javaagent.extensions=com.highbyte.intelligencehub.runtime.otel \
-Dotel.javaagent.logging=application"
if [ -n "$OTEL_AGENT_JAR" ]; then
JAVA_OPTS="$JAVA_OPTS -javaagent:lib/$OTEL_AGENT_JAR $OTEL_AGENT_PROPERTIES"
echo "Starting HighByte Intelligence Hub with OpenTelemetry agent..."
echo "JAVA_OPTS: $JAVA_OPTS"
fi
echo "MAIN_CLASS: $MAIN_CLASS"
echo "ARGS: $ARGS"
echo "NODE: $NODE"
echo "DB_ARG: $DB_ARG"
# Launch java
exec java $JAVA_OPTS -cp "intelligencehub-runtime.jar:lib/*" $MAIN_CLASS $ARGS $NODE $DB_ARG
[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req
prompt = no
[req_distinguished_name]
CN = hbmqtt1
[v3_req]
keyUsage = keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names
[alt_names]
DNS.1 = hbmqtt1
DNS.2 = hbmqtt2
[req]distinguished_name = req_distinguished_namereq_extensions = v3_reqprompt = no[req_distinguished_name]CN = hbmqtt1[v3_req]keyUsage = keyEncipherment, dataEnciphermentextendedKeyUsage = serverAuthsubjectAltName = @alt_names[alt_names]DNS.1 = hbmqtt1DNS.2 = hbmqtt2