Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions .github/workflows/build-cuvs-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2025, NVIDIA CORPORATION.
# Copyright (c) 2025-2026, NVIDIA CORPORATION.
name: build-cuvs

on:
Expand Down Expand Up @@ -89,6 +89,14 @@ jobs:
buildkitd-config: /etc/buildkit/buildkitd.toml
driver: docker-container
endpoint: builders
- name: Generate Build Args
id: generate-build-args
run: ci/compute-build-args.sh
env:
CUDA_VER: ${{ inputs.CUDA_VER }}
LINUX_VER: ${{ inputs.LINUX_VER }}
PYTHON_VER: ${{ inputs.PYTHON_VER }}
RAPIDS_VER: ${{ inputs.RAPIDS_VER }}
- name: Build cuVS Benchmarks GPU image
uses: docker/build-push-action@v6
with:
Expand All @@ -98,10 +106,7 @@ jobs:
push: true
pull: true
build-args: |
CUDA_VER=${{ inputs.CUDA_VER }}
LINUX_VER=${{ inputs.LINUX_VER }}
PYTHON_VER=${{ inputs.PYTHON_VER }}
RAPIDS_VER=${{ inputs.RAPIDS_VER }}
${{ steps.generate-build-args.outputs.DOCKER_BUILD_ARGS }}
tags: ${{ inputs.CUVS_BENCH_TAG }}-${{ matrix.ARCH }}
# ensure only OCI mediatypes are used: https://docs.docker.com/build/exporters/#oci-media-types
outputs: type=registry,oci-mediatypes=true
Expand All @@ -114,10 +119,7 @@ jobs:
# push: true
# pull: true
# build-args: |
# CUDA_VER=${{ inputs.CUDA_VER }}
# LINUX_VER=${{ inputs.LINUX_VER }}
# PYTHON_VER=${{ inputs.PYTHON_VER }}
# RAPIDS_VER=${{ inputs.RAPIDS_VER }}
# ${{ steps.generate-build-args.outputs.DOCKER_BUILD_ARGS }}
# tags: ${{ inputs.CUVS_BENCH_DATASETS_TAG }}-${{ matrix.ARCH }}
# outputs: type=registry,oci-mediatypes=true
- name: Build cuVS Benchmarks CPU image
Expand All @@ -130,10 +132,7 @@ jobs:
push: true
pull: true
build-args: |
CUDA_VER=${{ inputs.CUDA_VER }}
LINUX_VER=${{ inputs.LINUX_VER }}
PYTHON_VER=${{ inputs.PYTHON_VER }}
RAPIDS_VER=${{ inputs.RAPIDS_VER }}
${{ steps.generate-build-args.outputs.DOCKER_BUILD_ARGS }}
tags: ${{ inputs.CUVS_BENCH_CPU_TAG }}-${{ matrix.ARCH }}
# ensure only OCI mediatypes are used: https://docs.docker.com/build/exporters/#oci-media-types
outputs: type=registry,oci-mediatypes=true
27 changes: 14 additions & 13 deletions .github/workflows/build-rapids-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2025, NVIDIA CORPORATION.
# Copyright (c) 2025-2026, NVIDIA CORPORATION.
name: build-rapids

