From f2d0534f7f26dca053fc7597b4633a0d79c62691 Mon Sep 17 00:00:00 2001 From: Alexandre Blazart Date: Thu, 3 Oct 2024 14:29:15 +0200 Subject: [PATCH] Add test for pr-13049 https://github.com/facebook/rocksdb/pull/13049 --- Dockerfile.pr-13049 | 57 +++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 20 ++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 Dockerfile.pr-13049 diff --git a/Dockerfile.pr-13049 b/Dockerfile.pr-13049 new file mode 100644 index 0000000..b39d096 --- /dev/null +++ b/Dockerfile.pr-13049 @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index b7d7c97..6fe5a27 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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