Skip to content

Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.

fix: Opamp Supervisor not able to run or execute in the linux environment (#967)

Aman Agarwalf2b48e58e78b
diff --git a/docker-compose.yml b/docker-compose.yml
index 5ef70bdd..088cac0a 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -19,7 +19,7 @@ services:
interval: 5s
timeout: 3s
retries: 10
- start_period: 30s
+ start_period: 100s
restart: always
openlit:
diff --git a/src/Dockerfile b/src/Dockerfile
index 7bd4edc3..ec85bf3e 100644
--- a/src/Dockerfile
+++ b/src/Dockerfile
@@ -54,31 +54,46 @@ RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o opamp-server .
# OpenTelemetry Collector Contrib download
FROM alpine AS otel-downloader
-# Accept build arguments
-ARG OTEL_VERSION=v0.132.4
-ARG OPAMP_SUPERVISOR_VERSION=v0.132.4
-ARG TARGETARCH=arm64
+# Accept build arguments (TARGETARCH is automatically provided by Docker buildx)
+# Default to amd64 if not specified (most common architecture)
+ARG OTEL_VERSION=v0.142.0
+ARG OPAMP_SUPERVISOR_VERSION=v0.142.0
+ARG TARGETARCH=amd64
+ARG TARGETPLATFORM
-# Install curl for downloading binaries
-RUN apk add --no-cache curl
+# Install curl and file utilities for downloading binaries and verification
+RUN apk add --no-cache curl file
# Set working directory
WORKDIR /tmp
-# Download OpenTelemetry Collector Contrib
-RUN curl -LO "https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/${OTEL_VERSION}/otelcol-contrib_${OTEL_VERSION#v}_linux_${TARGETARCH}.tar.gz" && \
+# Download OpenTelemetry Collector Contrib and OpAMP Supervisor
+RUN echo "Downloading binaries for architecture: ${TARGETARCH}" && \
+ curl -LO "https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/${OTEL_VERSION}/otelcol-contrib_${OTEL_VERSION#v}_linux_${TARGETARCH}.tar.gz" && \
tar -xzf "otelcol-contrib_${OTEL_VERSION#v}_linux_${TARGETARCH}.tar.gz" && \
- chmod +x otelcol-contrib
-
-# Download OpAMP Supervisor
-RUN curl --proto '=https' --tlsv1.2 -fL -o opampsupervisor \
+ chmod +x otelcol-contrib && \
+ echo "otelcol-contrib binary info:" && file otelcol-contrib && \
+ curl --proto '=https' --tlsv1.2 -fL -o opampsupervisor \
"https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/cmd%2Fopampsupervisor%2F${OPAMP_SUPERVISOR_VERSION}/opampsupervisor_${OPAMP_SUPERVISOR_VERSION#v}_linux_${TARGETARCH}" && \
- chmod +x opampsupervisor
+ chmod +x opampsupervisor && \
+ echo "opampsupervisor binary info:" && file opampsupervisor
# Final runtime image - Use slim-bullseye (Debian) for compatibility
FROM python:3.11-slim-bullseye
+# Accept build arguments to pass version and architecture info
+# TARGETARCH is automatically provided by Docker buildx based on --platform
+# Default to amd64 if not specified (must match otel-downloader stage)
+ARG OPAMP_SUPERVISOR_VERSION=v0.142.0
+ARG TARGETARCH=amd64
+ARG TARGETPLATFORM
+
+
+# Set as environment variables for use by scripts
+ENV OPAMP_SUPERVISOR_VERSION=${OPAMP_SUPERVISOR_VERSION}
+ENV TARGETARCH=${TARGETARCH}
+
# Install Node.js from NodeSource repository
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
@@ -122,6 +137,14 @@ COPY --from=go-builder /app/opamp-server/setup-supervisor.sh /app/opamp/setup-su
COPY --from=otel-downloader /tmp/otelcol-contrib /app/opamp/otelcontribcol
COPY --from=otel-downloader /tmp/opampsupervisor /app/opamp/opampsupervisor
+# Verify binary architectures match runtime
+RUN apt-get update && apt-get install -y --no-install-recommends file && \
+ echo "Verifying binary architectures..." && \
+ echo "Runtime architecture: $(uname -m)" && \
+ echo "otelcontribcol:" && file /app/opamp/otelcontribcol && \
+ echo "opampsupervisor:" && file /app/opamp/opampsupervisor && \
+ rm -rf /var/lib/apt/lists/*
+
# Execute entrypoint script to generate NextAuth.js secret and run commands
RUN chmod +x ./scripts/entrypoint.sh /app/opamp/otelcontribcol /app/opamp/opampsupervisor /app/opamp/opamp-server /app/opamp/setup-supervisor.sh
RUN chmod -R u=rwX,go= /app/opamp/certs
diff --git a/src/client/package-lock.json b/src/client/package-lock.json
index 468bd3e1..cae19e5e 100644
--- a/src/client/package-lock.json
+++ b/src/client/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "openlit",
- "version": "1.15.2",
+ "version": "1.15.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "openlit",
- "version": "1.15.2",
+ "version": "1.15.3",
"dependencies": {
"@anthropic-ai/sdk": "^0.21.1",
"@clickhouse/client": "^1.1.0",
diff --git a/src/client/package.json b/src/client/package.json
index 116d2b2f..27f8581d 100644
--- a/src/client/package.json
+++ b/src/client/package.json
@@ -1,6 +1,6 @@
{
"name": "openlit",
- "version": "1.15.2",
+ "version": "1.15.3",
"private": true,
"scripts": {
"dev": "next dev",
diff --git a/src/dev-docker-compose.yml b/src/dev-docker-compose.yml
index 139171e7..348d194d 100644
--- a/src/dev-docker-compose.yml
+++ b/src/dev-docker-compose.yml
@@ -19,7 +19,7 @@ services:
interval: 5s
timeout: 3s
retries: 10
- start_period: 30s
+ start_period: 100s
restart: always
openlit:
diff --git a/src/opamp-server/setup-supervisor.sh b/src/opamp-server/setup-supervisor.sh
index 3e910950..e00627b2 100755
--- a/src/opamp-server/setup-supervisor.sh
+++ b/src/opamp-server/setup-supervisor.sh
@@ -53,17 +53,43 @@ show_usage() {
echo " --production Configure for production (with CA certificate)"
echo " --server-url URL Set the OpAMP server URL (default: wss://localhost:4320/v1/opamp)"
echo " --output-dir DIR Output directory for supervisor config (default: ./supervisor-config)"
+ echo " --version VER OpAMP supervisor version (default: v0.142.0 or from OPAMP_SUPERVISOR_VERSION env)"
+ echo " --arch ARCH Target architecture (default: amd64 or from TARGETARCH env)"
echo " --help Show this help message"
echo ""
echo "Examples:"
echo " $0 --development"
echo " $0 --production --server-url wss://my-openlit-server:4320/v1/opamp"
+ echo " $0 --production --version v0.142.0 --arch arm64"
}
-# Default values
+# Default values (can be overridden by environment variables or command line)
ENVIRONMENT="development"
SERVER_URL="wss://localhost:4320/v1/opamp"
OUTPUT_DIR="./supervisor-config"
+OPAMP_SUPERVISOR_VERSION="${OPAMP_SUPERVISOR_VERSION:-v0.142.0}"
+
+# Auto-detect architecture if not provided
+if [[ -z "${TARGETARCH}" ]]; then
+ ARCH=$(uname -m)
+ case "${ARCH}" in
+ x86_64)
+ TARGETARCH="amd64"
+ ;;
+ aarch64|arm64)
+ TARGETARCH="arm64"
+ ;;
+ armv7l)
+ TARGETARCH="arm"
+ ;;
+ *)
+ log_warn "Unknown architecture: ${ARCH}, defaulting to amd64"
+ TARGETARCH="amd64"
+ ;;
+ esac
+else
+ TARGETARCH="${TARGETARCH}"
+fi
# Parse command line arguments
while [[ $# -gt 0 ]]; do
@@ -84,6 +110,14 @@ while [[ $# -gt 0 ]]; do
OUTPUT_DIR="$2"
shift 2
;;
+ --version)
+ OPAMP_SUPERVISOR_VERSION="$2"
+ shift 2
+ ;;
+ --arch)
+ TARGETARCH="$2"
+ shift 2
+ ;;
--help)
show_usage
exit 0
@@ -99,6 +133,8 @@ done
print_banner
log_step "Configuring OpAMP supervisor for ${ENVIRONMENT} environment"
+log_info "OpAMP Supervisor Version: ${OPAMP_SUPERVISOR_VERSION}"
+log_info "Target Architecture: ${TARGETARCH}"
# Create output directory
mkdir -p "${OUTPUT_DIR}"
@@ -212,11 +248,18 @@ cat > "${INSTRUCTIONS_FILE}" << EOF
### 1. Download OpAMP Supervisor
\`\`\`bash
-# Download the latest OpAMP supervisor binary
-curl -LO https://github.com/open-telemetry/opentelemetry-collector-releases/releases/latest/download/opampsupervisor_linux_amd64
+# Download the OpAMP supervisor binary
+# Version: ${OPAMP_SUPERVISOR_VERSION}
+# Architecture: ${TARGETARCH}
+OPAMP_VERSION="${OPAMP_SUPERVISOR_VERSION}"
+OPAMP_ARCH="${TARGETARCH}"
+OPAMP_VERSION_NO_V="${OPAMP_SUPERVISOR_VERSION#v}"
+
+curl --proto '=https' --tlsv1.2 -fL -o "opampsupervisor_linux_\${OPAMP_ARCH}" \
+ "https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/cmd%2Fopampsupervisor%2F\${OPAMP_VERSION}/opampsupervisor_\${OPAMP_VERSION_NO_V}_linux_\${OPAMP_ARCH}"
# Make it executable
-chmod +x opampsupervisor_linux_amd64
+chmod +x "opampsupervisor_linux_\${OPAMP_ARCH}"
\`\`\`
### 2. Deploy Configuration
@@ -245,7 +288,7 @@ cat >> "${INSTRUCTIONS_FILE}" << EOF
\`\`\`bash
# Start the OpAMP supervisor
-./opampsupervisor_linux_amd64 --config /etc/opamp/supervisor.yaml
+./opampsupervisor_linux_${TARGETARCH} --config /etc/opamp/supervisor.yaml
\`\`\`
### 4. Verify Connection