Skip to content

Commit

Permalink
chore: use toml format in rust-toolchain (#9834)
Browse files Browse the repository at this point in the history
Signed-off-by: TennyZhuang <[email protected]>
  • Loading branch information
TennyZhuang authored May 19, 2023
1 parent 185eb50 commit 1da24c8
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 18 deletions.
16 changes: 9 additions & 7 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ FROM ubuntu:22.04 AS risingwave-build-env

ENV LANG en_US.utf8

ARG RUST_TOOLCHAIN

RUN apt-get update -yy && \
DEBIAN_FRONTEND=noninteractive apt-get -y install make build-essential cmake protobuf-compiler curl parallel python3 python3-pip \
openssl libssl-dev libsasl2-dev libcurl4-openssl-dev pkg-config bash openjdk-11-jdk wget unzip git tmux lld postgresql-client kafkacat netcat mysql-client \
Expand All @@ -12,17 +10,21 @@ RUN apt-get update -yy && \

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

RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain ${RUST_TOOLCHAIN} -y

RUN curl -sSL "https://github.com/bufbuild/buf/releases/download/v1.4.0/buf-$(uname -s)-$(uname -m).tar.gz" | \
tar -xvzf - -C /usr/local --strip-components 1

RUN mkdir -p /risingwave

WORKDIR /risingwave

COPY rust-toolchain rust-toolchain

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

ENV PATH /root/.cargo/bin/:$PATH

RUN rustup show

RUN curl -sSL "https://github.com/bufbuild/buf/releases/download/v1.4.0/buf-$(uname -s)-$(uname -m).tar.gz" | \
tar -xvzf - -C /usr/local --strip-components 1

# install python dependencies
RUN pip3 install pyarrow pytest

Expand Down
5 changes: 2 additions & 3 deletions ci/build-ci-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ cd "$DIR"

cat ../rust-toolchain
# shellcheck disable=SC2155
export RUST_TOOLCHAIN=$(cat ../rust-toolchain)

######################################################
# !!! CHANGE THIS WHEN YOU WANT TO BUMP CI IMAGE !!! #
# AND ALSO docker-compose.yml #
######################################################
export BUILD_ENV_VERSION=v20230517
export BUILD_ENV_VERSION=v20230518

export BUILD_TAG="public.ecr.aws/x5u3w5h6/rw-build-env:${BUILD_ENV_VERSION}"

Expand Down Expand Up @@ -51,7 +50,7 @@ else
export DOCKER_BUILD_PROGRESS="--progress=plain"
fi

docker build -t ${BUILD_TAG} ${DOCKER_BUILD_PROGRESS} --no-cache --build-arg "RUST_TOOLCHAIN=${RUST_TOOLCHAIN}" .
docker build -t ${BUILD_TAG} ${DOCKER_BUILD_PROGRESS} --no-cache .

echo "--- Docker push"
docker push ${BUILD_TAG}
10 changes: 5 additions & 5 deletions ci/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,28 @@ services:
retries: 5

source-test-env:
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230517
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230518
depends_on:
- mysql
- db
volumes:
- ..:/risingwave

sink-test-env:
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230517
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230518
depends_on:
- mysql
- db
volumes:
- ..:/risingwave

rw-build-env:
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230517
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230518
volumes:
- ..:/risingwave

ci-flamegraph-env:
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230517
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230518
# NOTE(kwannoel): This is used in order to permit
# syscalls for `nperf` (perf_event_open),
# so it can do CPU profiling.
Expand All @@ -66,7 +66,7 @@ services:
- ..:/risingwave

regress-test-env:
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230517
image: public.ecr.aws/x5u3w5h6/rw-build-env:v20230518
depends_on:
db:
condition: service_healthy
Expand Down
2 changes: 2 additions & 0 deletions ci/rust-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "nightly-2023-04-07"
3 changes: 2 additions & 1 deletion ci/scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export PATH="${REPO_ROOT}/apache-maven-3.9.1/bin:$PATH"
mvn -v

echo "--- Install rust"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain $(cat ./rust-toolchain) -y
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --no-modify-path --default-toolchain none -y
rustup show
source "$HOME/.cargo/env"
source ci/scripts/common.sh

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN unzip dashboard-artifact.zip && mv risingwave-dashboard-artifact /risingwave
# 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 show \
&& rustup component add rustfmt

RUN cargo fetch
Expand Down
1 change: 0 additions & 1 deletion rust-toolchain

This file was deleted.

1 change: 1 addition & 0 deletions rust-toolchain

0 comments on commit 1da24c8

Please sign in to comment.