Skip to content

Commit d950b30

Browse files
authored
Port all conda recipes to rattler-build (#6440)
Port all condabuild recipes over to use `rattler-build` instead. Contributes to rapidsai/build-planning#47 - To satisfy `rattler-build`, this changes all the licenses in the `pyproject.toml` files to the SPDX-compliant `Apache-2.0` instead of `Apache 2.0` Authors: - Gil Forsyth (https://github.com/gforsyth) Approvers: - James Lamb (https://github.com/jameslamb) URL: #6440
1 parent 84946a9 commit d950b30

15 files changed

+451
-352
lines changed

ci/build_cpp.sh

+18-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
set -euo pipefail
55

6-
rapids-configure-conda-channels
7-
86
source rapids-configure-sccache
97

108
source rapids-date-string
@@ -17,9 +15,25 @@ rapids-logger "Begin cpp build"
1715

1816
sccache --zero-stats
1917

20-
RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry build \
21-
conda/recipes/libcuml
18+
RAPIDS_PACKAGE_VERSION=$(rapids-generate-version)
19+
export RAPIDS_PACKAGE_VERSION
20+
21+
source rapids-rattler-channel-string
22+
23+
# --no-build-id allows for caching with `sccache`
24+
# more info is available at
25+
# https://rattler.build/latest/tips_and_tricks/#using-sccache-or-ccache-with-rattler-build
26+
rattler-build build --recipe conda/recipes/libcuml \
27+
--experimental \
28+
--no-build-id \
29+
--channel-priority disabled \
30+
--output-dir "$RAPIDS_CONDA_BLD_OUTPUT_DIR" \
31+
"${RATTLER_CHANNELS[@]}"
2232

2333
sccache --show-adv-stats
2434

35+
# remove build_cache directory to avoid uploading the entire source tree
36+
# tracked in https://github.com/prefix-dev/rattler-build/issues/1424
37+
rm -rf "$RAPIDS_CONDA_BLD_OUTPUT_DIR"/build_cache
38+
2539
rapids-upload-conda-to-s3 cpp

ci/build_python.sh

+33-10
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
set -euo pipefail
55

6-
rapids-configure-conda-channels
7-
86
source rapids-configure-sccache
97

108
source rapids-date-string
@@ -19,27 +17,52 @@ rapids-logger "Begin py build"
1917

2018
CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)
2119

20+
RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION)
21+
export RAPIDS_PACKAGE_VERSION
22+
23+
# populates `RATTLER_CHANNELS` array
24+
source rapids-rattler-channel-string
25+
26+
rapids-logger "Prepending channel ${CPP_CHANNEL} to RATTLER_CHANNELS"
27+
28+
RATTLER_CHANNELS=("--channel" "${CPP_CHANNEL}" "${RATTLER_CHANNELS[@]}")
29+
2230
sccache --zero-stats
2331

24-
# TODO: Remove `--no-test` flag once importing on a CPU
25-
# node works correctly
26-
RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry build \
27-
--no-test \
28-
--channel "${CPP_CHANNEL}" \
29-
conda/recipes/cuml
32+
rapids-logger "Building cuml"
33+
34+
# --no-build-id allows for caching with `sccache`
35+
# more info is available at
36+
# https://rattler.build/latest/tips_and_tricks/#using-sccache-or-ccache-with-rattler-build
37+
rattler-build build --recipe conda/recipes/cuml \
38+
--experimental \
39+
--no-build-id \
40+
--channel-priority disabled \
41+
--output-dir "$RAPIDS_CONDA_BLD_OUTPUT_DIR" \
42+
"${RATTLER_CHANNELS[@]}"
3043

3144
sccache --show-adv-stats
3245

3346
# Build cuml-cpu only in CUDA 12 jobs since it only depends on python
3447
# version
3548
RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"
3649
if [[ ${RAPIDS_CUDA_MAJOR} == "12" ]]; then
50+
rapids-logger "Building cuml-cpu"
51+
3752
sccache --zero-stats
3853

39-
RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry build \
40-
conda/recipes/cuml-cpu
54+
rattler-build build --recipe conda/recipes/cuml-cpu \
55+
--experimental \
56+
--no-build-id \
57+
--channel-priority disabled \
58+
--output-dir "$RAPIDS_CONDA_BLD_OUTPUT_DIR" \
59+
"${RATTLER_CHANNELS[@]}"
4160