on:
Expand Down Expand Up @@ -88,6 +88,17 @@ jobs:
driver: docker-container
endpoint: builders
version: 'v0.30.1'
- name: Generate Build Args
id: generate-build-args
run: ci/compute-build-args.sh
env:
CPU_ARCH: ${{ matrix.ARCH }}
CUDA_VER: ${{ inputs.CUDA_VER }}
LINUX_DISTRO: ${{ inputs.LINUX_DISTRO }}
LINUX_DISTRO_VER: ${{ inputs.LINUX_DISTRO_VER }}
LINUX_VER: ${{ inputs.LINUX_VER }}
PYTHON_VER: ${{ inputs.PYTHON_VER }}
RAPIDS_VER: ${{ inputs.RAPIDS_VER }}
- name: Build base image
uses: docker/build-push-action@v6
with:
Expand All @@ -97,12 +108,7 @@ jobs:
push: true
pull: true
build-args: |
CUDA_VER=${{ inputs.CUDA_VER }}
LINUX_DISTRO=${{ inputs.LINUX_DISTRO }}
LINUX_DISTRO_VER=${{ inputs.LINUX_DISTRO_VER }}
LINUX_VER=${{ inputs.LINUX_VER }}
PYTHON_VER=${{ inputs.PYTHON_VER }}
RAPIDS_VER=${{ inputs.RAPIDS_VER }}
${{ steps.generate-build-args.outputs.DOCKER_BUILD_ARGS }}
tags: ${{ inputs.BASE_TAG }}-${{ matrix.ARCH }}
# ensure only OCI mediatypes are used: https://docs.docker.com/build/exporters/#oci-media-types
outputs: type=registry,oci-mediatypes=true
Expand All @@ -115,12 +121,7 @@ jobs:
push: true
pull: true
build-args: |
CUDA_VER=${{ inputs.CUDA_VER }}
LINUX_DISTRO=${{ inputs.LINUX_DISTRO }}
LINUX_DISTRO_VER=${{ inputs.LINUX_DISTRO_VER }}
LINUX_VER=${{ inputs.LINUX_VER }}
PYTHON_VER=${{ inputs.PYTHON_VER }}
RAPIDS_VER=${{ inputs.RAPIDS_VER }}
${{ steps.generate-build-args.outputs.DOCKER_BUILD_ARGS }}
tags: ${{ inputs.NOTEBOOKS_TAG }}-${{ matrix.ARCH }}
# ensure only OCI mediatypes are used: https://docs.docker.com/build/exporters/#oci-media-types
outputs: type=registry,oci-mediatypes=true
4 changes: 1 addition & 3 deletions .github/workflows/build-test-publish-images.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2023-2025, NVIDIA CORPORATION.
# Copyright (c) 2023-2026, NVIDIA CORPORATION.
name: build and publish imgs workflow

on:
Expand Down Expand Up @@ -55,8 +55,6 @@ jobs:
ci/lint-dockerfiles.sh
compute-matrix:
runs-on: ubuntu-latest
container:
image: rapidsai/ci-conda:latest
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just some string manipulation in bash + jq + yq... I don't think we need to pay the cost of pulling a container image, and I think we can pretty safely just accept whatever jq / yq version GitHub is shipping in its images (ref: https://github.com/actions/runner-images/tree/main/images/ubuntu).

outputs:
BASE_IMAGE_REPO: ${{ steps.compute-image-repo.outputs.BASE_IMAGE_REPO }}
NOTEBOOKS_IMAGE_REPO: ${{ steps.compute-image-repo.outputs.NOTEBOOKS_IMAGE_REPO }}
Expand Down
17 changes: 14 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
.vscode

*.a
*.bz2
*.dll
*.dylib
*.exe
*.gz
*.pdf
*.png
.ruff_cache/
*.so
*.tar.gz
*.tgz
*.whl
*.zip
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saw .ruff_cache not .gitignore'd and that led me to updating this file which led me to adding a few more things just for extra safety.


# Created by https://www.gitignore.io/api/macos,linux
### Linux ###
*~
.fuse_hidden*
Expand All @@ -27,5 +40,3 @@ Icon
Network Trash Folder
Temporary Items
.apdisk

# End of https://www.gitignore.io/api/macos,linux
103 changes: 65 additions & 38 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,58 +1,78 @@
# syntax=docker/dockerfile:1
# Copyright (c) 2024-2025, NVIDIA CORPORATION.
# Copyright (c) 2024-2026, NVIDIA CORPORATION.

ARG CUDA_VER=unset
ARG PYTHON_VER=unset
ARG CUDA_VER=notset
ARG LINUX_DISTRO=ubuntu
ARG LINUX_DISTRO_VER=22.04
ARG LINUX_VER=${LINUX_DISTRO}${LINUX_DISTRO_VER}

ARG PYTHON_VER=notset
ARG RAPIDS_VER=26.02

# Gather dependency information

