forked from zkemail/email-wallet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.rapidsnark.gpu
66 lines (52 loc) · 2.4 KB
/
Dockerfile.rapidsnark.gpu
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM nvidia/cuda:12.3.0-devel-ubuntu22.04 AS builder
RUN apt-get update && apt-get upgrade -y
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt install -y --no-install-recommends \
cmake build-essential pkg-config libssl-dev libgmp-dev libffi-dev \
libsodium-dev nasm git awscli gcc-12 g++-12 nodejs npm curl m4 python3 \
python3-pip python3-dev wget software-properties-common unzip \
&& rm -rf /var/lib/apt/lists/*
# Set GCC 12 as default
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100 \
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1 \
&& update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
RUN apt-get update && \
apt-get install -y --no-install-recommends cmake-data && \
rm -rf /var/lib/apt/lists/*
RUN npm install -g n
RUN n 22
RUN npm install -g yarn snarkjs
WORKDIR /root/rapidsnark
RUN git clone --recursive https://github.com/Orbiter-Finance/rapidsnark.git .
RUN yarn
RUN ./build_gmp.sh host
RUN mkdir build_prover
WORKDIR /root/rapidsnark/build_prover
RUN cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../package -DNVML_LIBRARY=/usr/local/cuda-12.3/targets/x86_64-linux/lib/stubs/libnvidia-ml.so -DCMAKE_CUDA_ARCHITECTURES="75;80;86"
RUN make -j$(nproc) && make install
# Keep the builder stage as the final stage
RUN apt-get update && \
apt-get install -y libgomp1 && \
rm -rf /var/lib/apt/lists/*
# Move the built prover to the expected location
RUN cp /root/rapidsnark/package/bin/prover_cuda /usr/local/bin/ && \
cp -r /root/rapidsnark/package/lib/* /usr/local/lib/ && \
ldconfig
WORKDIR /app
# copy groth16_pkey.zkey and witness.wtns from host to /app
COPY ./tx_auth_header_only/ /app/tx_auth_header_only/
COPY ./tx_auth/ /app/tx_auth/
WORKDIR /app
# ************ ONLY FOR LOCAL DEV ************
# Install zsh, oh-my-zsh and dependencies
RUN apt-get update && apt-get install -y \
zsh \
git \
curl \
vim \
&& rm -rf /var/lib/apt/lists/* \
&& sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended \
&& git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions \
&& sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions)/' ~/.zshrc \
&& chsh -s $(which zsh)