4261
sccache --show-adv-stats
4362
fi
4463

64+
# remove build_cache directory to avoid uploading the entire source tree
65+
# tracked in https://github.com/prefix-dev/rattler-build/issues/1424
66+
rm -rf "$RAPIDS_CONDA_BLD_OUTPUT_DIR"/build_cache
67+
4568
rapids-upload-conda-to-s3 python

conda/recipes/cuml-cpu/build.sh

-5
This file was deleted.

conda/recipes/cuml-cpu/meta.yaml

-51
This file was deleted.

conda/recipes/cuml-cpu/recipe.yaml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION.
2+
schema_version: 1
3+
4+
context:
5+
version: ${{ env.get("RAPIDS_PACKAGE_VERSION") }}
6+
date_string: '${{ env.get("RAPIDS_DATE_STRING") }}'
7+
py_version: ${{ env.get("RAPIDS_PY_VERSION") }}
8+
py_buildstring: ${{ py_version | version_to_buildstring }}
9+
head_rev: ${{ git.head_rev(".")[:8] }}
10+
11+
package:
12+
name: cuml-cpu
13+
version: ${{ version }}
14+
15+
source:
16+
path: ../../..
17+
18+
build:
19+
string: py${{ py_buildstring }}_${{ date_string }}_${{ head_rev }}
20+
dynamic_linking:
21+
overlinking_behavior: "error"
22+
script:
23+
content: |
24+
./build.sh cuml-cpu -v
25+
secrets:
26+
- AWS_ACCESS_KEY_ID
27+
- AWS_SECRET_ACCESS_KEY
28+
- AWS_SESSION_TOKEN
29+
env:
30+
CMAKE_C_COMPILER_LAUNCHER: ${{ env.get("CMAKE_C_COMPILER_LAUNCHER") }}
31+
CMAKE_CXX_COMPILER_LAUNCHER: ${{ env.get("CMAKE_CXX_COMPILER_LAUNCHER") }}
32+
CMAKE_GENERATOR: ${{ env.get("CMAKE_GENERATOR") }}
33+
SCCACHE_BUCKET: ${{ env.get("SCCACHE_BUCKET") }}
34+
SCCACHE_IDLE_TIMEOUT: ${{ env.get("SCCACHE_IDLE_TIMEOUT") }}
35+
SCCACHE_REGION: ${{ env.get("SCCACHE_REGION") }}
36+
SCCACHE_S3_USE_SSL: ${{ env.get("SCCACHE_S3_USE_SSL") }}
37+
SCCACHE_S3_NO_CREDENTIALS: ${{ env.get("SCCACHE_S3_NO_CREDENTIALS") }}
38+
SCCACHE_S3_KEY_PREFIX: cuml-cpu/${{ env.get("RAPIDS_CONDA_ARCH") }}
39+
40+
requirements:
41+
build:
42+
- ${{ compiler("c") }}
43+
- ${{ compiler("cxx") }}
44+
- ${{ stdlib("c") }}
45+
- cmake ${{ cmake_version }}
46+
- ninja
47+
host:
48+
- cython >=3.0.0
49+
- pip
50+
- python =${{ py_version }}
51+
- rapids-build-backend>=0.3.0,<0.4.0.dev0
52+
- scikit-build-core >=0.10.0
53+
run:
54+
- numpy >=1.23,<3.0a0
55+
- python
56+
- pandas
57+
- packaging
58+
- scikit-learn 1.5.*
59+
- hdbscan>=0.8.39,<0.8.40
60+
- umap-learn=0.5.6
61+
- nvtx
62+
ignore_run_exports:
63+
by_name:
64+
- cuda-cudart
65+
- cuda-version
66+
- if: cuda_major == "11"
67+
then: cudatoolkit
68+
69+
tests:
70+
- python:
71+
imports:
72+
- cuml
73+
pip_check: false
74+
75+
about:
76+
homepage: ${{ load_from_file("python/cuml/pyproject.toml").project.urls.Homepage }}
77+
license: ${{ load_from_file("python/cuml/pyproject.toml").project.license.text }}
78+
summary: cuML-CPU Library

conda/recipes/cuml/build.sh

-5
This file was deleted.

conda/recipes/cuml/meta.yaml

-109
This file was deleted.

0 commit comments

Comments
 (0)