Files
torus/docker/Dockerfile.torus-compiler-env
zeekay f968edf75a Rename the Concrete dialect and project identifiers to Torus
The MLIR dialect, its conversion passes (TFHEToConcrete, ConcreteToCAPI,
ConcreteToLLVM), the optimizer component, the compiler binary, the Rust
crate and the program_info parameter file all still carried the upstream
project's name. They now carry this one's.

Two things deliberately keep the word, because in them it is not the name.
mlir::OpTrait CRTP parameters mean "the derived type", so they are spelled
Derived and OpTy — LLVM's other conventional spelling for the same idiom.
concreteShape is a capnp field: renaming it would change the serialized
protocol, and the prose describing it is ordinary English.

This also repairs references the earlier partial rename left dangling:
Security.cpp included concrete/curves.gen.h and the directory is torus/,
torus-cpu.h included concrete-num_complex.h, the Torus dialect CMakeLists
named ConcreteOps.td, and compiler/setup.py asked find_namespace_packages
for a "concrete" package that no longer exists — so it built without the
package it ships.
2026-08-27 13:17:38 -07:00

70 lines
3.2 KiB
Docker

FROM quay.io/pypa/manylinux_2_28_x86_64:2024-02-08-a1b4ddc
# epel-release is for install ccache
RUN dnf clean all && dnf install -y epel-release && dnf clean all
# hadolint ignore=DL3041
RUN dnf update -y && dnf install --nodocs -y ninja-build hwloc-devel ccache ncurses-devel openssh-clients graphviz graphviz-devel && dnf clean all
RUN mkdir -p ~/.ssh/ && ssh-keyscan -t ecdsa github.com >> ~/.ssh/known_hosts
# Setup ssl
# hadolint ignore=DL3041
RUN dnf install -y libatomic openssl openssl-devel && dnf clean all
# Setup gcc-11 (required for cuda11.8)
RUN dnf install --nodocs -y gcc-toolset-11 && dnf clean all
ENV CC_COMPILER=/opt/rh/gcc-toolset-11/root/usr/bin/gcc
ENV CXX_COMPILER=/opt/rh/gcc-toolset-11/root/usr/bin/c++
ENV PATH="/opt/rh/gcc-toolset-11/root/usr/bin:$PATH"
ENV LD_LIBRARY_PATH="/opt/rh/gcc-toolset-11/root/usr/lib64:/opt/rh/gcc-toolset-11/root/usr/lib:/opt/rh/gcc-toolset-11/root/usr/lib64/dyninst:/opt/rh/gcc-toolset-11/root/usr/lib/dyninst:$LD_LIBRARY_PATH"
# setup ccache with an unlimited amount of files and storage
RUN ccache -M 0 && ccache -F 0
# config ccache
ENV CCACHE_DEBUG=1
ENV CCACHE_SLOPPINESS="include_file_ctime,include_file_mtime,time_macros"
# Install Rust
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile=minimal -y
ENV PATH=/root/.cargo/bin:$PATH
RUN rustup install --profile=minimal nightly-2024-09-30 nightly &&\
cargo install cxxbridge-cmd
# Install Cap'n Proto
ENV CAPNP_VERSION=1.1.0
# hadolint ignore=DL3003
RUN mkdir /capnproto && \
cd /capnproto && \
curl -O https://capnproto.org/capnproto-c++-${CAPNP_VERSION}.tar.gz && \
tar zxf capnproto-c++-${CAPNP_VERSION}.tar.gz && \
cd capnproto-c++-${CAPNP_VERSION} && \
./configure && \
make -j6 check && \
make install && \
rm -rf /capnproto
# Install boost
# hadolint ignore=DL3003
RUN mkdir /boost/ && \
cd /boost && \
curl -O https://archives.boost.io/release/1.71.0/source/boost_1_71_0.tar.gz && \
tar -xzvf /boost/boost_1_71_0.tar.gz && \
cd /boost/boost_1_71_0 && \
./bootstrap.sh && ./b2 --with-filesystem install && \
rm -rf /boost
# Set the python path. Options: [cp37-cp37m, cp38-cp38, cp39-cp39, cp310-cp310, ...]
# Links and env would be available to use the appropriate python version
ARG python_tag=cp39-cp39
RUN ln -s /opt/python/${python_tag}/bin/pip /bin/pip && ln -s /opt/python/${python_tag}/bin/python /bin/python
ENV PYTHON_EXEC=/opt/python/${python_tag}/bin/python
# Install python deps
# hadolint ignore=DL3013
RUN pip install --no-cache-dir numpy pybind11==2.8 PyYAML pytest wheel auditwheel mypy
# Setup and build compiler
COPY / /torus
WORKDIR /torus/compilers/torus-compiler/compiler
# We build the compiler to have the cache but we try to delete any other build artifact
RUN mkdir /build && \
make DATAFLOW_EXECUTION_ENABLED=ON BUILD_DIR=/build CCACHE=ON \
Python3_EXECUTABLE=${PYTHON_EXEC} \
toruscompiler python-bindings && \
rm -rf /build /root/.cargo/registry /torus/tools/rust_deps_bundle/target/
ENV PYTHONPATH="/build/tools/toruslang/python_packages/toruslang_core"
ENV PATH="$PATH:/build/bin"
# clear stats so that we have clear stats in the next build
RUN ccache -z