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:
@@ -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 \
|
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/*
|
&& 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
|
WORKDIR /app
|
||||||
COPY Cargo.toml Cargo.lock ./
|
COPY Cargo.toml Cargo.lock ./
|
||||||
COPY hub/Cargo.toml hub/Cargo.toml
|
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
|
COPY native-node/src native-node/src
|
||||||
RUN cargo build --release -p native-node
|
RUN cargo build --release -p native-node
|
||||||
|
|
||||||
FROM debian:bookworm-slim
|
FROM nvidia/cuda:12.6.3-runtime-ubuntu24.04
|
||||||
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
|
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
|
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
|
ENV ALLOCATED_GB=4
|
||||||
|
|
||||||
CMD ["native-node"]
|
CMD ["native-node"]
|
||||||
|
|||||||
@@ -17,12 +17,13 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile.native-node
|
dockerfile: Dockerfile.native-node
|
||||||
container_name: kipina_native_node
|
container_name: kipina_native_node
|
||||||
|
runtime: nvidia
|
||||||
environment:
|
environment:
|
||||||
- HUB_URL=ws://agentic-poc:3000/ws
|
- HUB_URL=ws://agentic-poc:3000/ws
|
||||||
- ALLOCATED_GB=4
|
- ALLOCATED_GB=4
|
||||||
|
- NVIDIA_VISIBLE_DEVICES=all
|
||||||
depends_on:
|
depends_on:
|
||||||
- agentic-poc
|
- agentic-poc
|
||||||
# GPU passthrough (valinnainen — toimii myös ilman)
|
|
||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
reservations:
|
reservations:
|
||||||
|
|||||||
Reference in New Issue
Block a user