From 3297ab66eb409dfc71687db5019f4a92ee72dee7 Mon Sep 17 00:00:00 2001 From: Gaius Date: Mon, 29 Apr 2024 12:12:58 +0800 Subject: [PATCH] chore: add pprof and graphviz for dfdameon container Signed-off-by: Gaius --- Cargo.lock | 16 ++++++++-------- Cargo.toml | 16 ++++++++-------- dragonfly-client/Dockerfile | 10 ++++++++-- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3302d1d0..5d2fc2c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -934,7 +934,7 @@ dependencies = [ [[package]] name = "dragonfly-client" -version = "0.1.42" +version = "0.1.43" dependencies = [ "anyhow", "bytes", @@ -997,7 +997,7 @@ dependencies = [ [[package]] name = "dragonfly-client-backend" -version = "0.1.42" +version = "0.1.43" dependencies = [ "dragonfly-client-core", "futures", @@ -1015,7 +1015,7 @@ dependencies = [ [[package]] name = "dragonfly-client-config" -version = "0.1.42" +version = "0.1.43" dependencies = [ "dragonfly-client-core", "home", @@ -1034,7 +1034,7 @@ dependencies = [ [[package]] name = "dragonfly-client-core" -version = "0.1.42" +version = "0.1.43" dependencies = [ "libloading", "reqwest", @@ -1045,7 +1045,7 @@ dependencies = [ [[package]] name = "dragonfly-client-init" -version = "0.1.42" +version = "0.1.43" dependencies = [ "anyhow", "clap", @@ -1061,7 +1061,7 @@ dependencies = [ [[package]] name = "dragonfly-client-storage" -version = "0.1.42" +version = "0.1.43" dependencies = [ "base16ct", "chrono", @@ -1084,7 +1084,7 @@ dependencies = [ [[package]] name = "dragonfly-client-util" -version = "0.1.42" +version = "0.1.43" dependencies = [ "dragonfly-api", "dragonfly-client-core", @@ -1542,7 +1542,7 @@ dependencies = [ [[package]] name = "hdfs" -version = "0.1.42" +version = "0.1.43" dependencies = [ "dragonfly-client-backend", "dragonfly-client-core", diff --git a/Cargo.toml b/Cargo.toml index 9e7c42e7..73bcc8c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ members = [ ] [workspace.package] -version = "0.1.42" +version = "0.1.43" authors = ["The Dragonfly Developers"] homepage = "https://d7y.io/" repository = "https://github.com/dragonflyoss/client.git" @@ -22,13 +22,13 @@ readme = "README.md" edition = "2021" [workspace.dependencies] -dragonfly-client = { path = "dragonfly-client", version = "0.1.42" } -dragonfly-client-core = { path = "dragonfly-client-core", version = "0.1.42" } -dragonfly-client-config = { path = "dragonfly-client-config", version = "0.1.42" } -dragonfly-client-storage = { path = "dragonfly-client-storage", version = "0.1.42" } -dragonfly-client-backend = { path = "dragonfly-client-backend", version = "0.1.42" } -dragonfly-client-util = { path = "dragonfly-client-util", version = "0.1.42" } -dragonfly-client-init = { path = "dragonfly-client-init", version = "0.1.42" } +dragonfly-client = { path = "dragonfly-client", version = "0.1.43" } +dragonfly-client-core = { path = "dragonfly-client-core", version = "0.1.43" } +dragonfly-client-config = { path = "dragonfly-client-config", version = "0.1.43" } +dragonfly-client-storage = { path = "dragonfly-client-storage", version = "0.1.43" } +dragonfly-client-backend = { path = "dragonfly-client-backend", version = "0.1.43" } +dragonfly-client-util = { path = "dragonfly-client-util", version = "0.1.43" } +dragonfly-client-init = { path = "dragonfly-client-init", version = "0.1.43" } thiserror = "1.0" dragonfly-api = "2.0.110" reqwest = { version = "0.11.27", features = ["stream", "native-tls", "default-tls", "rustls-tls"] } diff --git a/dragonfly-client/Dockerfile b/dragonfly-client/Dockerfile index 8b61e8f4..e4517c45 100644 --- a/dragonfly-client/Dockerfile +++ b/dragonfly-client/Dockerfile @@ -1,8 +1,9 @@ FROM rust:1.75.0 as builder +WORKDIR /app/client + RUN apt-get update && apt-get install -y openssl libclang-dev pkg-config protobuf-compiler -WORKDIR /app/client COPY Cargo.toml ./ COPY Cargo.lock ./ @@ -45,16 +46,21 @@ RUN if [ "$(uname -m)" = "ppc64le" ]; then \ fi && \ chmod +x /bin/grpc_health_probe +FROM golang:1.21.1-alpine3.17 as pprof + +RUN go install github.com/google/pprof@latest + FROM debian:bookworm-slim RUN apt-get update && apt-get install -y --no-install-recommends wget curl \ bash-completion procps apache2-utils ca-certificates binutils bpfcc-tools \ - dnsutils git iputils-ping jq vim linux-perf \ + dnsutils git iputils-ping jq vim linux-perf graphviz \ && rm -rf /var/lib/apt/lists/* COPY --from=builder /app/client/target/release/dfget /usr/local/bin/dfget COPY --from=builder /app/client/target/release/dfdaemon /usr/local/bin/dfdaemon COPY --from=builder /app/client/target/release/dfstore /usr/local/bin/dfstore COPY --from=health /bin/grpc_health_probe /bin/grpc_health_probe +COPY --from=pprof /go/bin/pprof /bin/pprof ENTRYPOINT ["/usr/local/bin/dfdaemon"]