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

fix(docker): add workaround for JDK-8345296 on OSX with _JAVA_OPTIONS #1872

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docker-compose.minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ services:
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_LOGS_EXPORTER=otlp
- OTEL_SERVICE_NAME=ad
# Workaround on OSX for https://bugs.openjdk.org/browse/JDK-8345296
- _JAVA_OPTIONS=-XX:UseSVE=0
depends_on:
otel-collector:
condition: service_started
Expand Down Expand Up @@ -654,6 +656,8 @@ services:
- OPENSEARCH_JAVA_OPTS=-Xms300m -Xmx300m
- DISABLE_INSTALL_DEMO_CONFIG=true
- DISABLE_SECURITY_PLUGIN=true
# Workaround on OSX for https://bugs.openjdk.org/browse/JDK-8345296
- _JAVA_OPTIONS=-XX:UseSVE=0
ulimits:
memlock:
soft: -1
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ services:
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_LOGS_EXPORTER=otlp
- OTEL_SERVICE_NAME=ad
# Workaround on OSX for https://bugs.openjdk.org/browse/JDK-8345296
- _JAVA_OPTIONS=-XX:UseSVE=0
depends_on:
otel-collector:
condition: service_started
Expand Down Expand Up @@ -245,6 +247,8 @@ services:
- OTEL_INSTRUMENTATION_MESSAGING_EXPERIMENTAL_RECEIVE_TELEMETRY_ENABLED=true
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=fraud-detection
# Workaround on OSX for https://bugs.openjdk.org/browse/JDK-8345296
- _JAVA_OPTIONS=-XX:UseSVE=0
depends_on:
otel-collector:
condition: service_started
Expand Down Expand Up @@ -658,6 +662,8 @@ services:
- OTEL_RESOURCE_ATTRIBUTES
- OTEL_SERVICE_NAME=kafka
- KAFKA_HEAP_OPTS=-Xmx400m -Xms400m
# Workaround on OSX for https://bugs.openjdk.org/browse/JDK-8345296
- _JAVA_OPTIONS=-XX:UseSVE=0
healthcheck:
test: nc -z kafka 9092
start_period: 10s
Expand Down Expand Up @@ -798,6 +804,8 @@ services:
- OPENSEARCH_JAVA_OPTS=-Xms300m -Xmx300m
- DISABLE_INSTALL_DEMO_CONFIG=true
- DISABLE_SECURITY_PLUGIN=true
# Workaround on OSX for https://bugs.openjdk.org/browse/JDK-8345296
- _JAVA_OPTIONS=-XX:UseSVE=0
ulimits:
memlock:
soft: -1
Expand Down
3 changes: 2 additions & 1 deletion src/ad/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


FROM --platform=${BUILDPLATFORM} eclipse-temurin:21-jdk AS builder

ENV _JAVA_OPTIONS=-XX:UseSVE=0
WORKDIR /usr/src/app/

COPY ./src/ad/gradlew* ./src/ad/settings.gradle* ./src/ad/build.gradle ./
Expand All @@ -27,6 +27,7 @@ WORKDIR /usr/src/app/

COPY --from=builder /usr/src/app/ ./
ADD --chmod=644 https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v$OTEL_JAVA_AGENT_VERSION/opentelemetry-javaagent.jar /usr/src/app/opentelemetry-javaagent.jar
ENV _JAVA_OPTIONS="-XX:UseSVE=0"
ENV JAVA_TOOL_OPTIONS=-javaagent:/usr/src/app/opentelemetry-javaagent.jar

EXPOSE ${AD_PORT}
Expand Down
Loading