# ignore hadolint DL3007... we really do always want the latest 'rapidsai/ci-conda',
# and don't want to have to push new commits to update to it
#
# hadolint ignore=DL3007
FROM rapidsai/ci-conda:${RAPIDS_VER}-latest AS dependencies
ARG CUDA_VER
ARG PYTHON_VER

ARG RAPIDS_VER

FROM python:${PYTHON_VER} AS dependencies
ARG CPU_ARCH=notset
ARG CUDA_VER=notset
ARG PYTHON_VER=notset
ARG RAPIDS_BRANCH="main"
ARG RAPIDS_VER=notset
ARG YQ_VER=notset

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

RUN pip install --upgrade conda-merge rapids-dependency-file-generator

COPY condarc /condarc
COPY notebooks.sh /notebooks.sh

# clone RAPIDS repos and extract the following:
#
# * IPython notebooks (/notebooks)
# * a single conda env YAML with all dependencies needed to run the notebooks (at /test_notebooks_dependencies.yaml)
#
RUN <<EOF
apt-get update
apt-get install -y --no-install-recommends rsync
APT_PACKAGES_TO_INSTALL=(
jq
rsync
)
apt-get install -y --no-install-recommends \
"${APT_PACKAGES_TO_INSTALL[@]}"

PACKAGES_TO_INSTALL=(
'conda-merge==0.3.*'
'rapids-dependency-file-generator==1.20.*'
)
python -m pip install --no-cache-dir --prefer-binary --upgrade \
"${PACKAGES_TO_INSTALL[@]}"

# yq>=4.0 is needed for the bit in /notebooks.sh that uses load() to read channels from /condarc
wget -q https://github.com/mikefarah/yq/releases/download/v${YQ_VER}/yq_linux_${CPU_ARCH} -O /tmp/yq
mv /tmp/yq /usr/bin/yq
chmod +x /usr/bin/yq

/notebooks.sh
apt-get purge -y --auto-remove rsync

apt-get purge -y --auto-remove \
"${APT_PACKAGES_TO_INSTALL[@]}"

