Skip to content

Commit

Permalink
Add test for pr-13049
Browse files Browse the repository at this point in the history
  • Loading branch information
trazfr committed Oct 3, 2024
1 parent 5a15e1e commit f2d0534
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
57 changes: 57 additions & 0 deletions Dockerfile.pr-13049
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# build the rocksdb deps
FROM ubuntu:24.04 AS build-rocksdb

RUN mkdir /home/java && \
apt-get update && \
apt-get install -y \
build-essential \
libgflags-dev \
libsnappy-dev \
zlib1g-dev \
libbz2-dev \
liblz4-dev \
libzstd-dev \
git \
cmake \
curl \
default-jdk-headless \
maven
WORKDIR /home/java
RUN git clone --no-checkout https://github.com/evolvedbinary/rocksdb.git
RUN cd rocksdb && \
git checkout eb/expensive-jni-misses-13023-jmh-fix
RUN --mount=type=cache,target=/root/.m2 \
cd rocksdb && \
JAVA_HOME=/usr/lib/jvm/default-java make -j $(nproc) rocksdbjavastatic
RUN ln -s /home/java/rocksdb/java/target/rocksdbjni-*.jar /home/java/rocksdbjni.jar

# build the java archive + fetch the deps
FROM ubuntu:24.04 AS build-java

RUN apt-get update && \
apt-get install -y \
curl \
default-jdk-headless \
maven
COPY src /home/java/src
COPY pom.xml /home/java/
WORKDIR /home/java
RUN curl -fL -o dd-java-agent.jar 'https://dtdg.co/latest-java-tracer'
RUN --mount=type=cache,target=/root/.m2 \
mvn clean install && \
ln -s target/test_rocksdb*.jar test_rocksdb.jar

# final image
FROM ubuntu:24.04

RUN apt-get update && \
apt-get install -y default-jre-headless && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /home/java
COPY --from=build-java /home/java/*.jar /home/java/
COPY --from=build-rocksdb /home/java/*.jar /home/java/
CMD java \
-javaagent:dd-java-agent.jar \
-classpath "rocksdbjni.jar:test_rocksdb.jar" \
test.App
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,23 @@ services:
- DD_PROFILING_DDPROF_CSTACK=dwarf
depends_on:
- datadog-agent

test-rocksdb-pr-13049:
build:
context: .
dockerfile: Dockerfile.pr-13049
environment:
- DD_AGENT_HOST=datadog-agent
- DD_SERVICE=test-rocksdb-pr-13049
- DD_ENV=local
- DD_VERSION=1.0
# https://docs.datadoghq.com/profiler/enabling/java/?tab=datadogprofiler#configuration
- DD_PROFILING_ENABLED=true
- DD_PROFILING_DDPROF_CPU_ENABLED=true
- DD_PROFILING_DDPROF_WALL_ENABLED=true
- DD_PROFILING_DIRECTALLOCATION_ENABLED=true
- DD_PROFILING_DDPROF_ENABLED=true
# native stack traces
- DD_PROFILING_DDPROF_CSTACK=dwarf
depends_on:
- datadog-agent

0 comments on commit f2d0534

Please sign in to comment.