From 1c280e0e4fe07d98b43f0646a53fc53279386eb3 Mon Sep 17 00:00:00 2001 From: Mingmin Xu Date: Sun, 4 Feb 2024 23:58:31 -0800 Subject: [PATCH] [Feature][Issue 39849]add datadog java/cpp profiling lib (#40652) Signed-off-by: Mingmin Xu --- docker/dockerfiles/artifacts/artifact.Dockerfile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docker/dockerfiles/artifacts/artifact.Dockerfile b/docker/dockerfiles/artifacts/artifact.Dockerfile index e633687584592..84f616d6b9951 100644 --- a/docker/dockerfiles/artifacts/artifact.Dockerfile +++ b/docker/dockerfiles/artifacts/artifact.Dockerfile @@ -40,6 +40,19 @@ COPY . /build/starrocks WORKDIR /build/starrocks RUN --mount=type=cache,target=/root/.m2/ STARROCKS_VERSION=${RELEASE_VERSION} BUILD_TYPE=${BUILD_TYPE} MAVEN_OPTS=${MAVEN_OPTS} ./build.sh --be --enable-shared-data --clean -j `nproc` +FROM ubuntu:22.04 as datadog-downloader + +RUN apt-get update -y && apt-get install -y --no-install-recommends wget tar xz-utils + +# download the latest dd-java-agent +ADD 'https://dtdg.co/latest-java-tracer' /datadog/dd-java-agent.jar + +# Get ddprof for BE profiling +RUN imagearch=$(arch | sed 's/aarch64/arm64/; s/x86_64/amd64/') \ + && wget --no-check-certificate "https://github.com/DataDog/ddprof/releases/download/v0.15.3/ddprof-0.15.3-${imagearch}-linux.tar.xz" -O ddprof-linux.tar.xz \ + && tar xvf ddprof-linux.tar.xz && mkdir -p /datadog/ \ + && mv ddprof/bin/ddprof /datadog/ \ + && chmod 755 /datadog/ddprof FROM busybox:latest ARG RELEASE_VERSION @@ -51,4 +64,7 @@ COPY --from=fe-builder /build/starrocks/output /release/fe_artifacts COPY --from=be-builder /build/starrocks/output /release/be_artifacts COPY --from=broker-builder /build/starrocks/fs_brokers/apache_hdfs_broker/output /release/broker_artifacts +COPY --from=datadog-downloader /datadog/dd-java-agent.jar /release/fe_artifacts/fe/datadog/dd-java-agent.jar +COPY --from=datadog-downloader /datadog/ddprof /release/be_artifacts/be/datadog/ddprof + WORKDIR /release