candle-kernels build vaatii GPU-arkkitehtuurin tunnistusta. nvidia-smi ei ole saatavilla Docker build -vaiheessa, joten asetetaan CUDA_COMPUTE_CAP manuaalisesti (RTX 4090 = sm_89). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
39 lines
1.3 KiB
Docker
39 lines
1.3 KiB
Docker
FROM nvidia/cuda:12.6.3-devel-ubuntu24.04 AS builder
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
curl pkg-config libssl-dev g++ libvulkan-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Rust
|
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
|
|
|
WORKDIR /app
|
|
COPY Cargo.toml Cargo.lock ./
|
|
COPY hub/Cargo.toml hub/Cargo.toml
|
|
COPY node/Cargo.toml node/Cargo.toml
|
|
COPY native-node/Cargo.toml native-node/Cargo.toml
|
|
COPY cli/Cargo.toml cli/Cargo.toml
|
|
|
|
# Tyhjät src-tiedostot riippuvuuksien esikääntämistä varten
|
|
RUN mkdir -p hub/src node/src native-node/src cli/src \
|
|
&& echo "fn main(){}" > hub/src/main.rs \
|
|
&& echo "" > node/src/lib.rs \
|
|
&& echo "fn main(){}" > native-node/src/main.rs \
|
|
&& echo "fn main(){}" > cli/src/main.rs \
|
|
&& cargo build --release -p native-node 2>/dev/null || true
|
|
|
|
COPY native-node/src native-node/src
|
|
# RTX 4090 = sm_89, RTX 3090 = sm_86, RTX 2080 = sm_75
|
|
ENV CUDA_COMPUTE_CAP=89
|
|
RUN cargo build --release -p native-node
|
|
|
|
FROM nvidia/cuda:12.6.3-runtime-ubuntu24.04
|
|
RUN apt-get update && apt-get install -y ca-certificates libvulkan1 && rm -rf /var/lib/apt/lists/*
|
|
COPY --from=builder /app/target/release/native-node /usr/local/bin/native-node
|
|
|
|
ENV HUB_URL=ws://agentic-poc:3000/ws
|
|
ENV ALLOCATED_GB=4
|
|
|
|
CMD ["native-node"]
|