Skip to content

Commit

Permalink
docs: add readme for docker folder (#1649)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Chi <iskyzh@gmail.com>
  • Loading branch information
skyzh authored Apr 7, 2022
1 parent 347406f commit 9c2d6fe
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 56 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ Then you'll be able to compile and start RisingWave!

- The `legacy` folder contains RisingWave legacy frontend code. This is to be deprecated, and should not be used in production environment.
- The `src` folder contains all of the kernal components, read [src/README.md][https://github.com/singularity-data/risingwave/blob/main/src/README.md] for more details.
- The `docker` folder contains Dockerfiles to build and start RisingWave.
- The `e2e_test` folder contains the latest end-to-end test cases.
- The `docs` folder contains user and developer docs. If you want to learn about RisingWave, it's a good place to go!
- The `dashbaord` folder contains RisingWave dashboard v2.
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ export DOCKER_IMAGE_TAG ?= latest
export DOCKER_COMPONENT_BACKEND_NAME ?= backend
export DOCKER_COMPONENT_FRONTEND_NAME ?= frontend

docker: docker_frontend docker_backend
docker: docker_frontend docker_frontend_legacy docker_backend

docker_frontend_legacy:
docker build -f docker/frontend-legacy/Dockerfile -t ${DOCKER_GROUP_NAME}/${DOCKER_COMPONENT_FRONTEND_NAME}:${DOCKER_IMAGE_TAG} .

docker_frontend:
docker build -f docker/frontend/Dockerfile -t ${DOCKER_GROUP_NAME}/${DOCKER_COMPONENT_FRONTEND_NAME}:${DOCKER_IMAGE_TAG} .
Expand Down
15 changes: 15 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Docker Images

RisingWave currently *only supports Linux x86_64* for building docker images.

To build the images, simply run:

```
make docker_frontend
make docker_backend
```

in the project root.

For developers, we always recommend using risedev to start the full cluster, instead of using these docker images.
See [CONTRIBUTING](../CONTRIBUTING.md) for more information.
31 changes: 31 additions & 0 deletions docker/frontend-legacy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM openjdk:11.0.13-jdk-bullseye as risingwave_fe_builder

ENV LANG en_US.utf8
ENV RISINGWAVE_FE_HOME=/risingwave_fe
ENV RISINGWAVE_FE_BUILD_ENV=docker
ENV JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8

RUN mkdir -p $RISINGWAVE_FE_HOME/proto $RISINGWAVE_FE_HOME/legacy

WORKDIR $RISINGWAVE_FE_HOME
COPY proto ./proto

WORKDIR $RISINGWAVE_FE_HOME/legacy
COPY legacy ./

RUN ./gradlew build

FROM openjdk:11.0.13-jre-slim-bullseye

RUN mkdir dir -p /risingwave_fe/conf /risingwave_fe/lib

COPY --from=risingwave_fe_builder /risingwave_fe/legacy/pgserver/build/libs/risingwave-fe-runnable.jar /risingwave_fe/lib
COPY --from=risingwave_fe_builder /risingwave_fe/legacy/pgserver/build/resources/main/server.properties /risingwave_fe/conf
COPY --from=risingwave_fe_builder /risingwave_fe/legacy/pgserver/build/resources/main/logback.xml /risingwave_fe/conf

WORKDIR /risingwave_fe

ENV RISINGWAVE_FE_CONF=/risingwave_fe/conf
ENV RISINGWAVE_FE_LIB=/risingwave_fe/lib

EXPOSE 4567
36 changes: 0 additions & 36 deletions docker/frontend-v2/Dockerfile

This file was deleted.

43 changes: 24 additions & 19 deletions docker/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
FROM openjdk:11.0.13-jdk-bullseye as risingwave_fe_builder
FROM ubuntu:20.04 as builder

ENV LANG en_US.utf8
ENV RISINGWAVE_FE_HOME=/risingwave_fe
ENV RISINGWAVE_FE_BUILD_ENV=docker
ENV JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8

RUN mkdir -p $RISINGWAVE_FE_HOME/proto $RISINGWAVE_FE_HOME/legacy
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install make build-essential cmake protobuf-compiler curl openssl libssl-dev pkg-config

WORKDIR $RISINGWAVE_FE_HOME
COPY proto ./proto
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain none -y

WORKDIR $RISINGWAVE_FE_HOME/legacy
COPY legacy ./
RUN mkdir -p /risingwave

RUN ./gradlew build
WORKDIR /risingwave

FROM openjdk:11.0.13-jre-slim-bullseye
COPY proto proto
COPY src src
COPY rust-toolchain rust-toolchain
COPY Cargo.toml Cargo.toml

RUN mkdir dir -p /risingwave_fe/conf /risingwave_fe/lib
ENV PATH /root/.cargo/bin/:$PATH

COPY --from=risingwave_fe_builder /risingwave_fe/legacy/pgserver/build/libs/risingwave-fe-runnable.jar /risingwave_fe/lib
COPY --from=risingwave_fe_builder /risingwave_fe/legacy/pgserver/build/resources/main/server.properties /risingwave_fe/conf
COPY --from=risingwave_fe_builder /risingwave_fe/legacy/pgserver/build/resources/main/logback.xml /risingwave_fe/conf
# We need to add the `rustfmt` dependency, otherwise `risingwave_pb` will not compile
RUN rustup self update \
&& rustup set profile minimal \
&& rustup default $(cat "/risingwave/rust-toolchain") \
&& rustup component add rustfmt

WORKDIR /risingwave_fe
RUN cargo clean && cargo build --release

ENV RISINGWAVE_FE_CONF=/risingwave_fe/conf
ENV RISINGWAVE_FE_LIB=/risingwave_fe/lib
FROM ubuntu:20.04

EXPOSE 4567
RUN mkdir -p /risingwave/bin

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl libssl-dev

COPY --from=builder /risingwave/target/release/frontend-v2 /risingwave/bin/frontend-v2

EXPOSE 4566

0 comments on commit 9c2d6fe

Please sign in to comment.