Integrate Airbender (#175)

This commit is contained in:
Han
2025-10-21 11:21:26 +08:00
committed by GitHub
parent 577f97165e
commit 11020823a6
29 changed files with 1901 additions and 29 deletions

View File

@@ -0,0 +1,35 @@
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}
# Set default toolchain to nightly
RUN rustup default nightly
ARG CUDA
# Default to build for RTX 50 series
ARG CUDA_ARCH=sm_120
# Env read by Airbender crate `gpu_prover`, only taking the numeric part
ARG CUDAARCHS=${CUDA_ARCH#sm_}
# Copy the Airbender SDK installer script from the workspace context
COPY --chmod=755 scripts/sdk_installers/install_airbender_sdk.sh /tmp/install_airbender_sdk.sh
# Run the Airbender SDK installation script.
# This script installs airbender-cli.
RUN /tmp/install_airbender_sdk.sh && rm /tmp/install_airbender_sdk.sh
# Verify airbender-cli is accessible with the correct toolchain
RUN airbender-cli --version
# Add `rust-src` component to enable std build for nightly rust.
RUN rustup component add rust-src
CMD ["/bin/bash"]

View File

@@ -0,0 +1,34 @@
ARG BASE_ZKVM_IMAGE=ere-base-airbender:latest
ARG RUNTIME_IMAGE=ubuntu:24.04
FROM $BASE_ZKVM_IMAGE AS build_stage
COPY . /ere
WORKDIR /ere
RUN cargo build --release --package ere-compiler --bin ere-compiler --features airbender \
&& mkdir bin && mv target/release/ere-compiler bin/ere-compiler \
&& cargo clean && rm -rf $CARGO_HOME/registry/src $CARGO_HOME/registry/cache
FROM $RUNTIME_IMAGE AS runtime_stage
# Install common dependencies and build tools
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy Rust
COPY --from=build_stage /usr/local/cargo /usr/local/cargo
COPY --from=build_stage /usr/local/rustup /usr/local/rustup
# Add Rust to path
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
# Copy ere-compiler
COPY --from=build_stage /ere/bin/ere-compiler /ere/bin/ere-compiler
ENTRYPOINT ["/ere/bin/ere-compiler"]

View File

@@ -0,0 +1,37 @@
ARG BASE_ZKVM_IMAGE=ere-base-airbender:latest
ARG BASE_ZKVM_CUDA_IMAGE=ere-base-airbender: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
COPY . /ere
WORKDIR /ere
ARG CUDA
ARG RUSTFLAGS="-Ctarget-cpu=native"
RUN cargo build --release --package ere-server --bin ere-server --features airbender${CUDA:+,cuda} \
&& mkdir bin && mv target/release/ere-server bin/ere-server \
&& cargo clean && rm -rf $CARGO_HOME/registry/src $CARGO_HOME/registry/cache
FROM $RUNTIME_IMAGE AS runtime
FROM $RUNTIME_CUDA_IMAGE AS runtime_cuda
FROM runtime${CUDA:+_cuda} AS runtime_stage
# Copy airbender-cli
COPY --from=build_stage /usr/local/cargo/bin/airbender-cli /usr/local/cargo/bin/airbender-cli
# Add airbender-cli to path
ENV PATH=/usr/local/cargo/bin:$PATH
# Copy ere-server
COPY --from=build_stage /ere/bin/ere-server /ere/bin/ere-server
ENTRYPOINT ["/ere/bin/ere-server"]

View File

@@ -17,7 +17,7 @@ COPY --chmod=755 scripts/sdk_installers/install_nexus_sdk.sh /tmp/install_nexus_
# Run the Nexus SDK installation script.
# This script installs the specific Rust toolchain (nightly-2025-04-06)
# and installs cargo-nexus
# The CARGO_HOME from ere-base (e.g., /root/.cargo) will be used, and cargo-nexus will be in its bin.
# The CARGO_HOME from ere-base (e.g., /usr/local/cargo) will be used, and cargo-nexus will be in its bin.
RUN /tmp/install_nexus_sdk.sh && rm /tmp/install_nexus_sdk.sh # Clean up the script
# Verify Nexus installation

View File

@@ -17,7 +17,7 @@ COPY --chmod=755 scripts/sdk_installers/install_pico_sdk.sh /tmp/install_pico_sd
# Run the Pico SDK installation script.
# This script installs the specific Rust toolchain (nightly-2025-08-04)
# and installs pico-cli (as cargo-pico).
# The CARGO_HOME from ere-base (e.g., /root/.cargo) will be used, and cargo-pico will be in its bin.
# The CARGO_HOME from ere-base (e.g., /usr/local/cargo) will be used, and cargo-pico will be in its bin.
RUN /tmp/install_pico_sdk.sh && rm /tmp/install_pico_sdk.sh # Clean up the script
# Verify Pico installation