Skip to content

Commit 343c121

Browse files
rhdonglowener
authored andcommitted
[Feat] Add Dockerfile for reproducible installation (rapidsai#1195)
Authors: - rhdong (https://github.com/rhdong) Approvers: - Corey J. Nolet (https://github.com/cjnolet) URL: rapidsai#1195
1 parent c4736b3 commit 343c121

1 file changed

Lines changed: 88 additions & 0 deletions

File tree

Dockerfile

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# syntax=docker/dockerfile:1.5
2+
3+
# ==============================================================================
4+
# RAPIDS cuVS Docker Image - Vector Search and Clustering on GPU
5+
#
6+
# Usage:
7+
# docker build -t cuvs:latest .
8+
# docker run --gpus all -it cuvs:latest
9+
#
10+
# Customizable Build Arguments:
11+
# docker build --build-arg CUDA_VER=12.8 --build-arg RAPIDS_VER=25.06 -t cuvs:custom .
12+
# ==============================================================================
13+
14+
# Configurable build arguments - override with --build-arg during build
15+
ARG CUDA_VER=12.9.1
16+
17+
# Python version for the conda environment (supported: 3.10, 3.11, 3.12)
18+
ARG PYTHON_VER=3.12
19+
20+
# RAPIDS/cuVS version
21+
ARG RAPIDS_VER=25.06
22+
23+
FROM nvidia/cuda:${CUDA_VER}-devel-ubuntu24.04
24+
25+
# Display build configuration for verification
26+
RUN echo " Building cuVS Docker image with:" && \
27+
echo " CUDA Version: ${CUDA_VER}" && \
28+
echo " Python Version: ${PYTHON_VER}" && \
29+
echo " RAPIDS Version: ${RAPIDS_VER}"
30+
31+
# Container metadata
32+
LABEL maintainer="RAPIDS cuVS Team"
33+
LABEL description="RAPIDS cuVS - Vector Search and Clustering on GPU"
34+
LABEL org.opencontainers.image.source="https://github.com/rapidsai/cuvs"
35+
LABEL org.opencontainers.image.usage="docker run --gpus all -it <image>"
36+
37+
# Environment setup
38+
ENV DEBIAN_FRONTEND=noninteractive
39+
ENV PYTHONUNBUFFERED=1
40+
ENV CONDA_DIR=/opt/conda
41+
ENV PATH=${CONDA_DIR}/bin:$PATH
42+
43+
# Install system dependencies
44+
RUN apt-get update && apt-get install -y --no-install-recommends \
45+
wget \
46+
ca-certificates \
47+
git \
48+
&& rm -rf /var/lib/apt/lists/*
49+
50+
# Install Miniforge (lightweight conda with conda-forge defaults)
51+
RUN wget --quiet https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O /tmp/miniforge.sh && \
52+
/bin/bash /tmp/miniforge.sh -b -p ${CONDA_DIR} && \
53+
rm /tmp/miniforge.sh && \
54+
${CONDA_DIR}/bin/conda clean -afy
55+
56+
# Create conda environment and install cuVS packages with pinned dependencies
57+
RUN conda create -n cuvs python=${PYTHON_VER} -y && \
58+
conda run -n cuvs conda install -c rapidsai -c conda-forge -c nvidia \
59+
cuvs=${RAPIDS_VER} \
60+
libcuvs=${RAPIDS_VER} \
61+
cuda-version=${CUDA_VER} \
62+
"numpy>=1.23,<3.0a0" \
63+
"cupy>=12.0.0" \
64+
jupyter \
65+
ipython \
66+
-y && \
67+
conda clean -afy
68+
69+
# Create non-root user
70+
RUN useradd -m -s /bin/bash cuvs
71+
USER cuvs
72+
WORKDIR /home/cuvs
73+
74+
# Initialize conda for the user and configure environment activation
75+
RUN ${CONDA_DIR}/bin/conda init bash && \
76+
echo "conda activate cuvs" >> ~/.bashrc && \
77+
echo "conda activate cuvs" >> ~/.bash_profile
78+
79+
# Set environment variables for automatic cuvs environment activation
80+
ENV PATH=${CONDA_DIR}/envs/cuvs/bin:$PATH
81+
ENV CONDA_DEFAULT_ENV=cuvs
82+
ENV CONDA_PREFIX=${CONDA_DIR}/envs/cuvs
83+
84+
# Verify installation and show version info
85+
RUN python -c "import cuvs; print('cuVS version:', cuvs.__version__)"
86+
87+
# Default command
88+
CMD ["bash"]

0 commit comments

Comments
 (0)