Skip to content

Commit

Permalink
Rollback commented out Dockerfile parts
Browse files Browse the repository at this point in the history
  • Loading branch information
hatemosphere committed Oct 6, 2023
1 parent 559d455 commit e63f4e8
Showing 1 changed file with 27 additions and 28 deletions.
55 changes: 27 additions & 28 deletions docker/prover/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,57 @@ FROM nvidia/cuda:11.8.0-devel-ubuntu22.04 as builder

ARG DEBIAN_FRONTEND=noninteractive

ARG ERA_BELLMAN_CUDA_RELEASE=latest

RUN apt-get update && apt-get install -y curl jq clang openssl libssl-dev gcc g++ \
pkg-config build-essential libclang-dev && \
rm -rf /var/lib/apt/lists/*

# ENV RUSTUP_HOME=/usr/local/rustup \
# CARGO_HOME=/usr/local/cargo \
# PATH=/usr/local/cargo/bin:$PATH
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH

# RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
# rustup install nightly-2023-07-21 && \
# rustup default nightly-2023-07-21
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y && \
rustup install nightly-2023-07-21 && \
rustup default nightly-2023-07-21

WORKDIR /usr/src/zksync
# COPY . .

ARG ERA_BELLMAN_CUDA_RELEASE=""
RUN echo "ERA_BELLMAN_CUDA_RELEASE=${ERA_BELLMAN_CUDA_RELEASE}"
COPY . .

ENV GITHUB_OWNER=matter-labs
ENV GITHUB_REPO=era-bellman-cuda

RUN set -e; \
if [ "$ERA_BELLMAN_CUDA_RELEASE" = "latest" ]; then \
latest_release_data=$(curl --silent "https://api.github.com/repos/${GITHUB_OWNER}/${GITHUB_REPO}/releases"); \
latest_tag=$(echo "$latest_release_data" | jq -r '.[0].tag_name'); \
source_url="https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}/archive/refs/tags/${latest_tag}.tar.gz"; \
binary_url="https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}/releases/download/${latest_tag}/bellman-cuda.tar.gz"; \
latest_release_data=$(curl --silent "https://api.github.com/repos/${GITHUB_OWNER}/${GITHUB_REPO}/releases"); \
latest_tag=$(echo "$latest_release_data" | jq -r '.[0].tag_name'); \
source_url="https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}/archive/refs/tags/${latest_tag}.tar.gz"; \
binary_url="https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}/releases/download/${latest_tag}/bellman-cuda.tar.gz"; \
else \
source_url="https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}/archive/refs/tags/${ERA_BELLMAN_CUDA_RELEASE}.tar.gz"; \
binary_url="https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}/releases/download/${ERA_BELLMAN_CUDA_RELEASE}/bellman-cuda.tar.gz"; \
source_url="https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}/archive/refs/tags/${ERA_BELLMAN_CUDA_RELEASE}.tar.gz"; \
binary_url="https://github.com/${GITHUB_OWNER}/${GITHUB_REPO}/releases/download/${ERA_BELLMAN_CUDA_RELEASE}/bellman-cuda.tar.gz"; \
fi; \
curl --silent --location "$source_url" --output bellman-cuda-source.tar.gz; \
curl --silent --location "$binary_url" --output bellman-cuda.tar.gz; \
mkdir -p bellman-cuda; \
tar xvfz bellman-cuda.tar.gz -C ./bellman-cuda; \
tar xvfz bellman-cuda-source.tar.gz -C ./bellman-cuda --strip-components=1

# RUN cargo build --release
RUN cargo build --release

# FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04 as runner
FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04 as runner

# ARG DEBIAN_FRONTEND=noninteractive
ARG DEBIAN_FRONTEND=noninteractive

# RUN apt-get update && apt-get install -y libpq5 ca-certificates openssl && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y libpq5 ca-certificates openssl && rm -rf /var/lib/apt/lists/*

# COPY etc/system-contracts/bootloader/build/artifacts/ /etc/system-contracts/bootloader/build/artifacts/
# COPY etc/system-contracts/artifacts-zk /etc/system-contracts/artifacts-zk
# COPY contracts/ethereum/artifacts/ /contracts/ethereum/artifacts/
# COPY contracts/zksync/artifacts-zk/ /contracts/zksync/artifacts-zk/
# COPY setup_2\^26.key /etc/
COPY etc/system-contracts/bootloader/build/artifacts/ /etc/system-contracts/bootloader/build/artifacts/
COPY etc/system-contracts/artifacts-zk /etc/system-contracts/artifacts-zk
COPY contracts/ethereum/artifacts/ /contracts/ethereum/artifacts/
COPY contracts/zksync/artifacts-zk/ /contracts/zksync/artifacts-zk/
COPY setup_2\^26.key /etc/

# COPY core/bin/verification_key_generator_and_server/data/ /core/bin/verification_key_generator_and_server/data/
COPY core/bin/verification_key_generator_and_server/data/ /core/bin/verification_key_generator_and_server/data/

# COPY --from=builder /usr/src/zksync/target/release/zksync_prover /usr/bin/
# ENTRYPOINT ["zksync_prover"]
COPY --from=builder /usr/src/zksync/target/release/zksync_prover /usr/bin/
ENTRYPOINT ["zksync_prover"]

0 comments on commit e63f4e8

Please sign in to comment.