-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile.cuda
54 lines (50 loc) · 2.39 KB
/
Dockerfile.cuda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# syntax = docker/dockerfile:1.2
ARG RUST_VERSION=1.81.0
FROM rust:${RUST_VERSION} as chef
RUN cargo install cargo-chef
FROM chef as planner
WORKDIR /app
COPY . .
RUN cargo chef prepare --bin bonsol-node --recipe-path recipe.json
FROM chef as builder
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
apt-get update --fix-missing && \
apt-get install -y --no-install-recommends \
pkg-config \
libssl-dev \
software-properties-common \
build-essential
RUN cargo install sccache --locked
WORKDIR /app/
COPY --from=planner /app/recipe.json recipe.json
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/cuda-keyring_1.1-1_all.deb && \
dpkg -i cuda-keyring_1.1-1_all.deb && \
add-apt-repository contrib && \
apt-get update && \
apt-get -y install cuda-toolkit-12-5;
ENV ENV RUSTC_WRAPPER=/usr/local/cargo/bin/sccache
RUN ls -la /usr/local/cuda-12.5/bin
RUN PATH=/usr/local/cuda-12.5/bin${PATH:+:${PATH}} cargo chef cook --bin bonsol-node --features=cuda --release --recipe-path recipe.json
COPY . .
RUN cargo build -p bonsol-node --features=cuda --release;
FROM rust:${RUST_VERSION}-slim
LABEL org.opencontainers.image.source=https://github.com/anagrambuild/bonsol
LABEL org.opencontainers.image.title="bonsol-node"
LABEL org.opencontainers.image.description="A bonsol proving node"
ARG FLAVOR=standard
RUN mkdir -p /usr/opt/bonsol/stark
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common wget ca-certificates libgmp-dev libsodium-dev nasm m4
COPY --from=builder /app/target/release/bonsol-node /usr/opt/bonsol
COPY --from=risczero/risc0-groth16-prover:v2024-05-17.1 /app/stark_verify /usr/opt/bonsol/stark/stark_verify
COPY --from=risczero/risc0-groth16-prover:v2024-05-17.1 /app/stark_verify.dat /usr/opt/bonsol/stark/stark_verify.dat
COPY --from=risczero/risc0-groth16-prover:v2024-05-17.1 /app/stark_verify_final.zkey /usr/opt/bonsol/stark/stark_verify_final.zkey
COPY --from=risczero/risc0-groth16-prover:v2024-05-17.1 /usr/local/sbin/rapidsnark /usr/opt/bonsol/stark/rapidsnark
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/debian12/x86_64/cuda-keyring_1.1-1_all.deb && \
dpkg -i cuda-keyring_1.1-1_all.deb && \
add-apt-repository contrib && \
apt-get update && \
apt-get -y install cuda-toolkit-12-5;
WORKDIR /usr/opt/bonsol
EXPOSE 9000
ENTRYPOINT ["/usr/opt/bonsol/bonsol-node"]