From f68817dcc2dbdff667f9035063e923349f4270d9 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 16 Oct 2024 11:57:34 -0500 Subject: [PATCH 1/9] reduce duplication in wheel-building scripts --- ci/build_wheel.sh | 60 +++++++++++++++++++----------- ci/build_wheel_distributed_ucxx.sh | 2 +- ci/build_wheel_libucxx.sh | 4 +- ci/build_wheel_ucxx.sh | 13 ++++++- 4 files changed, 54 insertions(+), 25 deletions(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 2d690d02..c6d0da20 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -5,6 +5,28 @@ set -euo pipefail package_name=$1 package_dir=$2 +package_type=$3 + +# The list of shared libraries to exclude from wheels varies by project. +# +# Capturing that here in argument-parsing to allow this build_wheel.sh +# script to be re-used by all wheel builds in the project. +case "${package_dir}" in + python/libucxx) + EXCLUDE_ARGS=( + --exclude "libucp.so.0" + ) + ;; + python/ucxx) + EXCLUDE_ARGS=( + --exclude "libucp.so.0" + --exclude "libucxx.so" + ) + ;; + *) + EXCLUDE_ARGS=() + ;; +esac source rapids-configure-sccache source rapids-date-string @@ -13,29 +35,23 @@ RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" rapids-generate-version > ./VERSION -if [[ ${package_name} == "distributed-ucxx" ]]; then - python -m pip wheel "${package_dir}/" -w "${package_dir}/dist" -vvv --no-deps --disable-pip-version-check +cd "${package_dir}" - RAPIDS_PY_WHEEL_NAME="distributed_ucxx_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python ${package_dir}/dist -elif [[ ${package_name} == "libucxx" ]]; then - SKBUILD_CMAKE_ARGS="-DUCXX_ENABLE_RMM=ON" \ - python -m pip wheel "${package_dir}"/ -w "${package_dir}"/dist -vvv --no-deps --disable-pip-version-check +rapids-logger "Building '${package_name}' wheel" +python -m pip wheel \ + -w dist \ + -v \ + --no-build-isolation \ + --no-deps \ + --disable-pip-version-check \ + . - python -m auditwheel repair -w ${package_dir}/final_dist --exclude "libucp.so.0" ${package_dir}/dist/* +sccache --show-adv-stats - RAPIDS_PY_WHEEL_NAME="libucxx_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 cpp ${package_dir}/final_dist -elif [[ ${package_name} == "ucxx" ]]; then - CPP_WHEELHOUSE=$(RAPIDS_PY_WHEEL_NAME="libucxx_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 cpp /tmp/libucxx_dist) - echo "libucxx-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo ${CPP_WHEELHOUSE}/libucxx_*.whl)" > "${package_dir}/constraints.txt" +mkdir -p final_dist +python -m auditwheel repair \ + "${EXCLUDE_ARGS[@]}" \ + -w final_dist \ + dist/* - PIP_CONSTRAINT="${package_dir}/constraints.txt" \ - SKBUILD_CMAKE_ARGS="-DFIND_UCXX_CPP=ON;-DCMAKE_INSTALL_LIBDIR=ucxx/lib64;-DCMAKE_INSTALL_INCLUDEDIR=ucxx/include" \ - python -m pip wheel "${package_dir}"/ -w "${package_dir}"/dist -vvv --no-deps --disable-pip-version-check - - python -m auditwheel repair -w ${package_dir}/final_dist --exclude "libucp.so.0" --exclude "libucxx.so" ${package_dir}/dist/* - - RAPIDS_PY_WHEEL_NAME="ucxx_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python ${package_dir}/final_dist -else - echo "Unknown package '${package_name}'" - exit 1 -fi +RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 "${package_type}" final_dist diff --git a/ci/build_wheel_distributed_ucxx.sh b/ci/build_wheel_distributed_ucxx.sh index 77c2d988..2acf7e3b 100755 --- a/ci/build_wheel_distributed_ucxx.sh +++ b/ci/build_wheel_distributed_ucxx.sh @@ -5,4 +5,4 @@ set -euo pipefail package_dir="python/distributed-ucxx" -./ci/build_wheel.sh distributed-ucxx ${package_dir} +./ci/build_wheel.sh distributed-ucxx "${package_dir}" python diff --git a/ci/build_wheel_libucxx.sh b/ci/build_wheel_libucxx.sh index c5798f2f..a7d50557 100755 --- a/ci/build_wheel_libucxx.sh +++ b/ci/build_wheel_libucxx.sh @@ -5,4 +5,6 @@ set -euo pipefail package_dir="python/libucxx" -./ci/build_wheel.sh libucxx ${package_dir} +export SKBUILD_CMAKE_ARGS="-DUCXX_ENABLE_RMM=ON" + +./ci/build_wheel.sh libucxx "${package_dir}" cpp diff --git a/ci/build_wheel_ucxx.sh b/ci/build_wheel_ucxx.sh index 04897ffe..c8b9864e 100755 --- a/ci/build_wheel_ucxx.sh +++ b/ci/build_wheel_ucxx.sh @@ -5,4 +5,15 @@ set -euo pipefail package_dir="python/ucxx" -./ci/build_wheel.sh ucxx ${package_dir} +# Downloads libucxx wheel from this current build, +# then ensures 'ucxx' wheel builds always use the 'libucxx' just built in the same CI run. +# +# Using env variable PIP_CONSTRAINT is necessary to ensure the constraints +# are used when creating the isolated build environment. +RAPIDS_PY_WHEEL_NAME="libucxx_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 cpp /tmp/libucxx_dist +echo "libcuspatial-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo /tmp/libucxx_dist/libucxx_*.whl)" > /tmp/constraints.txt +export PIP_CONSTRAINT="/tmp/constraints.txt" + +export SKBUILD_CMAKE_ARGS="-DFIND_UCXX_CPP=ON;-DCMAKE_INSTALL_LIBDIR=ucxx/lib64;-DCMAKE_INSTALL_INCLUDEDIR=ucxx/include" + +./ci/build_wheel.sh ucxx "${package_dir}" python From bc3fe6023a4d31262a3f3b60cf5313c548822a36 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 16 Oct 2024 12:00:42 -0500 Subject: [PATCH 2/9] build without build isolation --- ci/build_wheel.sh | 22 ++++++++++++++++++++++ dependencies.yaml | 7 +++++++ python/distributed-ucxx/pyproject.toml | 2 ++ 3 files changed, 31 insertions(+) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index c6d0da20..f98b398b 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -6,6 +6,7 @@ set -euo pipefail package_name=$1 package_dir=$2 package_type=$3 +underscore_package_name=$(echo "${package_name}" | tr "-" "_") # The list of shared libraries to exclude from wheels varies by project. # @@ -33,6 +34,27 @@ source rapids-date-string RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" +rapids-logger "Generating build requirements" +matrix_selectors="cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};cuda_suffixed=true" + +rapids-dependency-file-generator \ + --output requirements \ + --file-key "py_build_${underscore_package_name}" \ + --matrix "${matrix_selectors}" \ +| tee /tmp/requirements-build.txt + +rapids-dependency-file-generator \ + --output requirements \ + --file-key "py_rapids_build_${underscore_package_name}" \ + --matrix "${matrix_selectors}" \ +| tee -a /tmp/requirements-build.txt + +rapids-logger "Installing build requirements" +python -m pip install \ + -v \ + --prefer-binary \ + -r /tmp/requirements-build.txt + rapids-generate-version > ./VERSION cd "${package_dir}" diff --git a/dependencies.yaml b/dependencies.yaml index fc7d0703..a6b3fa0e 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -124,6 +124,13 @@ files: table: build-system includes: - rapids_build_setuptools + py_rapids_build_distributed_ucxx: + output: pyproject + pyproject_dir: python/distributed-ucxx + extras: + table: tool.rapids-build-backend + key: requires + includes: [] py_run_distributed_ucxx: output: pyproject pyproject_dir: python/distributed-ucxx diff --git a/python/distributed-ucxx/pyproject.toml b/python/distributed-ucxx/pyproject.toml index 1005df8d..413a3a47 100644 --- a/python/distributed-ucxx/pyproject.toml +++ b/python/distributed-ucxx/pyproject.toml @@ -118,6 +118,8 @@ exclude = [ build-backend = "setuptools.build_meta" dependencies-file = "../../dependencies.yaml" matrix-entry = "cuda_suffixed=true" +requires = [ +] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. [tool.setuptools.package-data] "distributed_ucxx" = ["VERSION"] From 22cb5bc2d2dd1bc6c89a11fb380e1b7eb491e18e Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 16 Oct 2024 12:01:47 -0500 Subject: [PATCH 3/9] only run wheel builds --- .github/workflows/pr.yaml | 91 --------------------------------------- 1 file changed, 91 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 99b6fc42..a35fb06e 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -12,87 +12,15 @@ concurrency: jobs: pr-builder: needs: - - changed-files - - checks - - conda-cpp-build - - docs-build - - conda-cpp-tests - - conda-python-tests - - conda-python-distributed-tests - wheel-build-libucxx - wheel-build-ucxx - - wheel-tests-ucxx - wheel-build-distributed-ucxx - - wheel-tests-distributed-ucxx secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.12 if: always() with: needs: ${{ toJSON(needs) }} - changed-files: - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/changed-files.yaml@branch-24.12 - with: - files_yaml: | - test_cpp: - - '**' - - '!.pre-commit-config.yaml' - - '!README.md' - - '!docs/**' - - '!python/**' - test_python: - - '**' - - '!.pre-commit-config.yaml' - - '!README.md' - - '!docs/**' - checks: - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.12 - with: - enable_check_generated_files: false - conda-cpp-build: - needs: checks - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.12 - with: - build_type: pull-request - docs-build: - needs: conda-cpp-build - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 - with: - build_type: pull-request - node_type: "gpu-v100-latest-1" - arch: "amd64" - container_image: "rapidsai/ci-conda:latest" - run_script: "ci/build_docs.sh" - conda-cpp-tests: - needs: [conda-cpp-build, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp - with: - build_type: pull-request - container-options: "--cap-add CAP_SYS_PTRACE --shm-size=8g --ulimit=nofile=1000000:1000000" - conda-python-tests: - needs: [conda-cpp-build, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python - with: - build_type: pull-request - container-options: "--cap-add CAP_SYS_PTRACE --shm-size=8g --ulimit=nofile=1000000:1000000" - conda-python-distributed-tests: - needs: [conda-cpp-build, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python - with: - build_type: pull-request - script: "ci/test_python_distributed.sh" - container-options: "--cap-add CAP_SYS_PTRACE --shm-size=8g --ulimit=nofile=1000000:1000000" wheel-build-libucxx: - needs: checks secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12 with: @@ -105,28 +33,9 @@ jobs: with: build_type: pull-request script: ci/build_wheel_ucxx.sh - wheel-tests-ucxx: - needs: [wheel-build-ucxx, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python - with: - build_type: pull-request - container-options: "--cap-add CAP_SYS_PTRACE --shm-size=8g --ulimit=nofile=1000000:1000000" - script: ci/test_wheel_ucxx.sh wheel-build-distributed-ucxx: - needs: checks secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12 with: build_type: pull-request script: ci/build_wheel_distributed_ucxx.sh - wheel-tests-distributed-ucxx: - needs: [wheel-build-ucxx, wheel-build-distributed-ucxx, changed-files] - secrets: inherit - uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12 - if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python - with: - build_type: pull-request - container-options: "--cap-add CAP_SYS_PTRACE --shm-size=8g --ulimit=nofile=1000000:1000000" - script: ci/test_wheel_distributed_ucxx.sh From ae8e699da41720b044eef25a8011d1bbb5dd54ce Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 16 Oct 2024 12:03:52 -0500 Subject: [PATCH 4/9] libucxx (typo) --- ci/build_wheel_ucxx.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build_wheel_ucxx.sh b/ci/build_wheel_ucxx.sh index c8b9864e..532350b4 100755 --- a/ci/build_wheel_ucxx.sh +++ b/ci/build_wheel_ucxx.sh @@ -11,7 +11,7 @@ package_dir="python/ucxx" # Using env variable PIP_CONSTRAINT is necessary to ensure the constraints # are used when creating the isolated build environment. RAPIDS_PY_WHEEL_NAME="libucxx_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 cpp /tmp/libucxx_dist -echo "libcuspatial-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo /tmp/libucxx_dist/libucxx_*.whl)" > /tmp/constraints.txt +echo "libucxx-${RAPIDS_PY_CUDA_SUFFIX} @ file://$(echo /tmp/libucxx_dist/libucxx_*.whl)" > /tmp/constraints.txt export PIP_CONSTRAINT="/tmp/constraints.txt" export SKBUILD_CMAKE_ARGS="-DFIND_UCXX_CPP=ON;-DCMAKE_INSTALL_LIBDIR=ucxx/lib64;-DCMAKE_INSTALL_INCLUDEDIR=ucxx/include" From b405de564be3c101670c75d7a599cc9865073914 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Wed, 16 Oct 2024 12:16:34 -0500 Subject: [PATCH 5/9] add RAPIDS_PY_CUDA_SUFFIX --- ci/build_wheel_ucxx.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/build_wheel_ucxx.sh b/ci/build_wheel_ucxx.sh index 532350b4..9aa3e53d 100755 --- a/ci/build_wheel_ucxx.sh +++ b/ci/build_wheel_ucxx.sh @@ -5,6 +5,8 @@ set -euo pipefail package_dir="python/ucxx" +RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" + # Downloads libucxx wheel from this current build, # then ensures 'ucxx' wheel builds always use the 'libucxx' just built in the same CI run. # From f165b9f11785d07aa4ede597ce0e306134b67c6c Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 28 Oct 2024 15:43:14 -0500 Subject: [PATCH 6/9] update to new patterns --- .github/workflows/pr.yaml | 91 ++++++++++++++++++++++++++ .pre-commit-config.yaml | 2 +- ci/build_cpp.sh | 4 ++ ci/build_wheel.sh | 24 +------ ci/build_wheel_libucxx.sh | 22 ++++++- dependencies.yaml | 7 -- python/distributed-ucxx/pyproject.toml | 2 - 7 files changed, 119 insertions(+), 33 deletions(-) diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index a35fb06e..99b6fc42 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -12,15 +12,87 @@ concurrency: jobs: pr-builder: needs: + - changed-files + - checks + - conda-cpp-build + - docs-build + - conda-cpp-tests + - conda-python-tests + - conda-python-distributed-tests - wheel-build-libucxx - wheel-build-ucxx + - wheel-tests-ucxx - wheel-build-distributed-ucxx + - wheel-tests-distributed-ucxx secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.12 if: always() with: needs: ${{ toJSON(needs) }} + changed-files: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/changed-files.yaml@branch-24.12 + with: + files_yaml: | + test_cpp: + - '**' + - '!.pre-commit-config.yaml' + - '!README.md' + - '!docs/**' + - '!python/**' + test_python: + - '**' + - '!.pre-commit-config.yaml' + - '!README.md' + - '!docs/**' + checks: + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.12 + with: + enable_check_generated_files: false + conda-cpp-build: + needs: checks + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.12 + with: + build_type: pull-request + docs-build: + needs: conda-cpp-build + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.12 + with: + build_type: pull-request + node_type: "gpu-v100-latest-1" + arch: "amd64" + container_image: "rapidsai/ci-conda:latest" + run_script: "ci/build_docs.sh" + conda-cpp-tests: + needs: [conda-cpp-build, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_cpp + with: + build_type: pull-request + container-options: "--cap-add CAP_SYS_PTRACE --shm-size=8g --ulimit=nofile=1000000:1000000" + conda-python-tests: + needs: [conda-cpp-build, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python + with: + build_type: pull-request + container-options: "--cap-add CAP_SYS_PTRACE --shm-size=8g --ulimit=nofile=1000000:1000000" + conda-python-distributed-tests: + needs: [conda-cpp-build, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python + with: + build_type: pull-request + script: "ci/test_python_distributed.sh" + container-options: "--cap-add CAP_SYS_PTRACE --shm-size=8g --ulimit=nofile=1000000:1000000" wheel-build-libucxx: + needs: checks secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12 with: @@ -33,9 +105,28 @@ jobs: with: build_type: pull-request script: ci/build_wheel_ucxx.sh + wheel-tests-ucxx: + needs: [wheel-build-ucxx, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python + with: + build_type: pull-request + container-options: "--cap-add CAP_SYS_PTRACE --shm-size=8g --ulimit=nofile=1000000:1000000" + script: ci/test_wheel_ucxx.sh wheel-build-distributed-ucxx: + needs: checks secrets: inherit uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.12 with: build_type: pull-request script: ci/build_wheel_distributed_ucxx.sh + wheel-tests-distributed-ucxx: + needs: [wheel-build-ucxx, wheel-build-distributed-ucxx, changed-files] + secrets: inherit + uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.12 + if: fromJSON(needs.changed-files.outputs.changed_file_groups).test_python + with: + build_type: pull-request + container-options: "--cap-add CAP_SYS_PTRACE --shm-size=8g --ulimit=nofile=1000000:1000000" + script: ci/test_wheel_distributed_ucxx.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9e99aa12..89546be1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,7 +49,7 @@ repos: - --fix - --rapids-version=24.12 - repo: https://github.com/rapidsai/dependency-file-generator - rev: v1.13.11 + rev: v1.16.0 hooks: - id: rapids-dependency-file-generator args: ["--clean"] diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 03d4449b..98410678 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -17,7 +17,11 @@ rapids-print-env rapids-logger "Begin C++ and Python builds" +sccache --zero-stats + rapids-conda-retry mambabuild \ conda/recipes/ucxx +sccache --show-adv-stats + rapids-upload-conda-to-s3 cpp diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index f98b398b..fb50afd2 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -34,36 +34,16 @@ source rapids-date-string RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" -rapids-logger "Generating build requirements" -matrix_selectors="cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};cuda_suffixed=true" - -rapids-dependency-file-generator \ - --output requirements \ - --file-key "py_build_${underscore_package_name}" \ - --matrix "${matrix_selectors}" \ -| tee /tmp/requirements-build.txt - -rapids-dependency-file-generator \ - --output requirements \ - --file-key "py_rapids_build_${underscore_package_name}" \ - --matrix "${matrix_selectors}" \ -| tee -a /tmp/requirements-build.txt - -rapids-logger "Installing build requirements" -python -m pip install \ - -v \ - --prefer-binary \ - -r /tmp/requirements-build.txt - rapids-generate-version > ./VERSION cd "${package_dir}" +sccache --zero-stats + rapids-logger "Building '${package_name}' wheel" python -m pip wheel \ -w dist \ -v \ - --no-build-isolation \ --no-deps \ --disable-pip-version-check \ . diff --git a/ci/build_wheel_libucxx.sh b/ci/build_wheel_libucxx.sh index a7d50557..199fbb75 100755 --- a/ci/build_wheel_libucxx.sh +++ b/ci/build_wheel_libucxx.sh @@ -3,8 +3,28 @@ set -euo pipefail +package_name="libucxx" package_dir="python/libucxx" +rapids-logger "Generating build requirements" + +rapids-dependency-file-generator \ + --output requirements \ + --file-key "py_build_${package_name}" \ + --file-key "py_rapids_build_${package_name}" \ + --matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};cuda_suffixed=true" \ +| tee /tmp/requirements-build.txt + +rapids-logger "Installing build requirements" +python -m pip install \ + -v \ + --prefer-binary \ + -r /tmp/requirements-build.txt + +# build with '--no-build-isolation', for better sccache hit rate +# 0 really means "add --no-build-isolation" (ref: https://github.com/pypa/pip/issues/5735) +export PIP_NO_BUILD_ISOLATION=0 + export SKBUILD_CMAKE_ARGS="-DUCXX_ENABLE_RMM=ON" -./ci/build_wheel.sh libucxx "${package_dir}" cpp +./ci/build_wheel.sh "${package_name}" "${package_dir}" cpp diff --git a/dependencies.yaml b/dependencies.yaml index a6b3fa0e..fc7d0703 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -124,13 +124,6 @@ files: table: build-system includes: - rapids_build_setuptools - py_rapids_build_distributed_ucxx: - output: pyproject - pyproject_dir: python/distributed-ucxx - extras: - table: tool.rapids-build-backend - key: requires - includes: [] py_run_distributed_ucxx: output: pyproject pyproject_dir: python/distributed-ucxx diff --git a/python/distributed-ucxx/pyproject.toml b/python/distributed-ucxx/pyproject.toml index 413a3a47..1005df8d 100644 --- a/python/distributed-ucxx/pyproject.toml +++ b/python/distributed-ucxx/pyproject.toml @@ -118,8 +118,6 @@ exclude = [ build-backend = "setuptools.build_meta" dependencies-file = "../../dependencies.yaml" matrix-entry = "cuda_suffixed=true" -requires = [ -] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`. [tool.setuptools.package-data] "distributed_ucxx" = ["VERSION"] From 2219b8ce25eb8150d1b3079ea2c8e2b42ee9223e Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 29 Oct 2024 09:17:48 -0500 Subject: [PATCH 7/9] do not run auditwheel repair on distributed-ucxx --- ci/build_wheel.sh | 31 ------------------------------ ci/build_wheel_distributed_ucxx.sh | 4 +++- ci/build_wheel_libucxx.sh | 10 +++++++++- ci/build_wheel_ucxx.sh | 11 ++++++++++- 4 files changed, 22 insertions(+), 34 deletions(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index fb50afd2..8e616680 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -5,29 +5,6 @@ set -euo pipefail package_name=$1 package_dir=$2 -package_type=$3 -underscore_package_name=$(echo "${package_name}" | tr "-" "_") - -# The list of shared libraries to exclude from wheels varies by project. -# -# Capturing that here in argument-parsing to allow this build_wheel.sh -# script to be re-used by all wheel builds in the project. -case "${package_dir}" in - python/libucxx) - EXCLUDE_ARGS=( - --exclude "libucp.so.0" - ) - ;; - python/ucxx) - EXCLUDE_ARGS=( - --exclude "libucp.so.0" - --exclude "libucxx.so" - ) - ;; - *) - EXCLUDE_ARGS=() - ;; -esac source rapids-configure-sccache source rapids-date-string @@ -49,11 +26,3 @@ python -m pip wheel \ . sccache --show-adv-stats - -mkdir -p final_dist -python -m auditwheel repair \ - "${EXCLUDE_ARGS[@]}" \ - -w final_dist \ - dist/* - -RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 "${package_type}" final_dist diff --git a/ci/build_wheel_distributed_ucxx.sh b/ci/build_wheel_distributed_ucxx.sh index 2acf7e3b..cb0ba6ad 100755 --- a/ci/build_wheel_distributed_ucxx.sh +++ b/ci/build_wheel_distributed_ucxx.sh @@ -5,4 +5,6 @@ set -euo pipefail package_dir="python/distributed-ucxx" -./ci/build_wheel.sh distributed-ucxx "${package_dir}" python +./ci/build_wheel.sh distributed-ucxx "${package_dir}" + +RAPIDS_PY_WHEEL_NAME="distributed_ucxx_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python "${package_dir}/dist" diff --git a/ci/build_wheel_libucxx.sh b/ci/build_wheel_libucxx.sh index 199fbb75..e6415b18 100755 --- a/ci/build_wheel_libucxx.sh +++ b/ci/build_wheel_libucxx.sh @@ -27,4 +27,12 @@ export PIP_NO_BUILD_ISOLATION=0 export SKBUILD_CMAKE_ARGS="-DUCXX_ENABLE_RMM=ON" -./ci/build_wheel.sh "${package_name}" "${package_dir}" cpp +./ci/build_wheel.sh "${package_name}" "${package_dir}" + +mkdir -p "${package_dir}/final_dist" +python -m auditwheel repair \ + --exclude "libucp.so.0" \ + -w "${package_dir}/final_dist" \ + ${package_dir}/dist/* + +RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 cpp "${package_dir}/final_dist" diff --git a/ci/build_wheel_ucxx.sh b/ci/build_wheel_ucxx.sh index 9aa3e53d..57743533 100755 --- a/ci/build_wheel_ucxx.sh +++ b/ci/build_wheel_ucxx.sh @@ -18,4 +18,13 @@ export PIP_CONSTRAINT="/tmp/constraints.txt" export SKBUILD_CMAKE_ARGS="-DFIND_UCXX_CPP=ON;-DCMAKE_INSTALL_LIBDIR=ucxx/lib64;-DCMAKE_INSTALL_INCLUDEDIR=ucxx/include" -./ci/build_wheel.sh ucxx "${package_dir}" python +./ci/build_wheel.sh ucxx "${package_dir}" + +mkdir -p "${package_dir}/final_dist" +python -m auditwheel repair \ + --exclude "libucp.so.0" \ + --exclude "libucxx.so" \ + -w "${package_dir}/final_dist" \ + ${package_dir}/dist/* + +RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python "${package_dir}/final_dist" From 3f6860519939f245e0658f0b44a319bf09c4a5bd Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 29 Oct 2024 10:25:07 -0500 Subject: [PATCH 8/9] missing variable --- ci/build_wheel.sh | 2 -- ci/build_wheel_distributed_ucxx.sh | 2 ++ ci/build_wheel_libucxx.sh | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ci/build_wheel.sh b/ci/build_wheel.sh index 8e616680..b1ede832 100755 --- a/ci/build_wheel.sh +++ b/ci/build_wheel.sh @@ -9,8 +9,6 @@ package_dir=$2 source rapids-configure-sccache source rapids-date-string -RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" - rapids-generate-version > ./VERSION cd "${package_dir}" diff --git a/ci/build_wheel_distributed_ucxx.sh b/ci/build_wheel_distributed_ucxx.sh index cb0ba6ad..f6ee95a7 100755 --- a/ci/build_wheel_distributed_ucxx.sh +++ b/ci/build_wheel_distributed_ucxx.sh @@ -5,6 +5,8 @@ set -euo pipefail package_dir="python/distributed-ucxx" +RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" + ./ci/build_wheel.sh distributed-ucxx "${package_dir}" RAPIDS_PY_WHEEL_NAME="distributed_ucxx_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 python "${package_dir}/dist" diff --git a/ci/build_wheel_libucxx.sh b/ci/build_wheel_libucxx.sh index e6415b18..e9262077 100755 --- a/ci/build_wheel_libucxx.sh +++ b/ci/build_wheel_libucxx.sh @@ -6,6 +6,8 @@ set -euo pipefail package_name="libucxx" package_dir="python/libucxx" +RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" + rapids-logger "Generating build requirements" rapids-dependency-file-generator \ From 74695eb3294f014951382f8fcaec7cc5d7b7dcf1 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Tue, 29 Oct 2024 11:00:12 -0500 Subject: [PATCH 9/9] more variable fixes --- ci/build_wheel_ucxx.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/build_wheel_ucxx.sh b/ci/build_wheel_ucxx.sh index 57743533..78602085 100755 --- a/ci/build_wheel_ucxx.sh +++ b/ci/build_wheel_ucxx.sh @@ -3,6 +3,7 @@ set -euo pipefail +package_name="ucxx" package_dir="python/ucxx" RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" @@ -18,7 +19,7 @@ export PIP_CONSTRAINT="/tmp/constraints.txt" export SKBUILD_CMAKE_ARGS="-DFIND_UCXX_CPP=ON;-DCMAKE_INSTALL_LIBDIR=ucxx/lib64;-DCMAKE_INSTALL_INCLUDEDIR=ucxx/include" -./ci/build_wheel.sh ucxx "${package_dir}" +./ci/build_wheel.sh "${package_name}" "${package_dir}" mkdir -p "${package_dir}/final_dist" python -m auditwheel repair \