Native node CUDA Docker: nvidia/cuda base + GPU runtime

Dockerfile käyttää nvidia/cuda:12.6.3 -imagea jossa CUDA-kirjastot
ovat valmiina. docker-compose lisää runtime: nvidia + NVIDIA_VISIBLE_DEVICES.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 21:02:43 +03:00
parent b2694c232e
commit 4ad8a8793e
2 changed files with 11 additions and 6 deletions

View File

@@ -1,9 +1,13 @@
FROM rust:slim AS builder
FROM nvidia/cuda:12.6.3-devel-ubuntu24.04 AS builder
RUN apt-get update && apt-get install -y \
pkg-config libssl-dev g++ \
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
@@ -20,11 +24,11 @@ RUN mkdir -p hub/src node/src native-node/src \
COPY native-node/src native-node/src
RUN cargo build --release -p native-node
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
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://hub:3000/ws
ENV HUB_URL=ws://agentic-poc:3000/ws
ENV ALLOCATED_GB=4
CMD ["native-node"]

View File

@@ -17,12 +17,13 @@ services:
context: .
dockerfile: Dockerfile.native-node
container_name: kipina_native_node
runtime: nvidia
environment:
- HUB_URL=ws://agentic-poc:3000/ws
- ALLOCATED_GB=4
- NVIDIA_VISIBLE_DEVICES=all
depends_on:
- agentic-poc
# GPU passthrough (valinnainen — toimii myös ilman)
deploy:
resources:
reservations: