Skip to content

Commit 9abea7e

Browse files
committed
refactor(conda): build conda packages with limited API
1 parent d5f1721 commit 9abea7e

7 files changed

Lines changed: 68 additions & 24 deletions

File tree

build.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,16 +469,33 @@ if (( NUMARGS == 0 )) || hasArg libcuvs || hasArg docs || hasArg tests || hasArg
469469
fi
470470
fi
471471

472+
473+
PYTHON_ARGS_FOR_INSTALL=(
474+
"-v"
475+
"--no-build-isolation"
476+
"--no-deps"
477+
"--config-settings"
478+
"rapidsai.disable-cuda=true"
479+
)
480+
481+
# If `RAPIDS_PY_VERSION` is set, use that as the lower-bound for the stable ABI CPython version
482+
if [ -n "${RAPIDS_PY_VERSION:-}" ]; then
483+
RAPIDS_PY_API="cp${RAPIDS_PY_VERSION//./}"
484+
PYTHON_ARGS_FOR_INSTALL+=("--config-settings" "skbuild.wheel.py-api=${RAPIDS_PY_API}")
485+
fi
486+
472487
# Build and (optionally) install the cuvs Python package
473488
if (( NUMARGS == 0 )) || hasArg python; then
474489
SKBUILD_CMAKE_ARGS="${EXTRA_CMAKE_ARGS[*]}" \
475490
SKBUILD_BUILD_OPTIONS="-j${PARALLEL_LEVEL}" \
476-
python -m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true "${REPODIR}"/python/cuvs
491+
python -m pip install \
492+
"${PYTHON_ARGS_FOR_INSTALL[@]}" "${REPODIR}"/python/cuvs
477493
fi
478494

479495
# Build and (optionally) install the cuvs-bench Python package
480496
if (( NUMARGS == 0 )) || (hasArg bench-ann && ! hasArg -n); then
481-
python -m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true "${REPODIR}"/python/cuvs_bench
497+
python -m pip install \
498+
"${PYTHON_ARGS_FOR_INSTALL[@]}" "${REPODIR}"/python/cuvs_bench
482499
fi
483500

484501
# Build the cuvs Rust bindings

ci/build_docs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/bash
2-
# SPDX-FileCopyrightText: Copyright (c) 2023-2025, NVIDIA CORPORATION.
2+
# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION.
33
# SPDX-License-Identifier: Apache-2.0
44

55
set -euo pipefail
66

77
rapids-logger "Downloading artifacts from previous jobs"
88
CPP_CHANNEL=$(rapids-download-conda-from-github cpp)
9-
PYTHON_CHANNEL=$(rapids-download-conda-from-github python)
9+
PYTHON_CHANNEL=$(rapids-download-from-github "$(rapids-package-name "conda_python" cuvs --stable --cuda "$RAPIDS_CUDA_VERSION")")
1010

1111
rapids-logger "Create test conda environment"
1212
. /opt/conda/etc/profile.d/conda.sh

ci/build_python.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION.
2+
# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION.
33
# SPDX-License-Identifier: Apache-2.0
44

55
set -euo pipefail
@@ -58,3 +58,6 @@ if [[ ${RAPIDS_CUDA_MAJOR} == "13" ]]; then
5858
sccache --show-adv-stats
5959
sccache --stop-server >/dev/null 2>&1 || true
6060
fi
61+
62+
RAPIDS_PACKAGE_NAME="$(rapids-package-name conda_python cuvs --stable --cuda "$RAPIDS_CUDA_VERSION")"
63+
export RAPIDS_PACKAGE_NAME

ci/test_python.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION.
2+
# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION.
33
# SPDX-License-Identifier: Apache-2.0
44

55
set -euo pipefail
@@ -11,7 +11,7 @@ conda config --set channel_priority strict
1111

1212
rapids-logger "Downloading artifacts from previous jobs"
1313
CPP_CHANNEL=$(rapids-download-conda-from-github cpp)
14-
PYTHON_CHANNEL=$(rapids-download-conda-from-github python)
14+
PYTHON_CHANNEL=$(rapids-download-from-github "$(rapids-package-name "conda_python" cuvs --stable --cuda "$RAPIDS_CUDA_VERSION")")
1515

1616
rapids-logger "Generate Python testing dependencies"
1717
rapids-dependency-file-generator \

conda/recipes/cuvs-bench-cpu/recipe.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
22
# SPDX-License-Identifier: Apache-2.0
33
schema_version: 1
44

55
context:
66
version: ${{ env.get("RAPIDS_PACKAGE_VERSION") }}
77
date_string: '${{ env.get("RAPIDS_DATE_STRING") }}'
8-
py_version: ${{ env.get("RAPIDS_PY_VERSION") }}
9-
py_buildstring: ${{ py_version | version_to_buildstring }}
108
head_rev: '${{ git.head_rev(".")[:8] }}'
119
linux64: ${{ linux and x86_64 }}
10+
py_abi_min: ${{ env.get("RAPIDS_PY_VERSION") }}
11+
py_buildstring : ${{ py_abi_min | version_to_buildstring }}
12+
py_runtime_latest: "3.13"
1213

1314
package:
1415
name: cuvs-bench-cpu
@@ -18,7 +19,9 @@ source:
1819
path: ../../..
1920

2021
build:
21-
string: py${{ py_buildstring }}_${{ date_string }}_${{ head_rev }}
22+
python:
23+
version_independent: true
24+
string: cp${{ py_buildstring }}_abi3_${{ date_string }}_${{ head_rev }}
2225
script:
2326
content: |
2427
@@ -45,6 +48,7 @@ build:
4548
NVCC_APPEND_FLAGS: ${{ env.get("NVCC_APPEND_FLAGS", default="") }}
4649
PARALLEL_LEVEL: ${{ env.get("PARALLEL_LEVEL", default="8") }}
4750
RAPIDS_ARTIFACTS_DIR: ${{ env.get("RAPIDS_ARTIFACTS_DIR", default="") }}
51+
RAPIDS_PY_VERSION: ${{ py_abi_min }}
4852
SCCACHE_BUCKET: ${{ env.get("SCCACHE_BUCKET", default="") }}
4953
SCCACHE_DIST_AUTH_TYPE: ${{ env.get("SCCACHE_DIST_AUTH_TYPE", default="token") }}
5054
SCCACHE_DIST_FALLBACK_TO_LOCAL_COMPILE: ${{ env.get("SCCACHE_DIST_FALLBACK_TO_LOCAL_COMPILE", default="false") }}
@@ -75,7 +79,8 @@ requirements:
7579
- nlohmann_json ${{ nlohmann_json_version }}
7680
- openblas
7781
- pip
78-
- python =${{ py_version }}
82+
- python =${{ py_abi_min }}
83+
- python-abi3 ${{ py_abi_min }}.*
7984
- rapids-build-backend>=0.4.0,<0.5.0
8085
- setuptools>=77.0.0
8186
- if: linux64
@@ -114,6 +119,7 @@ tests:
114119
- cuvs_bench.plot
115120
- cuvs_bench.run
116121
- cuvs_bench.split_groundtruth
122+
python_version: ${{ py_runtime_latest }}.*
117123
pip_check: false
118124

119125
about:

conda/recipes/cuvs-bench/recipe.yaml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
22
# SPDX-License-Identifier: Apache-2.0
33
schema_version: 1
44

@@ -8,10 +8,10 @@ context:
88
cuda_version: ${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[:2] | join(".") }}
99
cuda_major: '${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[0] }}'
1010
date_string: '${{ env.get("RAPIDS_DATE_STRING") }}'
11-
py_version: ${{ env.get("RAPIDS_PY_VERSION") }}
12-
py_buildstring: ${{ py_version | version_to_buildstring }}
1311
head_rev: '${{ git.head_rev(".")[:8] }}'
14-
linux64: ${{ linux and x86_64 }}
12+
py_abi_min: ${{ env.get("RAPIDS_PY_VERSION") }}
13+
py_buildstring : ${{ py_abi_min | version_to_buildstring }}
14+
py_runtime_latest: "3.13"
1515

1616
package:
1717
name: cuvs-bench
@@ -21,7 +21,9 @@ source:
2121
path: ../../..
2222

2323
build:
24-
string: cuda${{ cuda_major }}_py${{ py_buildstring }}_${{ date_string }}_${{ head_rev }}
24+
python:
25+
version_independent: true
26+
string: cuda${{ cuda_major }}_cp{{ py_buildstring }}_abi3_${{ date_string }}_${{ head_rev }}
2527
script:
2628
content: |
2729
python -m pip install --no-build-isolation --no-deps --config-settings rapidsai.disable-cuda=true ./python/cuvs_bench
@@ -31,7 +33,8 @@ requirements:
3133
- cuda-version =${{ cuda_version }}
3234
- libcuvs =${{ version }}
3335
- libcuvs-bench-ann =${{ version }}
34-
- python =${{ py_version }}
36+
- python =${{ py_abi_min }}
37+
- python-abi3 ${{ py_abi_min }}.*
3538
- pip
3639
- rapids-build-backend >=0.4.0,<0.5.0
3740
- rmm =${{ minor_version }}
@@ -60,6 +63,16 @@ tests:
6063
- package_contents:
6164
files:
6265
- lib/python*/site-packages/cuvs_bench/config/datasets/datasets.yaml
66+
- python:
67+
imports:
68+
- cuvs_bench
69+
- cuvs_bench.generate_groundtruth
70+
- cuvs_bench.get_dataset
71+
- cuvs_bench.plot
72+
- cuvs_bench.run
73+
- cuvs_bench.split_groundtruth
74+
python_version: ${{ py_runtime_latest }}.*
75+
pip_check: false
6376

6477
about:
6578
homepage: ${{ load_from_file("python/cuvs_bench/pyproject.toml").project.urls.Homepage }}

conda/recipes/cuvs/recipe.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
22
# SPDX-License-Identifier: Apache-2.0
33
schema_version: 1
44

@@ -8,9 +8,9 @@ context:
88
cuda_version: ${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[:2] | join(".") }}
99
cuda_major: '${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[0] }}'
1010
date_string: '${{ env.get("RAPIDS_DATE_STRING") }}'
11-
py_version: ${{ env.get("RAPIDS_PY_VERSION") }}
12-
py_buildstring: ${{ py_version | version_to_buildstring }}
13-
head_rev: '${{ git.head_rev(".")[:8] }}'
11+
py_abi_min: ${{ env.get("RAPIDS_PY_VERSION") }}
12+
py_buildstring : ${{ py_abi_min | version_to_buildstring }}
13+
py_runtime_latest: "3.13"
1414

1515
package:
1616
name: cuvs
@@ -20,7 +20,9 @@ source:
2020
path: ../../..
2121

2222
build:
23-
string: cuda${{ cuda_major }}_py${{ py_buildstring }}_${{ date_string }}_${{ head_rev }}
23+
python:
24+
version_independent: true
25+
string: cuda${{ cuda_major }}_cp{{ py_buildstring }}_abi3_${{ date_string }}_${{ head_rev }}
2426
script:
2527
content: |
2628
./build.sh python --no-nvtx -v
@@ -37,6 +39,7 @@ build:
3739
NVCC_APPEND_FLAGS: ${{ env.get("NVCC_APPEND_FLAGS", default="") }}
3840
PARALLEL_LEVEL: ${{ env.get("PARALLEL_LEVEL", default="8") }}
3941
RAPIDS_ARTIFACTS_DIR: ${{ env.get("RAPIDS_ARTIFACTS_DIR", default="") }}
42+
RAPIDS_PY_VERSION: ${{ env.get("RAPIDS_PY_VERSION") }}
4043
SCCACHE_BUCKET: ${{ env.get("SCCACHE_BUCKET", default="") }}
4144
SCCACHE_DIST_AUTH_TYPE: ${{ env.get("SCCACHE_DIST_AUTH_TYPE", default="token") }}
4245
SCCACHE_DIST_FALLBACK_TO_LOCAL_COMPILE: ${{ env.get("SCCACHE_DIST_FALLBACK_TO_LOCAL_COMPILE", default="false") }}
@@ -71,7 +74,8 @@ requirements:
7174
- libcuvs =${{ version }}
7275
- pip
7376
- pylibraft =${{ minor_version }}
74-
- python =${{ py_version }}
77+
- python =${{ py_abi_min }}
78+
- python-abi3 ${{ py_abi_min }}.*
7579
- rapids-build-backend >=0.4.0,<0.5.0
7680
- scikit-build-core>=0.11.0
7781
- if: cuda_major == "12"
@@ -97,6 +101,7 @@ tests:
97101
- python:
98102
imports:
99103
- cuvs
104+
python_version: ${{ py_runtime_latest }}.*
100105
pip_check: false
101106

102107
about:

0 commit comments

Comments
 (0)