-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(circom): add Dockerfile for circom
- Loading branch information
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
FROM zktachyon/base:jammy-latest AS builder | ||
LABEL maintainer="The Tachyon Authors <[email protected]>" | ||
|
||
# Install python dependencies | ||
RUN apt update && apt install -y --no-install-recommends python3-pip | ||
RUN python3 -m pip install numpy | ||
|
||
# Set the working directory | ||
WORKDIR /tachyon | ||
|
||
# Copy the entire project | ||
COPY . . | ||
|
||
# Build circom prover | ||
RUN cd vendors/circom && CARGO_BAZEL_REPIN=true bazel build --@kroma_network_tachyon//:has_openmp --config maxopt //:prover_main | ||
|
||
# Build compile tool for witness generator | ||
RUN cd vendors/circom && bazel build --config opt //circomlib/build:compile_witness_generator | ||
|
||
# Use the CUDA base image | ||
FROM nvidia/cuda:12.5.0-devel-ubuntu22.04 AS builder-cuda | ||
|
||
# Set the working directory | ||
WORKDIR /tachyon | ||
|
||
# Copy the entire project | ||
COPY . . | ||
|
||
COPY --from=builder /usr /usr | ||
COPY --from=builder /root/.pyenv /root/.pyenv | ||
|
||
RUN echo 'export PYENV_ROOT="/root/.pyenv"' >> ~/.bash_profile && \ | ||
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile && \ | ||
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile | ||
RUN echo 'export PYENV_ROOT="/root/.pyenv"' >> ~/.bashrc && \ | ||
echo 'command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc && \ | ||
echo 'eval "$(pyenv init -)"' >> ~/.bashrc | ||
ENV PYENV_ROOT="/root/.pyenv" | ||
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}" | ||
|
||
# Build circom prover with CUDA acceleration | ||
RUN cd vendors/circom && CARGO_BAZEL_REPIN=true bazel build --@kroma_network_tachyon//:has_openmp --config maxopt --config cuda //:prover_main | ||
|
||
# Build compile tool for witness generator | ||
RUN cd vendors/circom && bazel build --config opt //circomlib/build:compile_witness_generator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters