Spaces:
Sleeping
Sleeping
FROM nvidia/cuda:12.2.2-devel-ubuntu22.04 as chef | |
RUN apt-get update && apt-get install -y curl | |
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y | |
ENV PATH=/root/.cargo/bin:$PATH | |
RUN cargo install cargo-chef | |
WORKDIR /app | |
FROM chef as planner | |
COPY . . | |
RUN cargo chef prepare --recipe-path recipe.json | |
FROM chef as builder | |
RUN apt-get update && apt-get install -y cmake g++ libclang-dev libssl-dev pkg-config python3-dev | |
COPY --from=planner /app/recipe.json recipe.json | |
RUN cargo chef cook --release --recipe-path recipe.json | |
COPY . . | |
RUN cargo build --release | |
FROM nvidia/cuda:12.2.2-runtime-ubuntu22.04 as runtime | |
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/* | |
WORKDIR /app | |
COPY --from=builder /app/target/release/polyhedron . | |
ENTRYPOINT ["./polyhedron"] |