rm -rf /var/lib/apt/lists/*
EOF

# Base image
FROM rapidsai/miniforge-cuda:${RAPIDS_VER}-cuda${CUDA_VER}-base-${LINUX_VER}-py${PYTHON_VER} AS base
ARG CUDA_VER
ARG PYTHON_VER

ARG RAPIDS_VER
ARG CUDA_VER=notset
ARG PYTHON_VER=notset
ARG RAPIDS_VER=notset

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

RUN <<EOF
apt-get update
PACKAGES_TO_INSTALL=(
curl
git
wget
)
apt-get install -y --no-install-recommends \
curl \
git \
wget
"${PACKAGES_TO_INSTALL[@]}"
curl --silent --show-error -L https://github.com/rapidsai/gha-tools/releases/latest/download/tools.tar.gz | tar -xz -C /usr/local/bin
rm -rf /var/lib/apt/lists/*
EOF
Expand Down Expand Up @@ -81,13 +101,17 @@ conda config --show-sources
conda list --show-channel-urls

# Install RAPIDS
PACKAGES_TO_INSTALL=(
"rapids=${RAPIDS_VER}.*"
"python=${PYTHON_VER}.*"
"cuda-version=${CUDA_VER%.*}.*"
'ipython>=8.37.0'
'rapids-cli==0.1.*'
'openssl==3.6.0'
)
rapids-mamba-retry install -y -n base \
"rapids=${RAPIDS_VER}.*" \
"python=${PYTHON_VER}.*" \
"cuda-version=${CUDA_VER%.*}.*" \
'ipython>=8.37.0' \
'rapids-cli==0.1.*' \
'openssl==3.6.0'
"${PACKAGES_TO_INSTALL[@]}"

conda clean -afy
EOF

Expand All @@ -100,9 +124,9 @@ CMD ["ipython"]
# Notebooks image
FROM base AS notebooks

ARG CUDA_VER
ARG LINUX_DISTRO
ARG LINUX_DISTRO_VER
ARG CUDA_VER=notset
ARG LINUX_DISTRO=notset
ARG LINUX_DISTRO_VER=notset

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

Expand All @@ -120,10 +144,13 @@ conda clean -afy
EOF

RUN <<EOF
PACKAGES_TO_INSTALL=(
'jupyterlab=4'
'dask-labextension>=7.0.0'
'jupyterlab-nvdashboard>=0.13.0'
)
rapids-mamba-retry install -y -n base \
"jupyterlab=4" \
'dask-labextension>=7.0.0' \
'jupyterlab-nvdashboard>=0.13.0'
"${PACKAGES_TO_INSTALL[@]}"
conda clean -afy
EOF

Expand Down
38 changes: 38 additions & 0 deletions ci/compute-build-args.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail

# start with arguments provided by environment variables. Anything with a fallback is only used by
# a subset of images built here.
ARGS="
CPU_ARCH: ${CPU_ARCH:-notset}
CUDA_VER: ${CUDA_VER}
LINUX_DISTRO: ${LINUX_DISTRO:-notset}
LINUX_DISTRO_VER: ${LINUX_DISTRO_VER:-notset}
LINUX_VER: ${LINUX_VER}
PYTHON_VER: ${PYTHON_VER}
RAPIDS_VER: ${RAPIDS_VER}
"
export ARGS

# add in arguments parsed out of 'versions.yaml'
if [ -n "${GITHUB_ACTIONS:-}" ]; then
# on GitHub Actions, create a step output called 'DOCKER_BUILD_ARGS' with this information appended to it.
#
# That can be referenced like:
#
# - name: Build image
# uses: docker/build-push-action@v6
# with:
# build-args: |
# ${{ steps.generate-build-args.outputs.DOCKER_BUILD_ARGS }}
#
cat <<EOF > "${GITHUB_OUTPUT:-/dev/stdout}"
DOCKER_BUILD_ARGS<<EOT
$(yq -r '. + env(ARGS) | to_entries | map(.key + "=" + .value) | join(" \n")' versions.yaml)
EOT
EOF
else
yq -r '. + env(ARGS) | to_entries | map("--build-arg " + .key + "=" + .value) | join(" ")' versions.yaml
fi
22 changes: 14 additions & 8 deletions cuvs-bench/cpu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# syntax=docker/dockerfile:1
# Copyright (c) 2024-2025, NVIDIA CORPORATION.
# Copyright (c) 2024-2026, NVIDIA CORPORATION.

ARG PYTHON_VER=unset
ARG PYTHON_VER=notset
ARG RAPIDS_VER=26.02

FROM condaforge/miniforge3:24.11.3-2 AS cuvs-bench-cpu
ARG RAPIDS_VER
ARG PYTHON_VER
ARG PYTHON_VER=notset
ARG RAPIDS_VER=notset

COPY condarc /opt/conda/.condarc

Expand All @@ -24,9 +24,12 @@ EOF
# we need perl temporarily for the remaining benchmark perl scripts
RUN <<EOF
apt-get update
apt-get install -y --no-install-recommends \
perl \
PACKAGES_TO_INSTALL=(
perl
wget
)
apt-get install -y --no-install-recommends \
"${PACKAGES_TO_INSTALL[@]}"
wget --quiet https://github.com/rapidsai/gha-tools/releases/latest/download/tools.tar.gz -O - | tar -xz -C /usr/local/bin
rm -rf /var/lib/apt/lists/*
EOF
Expand All @@ -38,9 +41,12 @@ RUN <<EOF
rapids-mamba-retry update --all -y -n base
rapids-mamba-retry install -y -n base "python=${PYTHON_VER}"
rapids-mamba-retry update --all -y -n base
rapids-mamba-retry install -y -n base \
"cuvs-bench-cpu=${RAPIDS_VER}.*" \
PACKAGES_TO_INSTALL=(
"cuvs-bench-cpu=${RAPIDS_VER}.*"
"python=${PYTHON_VER}"
)
rapids-mamba-retry install -y -n base \
"${PACKAGES_TO_INSTALL[@]}"
conda clean -afy
chmod -R 777 /opt/conda
EOF
Expand Down
Loading
Loading