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

feat: add debug profile tools in docker image #10380

Merged
merged 3 commits into from
Jun 17, 2023
Merged
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
27 changes: 18 additions & 9 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
FROM ubuntu:22.04 as base
FROM ubuntu:22.04 AS base

ENV LANG en_US.utf8

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install make build-essential cmake protobuf-compiler curl bash lld maven unzip libsasl2-dev
RUN apt-get update \
&& apt-get -y install ca-certificates build-essential libsasl2-dev openjdk-11-jdk

FROM base as builder
FROM base AS builder

RUN apt-get update && apt-get -y install make cmake protobuf-compiler curl bash lld maven unzip

SHELL ["/bin/bash", "-c"]

Expand Down Expand Up @@ -32,28 +35,34 @@ RUN rustup self update \
&& rustup show \
&& rustup component add rustfmt

RUN cargo fetch

RUN cargo build -p risingwave_cmd_all --release --features "rw-static-link" && \
RUN cargo fetch && \
cargo build -p risingwave_cmd_all --release --features "rw-static-link" && \
mkdir -p /risingwave/bin && mv /risingwave/target/release/risingwave /risingwave/bin/ && \
cp ./target/release/build/tikv-jemalloc-sys-*/out/build/bin/jeprof /risingwave/bin/ && \
mkdir -p /risingwave/lib && cargo clean

RUN cd /risingwave/java && mvn -B package -Dmaven.test.skip=true -Djava.binding.release=true && \
mkdir -p /risingwave/bin/connector-node && \
tar -zxvf /risingwave/java/connector-node/assembly/target/risingwave-connector-1.0.0.tar.gz -C /risingwave/bin/connector-node

FROM ubuntu:22.04 as image-base
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install ca-certificates openjdk-11-jdk libsasl2-dev && rm -rf /var/lib/{apt,dpkg,cache,log}/
FROM base AS risingwave

FROM image-base as risingwave
LABEL org.opencontainers.image.source https://github.com/risingwavelabs/risingwave

RUN apt-get -y install gdb \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/

RUN mkdir -p /risingwave/bin/connector-node && mkdir -p /risingwave/lib

COPY --from=builder /risingwave/bin/risingwave /risingwave/bin/risingwave
COPY --from=builder /risingwave/bin/connector-node /risingwave/bin/connector-node
COPY --from=builder /risingwave/ui /risingwave/ui
COPY --from=builder /risingwave/bin/jeprof /usr/local/bin/jeprof

# Set default playground mode to docker-playground profile
ENV PLAYGROUND_PROFILE docker-playground
# Set default dashboard UI to local path instead of github proxy
ENV RW_DASHBOARD_UI_PATH /risingwave/ui

ENTRYPOINT [ "/risingwave/bin/risingwave" ]
CMD [ "playground" ]