mirror of
https://github.com/eth-act/ere.git
synced 2026-04-03 03:00:17 -04:00
Introduce CompilerKind and refactor ere-dockerized (#221)
This commit is contained in:
@@ -1,17 +1,12 @@
|
||||
ARG BASE_IMAGE=ere-base:latest
|
||||
ARG BASE_CUDA_IMAGE=ere-base:latest-cuda
|
||||
|
||||
# Whether to enable CUDA feature or not.
|
||||
ARG CUDA
|
||||
|
||||
FROM $BASE_IMAGE AS base
|
||||
FROM $BASE_CUDA_IMAGE AS base_cuda
|
||||
FROM base${CUDA:+_cuda}
|
||||
FROM $BASE_IMAGE
|
||||
|
||||
# The ere-base image provides Rust, Cargo, and common tools.
|
||||
# ZisK requires Ubuntu 22.04 or higher (ere-base uses 24.04 by default).
|
||||
# We operate as root for SDK and dependency installation.
|
||||
|
||||
# Whether to enable CUDA feature or not.
|
||||
ARG CUDA
|
||||
|
||||
# Install ZisK system dependencies (for Ubuntu)
|
||||
@@ -68,4 +63,11 @@ ENV PATH=/root/.zisk/bin:$PATH
|
||||
# Verify cargo-zisk is accessible
|
||||
RUN echo "Verifying ZisK installation in Dockerfile ..." && cargo-zisk --version
|
||||
|
||||
# Copy the TamaGo installer script from the workspace context
|
||||
COPY --chmod=755 scripts/install_tamago.sh /tmp/install_tamago.sh
|
||||
|
||||
# Run the TamaGo installation script.
|
||||
RUN /tmp/install_tamago.sh && \
|
||||
rm /tmp/install_tamago.sh
|
||||
|
||||
CMD ["/bin/bash"]
|
||||
|
||||
@@ -9,7 +9,7 @@ WORKDIR /ere
|
||||
|
||||
RUN cargo build --release --package ere-compiler --bin ere-compiler --features zisk \
|
||||
&& mkdir bin && mv target/release/ere-compiler bin/ere-compiler \
|
||||
&& cargo clean && rm -rf $CARGO_HOME/registry/src $CARGO_HOME/registry/cache
|
||||
&& cargo clean && rm -rf $CARGO_HOME/registry/
|
||||
|
||||
FROM $RUNTIME_IMAGE AS runtime_stage
|
||||
|
||||
@@ -28,6 +28,12 @@ ENV RUSTUP_HOME=/usr/local/rustup \
|
||||
CARGO_HOME=/usr/local/cargo \
|
||||
PATH=/usr/local/cargo/bin:$PATH
|
||||
|
||||
# Copy TamaGo
|
||||
COPY --from=build_stage /root/.tamago /root/.tamago
|
||||
|
||||
# Add TamaGo to path
|
||||
ENV PATH=/root/.tamago/bin:$PATH
|
||||
|
||||
# Copy ZisK SDK
|
||||
COPY --from=build_stage /root/.zisk/toolchains /root/.zisk/toolchains
|
||||
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
ARG BASE_ZKVM_IMAGE=ere-base-zisk:latest
|
||||
ARG BASE_ZKVM_CUDA_IMAGE=ere-base-zisk:latest-cuda
|
||||
ARG RUNTIME_IMAGE=ubuntu:24.04
|
||||
ARG RUNTIME_CUDA_IMAGE=nvidia/cuda:12.9.1-runtime-ubuntu24.04
|
||||
|
||||
# Whether to enable CUDA feature or not.
|
||||
ARG CUDA
|
||||
|
||||
FROM $BASE_ZKVM_IMAGE AS base
|
||||
FROM $BASE_ZKVM_CUDA_IMAGE AS base_cuda
|
||||
FROM base${CUDA:+_cuda} AS build_stage
|
||||
FROM $BASE_ZKVM_IMAGE AS build_stage
|
||||
|
||||
COPY . /ere
|
||||
|
||||
@@ -19,7 +16,7 @@ ARG RUSTFLAGS
|
||||
|
||||
RUN cargo build --release --package ere-server --bin ere-server --features zisk${CUDA:+,cuda} \
|
||||
&& mkdir bin && mv target/release/ere-server bin/ere-server \
|
||||
&& cargo clean && rm -rf $CARGO_HOME/registry/src $CARGO_HOME/registry/cache
|
||||
&& cargo clean && rm -rf $CARGO_HOME/registry/
|
||||
|
||||
FROM $RUNTIME_IMAGE AS runtime
|
||||
FROM $RUNTIME_CUDA_IMAGE AS runtime_cuda
|
||||
|
||||
Reference in New Issue
Block a user