-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify wheel build scripts and allow alphas of RAPIDS dependencies (#…
…13963) This PR makes a handful of changes aimed at simplifying the CI pipeline for building wheels as a precursor to switching RAPIDS nightlies to using proper alpha versions: - Inlines apply_wheel_modifications.sh in build_wheel.sh. Now that the build doesn't rely excessively on logic in shared workflows, there's no real benefit to having a separate script (previously apply_wheel_modification.sh was a special script that the shared workflow knew to execute i.e. it was a hook into an externally controlled workflow). - Consolidates the textual replacements using for loops and makes the replacements more targeted by only modifying the Python package being built in a given script. For instance, python/dask_cudf/pyproject.toml is no longer overwritten when building cudf. - Modifies dependency specs for RAPIDS packages to include a `>=0.0.0a0` component. This is the key change that will allow alpha dependencies to be discovered. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Bradley Dice (https://github.com/bdice) - AJ Schmidt (https://github.com/ajschmidt8) URL: #13963
- Loading branch information
Showing
4 changed files
with
65 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#!/bin/bash | ||
# Copyright (c) 2023, NVIDIA CORPORATION. | ||
|
||
set -euo pipefail | ||
|
||
package_name=$1 | ||
package_dir=$2 | ||
|
||
source rapids-configure-sccache | ||
source rapids-date-string | ||
|
||
# Use gha-tools rapids-pip-wheel-version to generate wheel version then | ||
# update the necessary files | ||
version_override="$(rapids-pip-wheel-version ${RAPIDS_DATE_STRING})" | ||
|
||
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" | ||
|
||
# This is the version of the suffix with a preceding hyphen. It's used | ||
# everywhere except in the final wheel name. | ||
PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}" | ||
|
||
# Patch project metadata files to include the CUDA version suffix and version override. | ||
pyproject_file="${package_dir}/pyproject.toml" | ||
|
||
sed -i "s/^version = .*/version = \"${version_override}\"/g" ${pyproject_file} | ||
sed -i "s/name = \"${package_name}\"/name = \"${package_name}${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} | ||
|
||
# For nightlies we want to ensure that we're pulling in alphas as well. The | ||
# easiest way to do so is to augment the spec with a constraint containing a | ||
# min alpha version that doesn't affect the version bounds but does allow usage | ||
# of alpha versions for that dependency without --pre | ||
alpha_spec='' | ||
if ! rapids-is-release-build; then | ||
alpha_spec=',>=0.0.0a0' | ||
fi | ||
|
||
if [[ ${package_name} == "dask_cudf" ]]; then | ||
sed -r -i "s/cudf==(.*)\"/cudf${PACKAGE_CUDA_SUFFIX}==\1${alpha_spec}\"/g" ${pyproject_file} | ||
else | ||
sed -r -i "s/rmm(.*)\"/rmm${PACKAGE_CUDA_SUFFIX}\1${alpha_spec}\"/g" ${pyproject_file} | ||
# ptxcompiler and cubinlinker aren't version constrained | ||
sed -r -i "s/ptxcompiler\"/ptxcompiler${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} | ||
sed -r -i "s/cubinlinker\"/cubinlinker${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file} | ||
fi | ||
|
||
if [[ $PACKAGE_CUDA_SUFFIX == "-cu12" ]]; then | ||
sed -i "s/cuda-python[<=>\.,0-9a]*/cuda-python>=12.0,<13.0a0/g" ${pyproject_file} | ||
sed -i "s/cupy-cuda11x/cupy-cuda12x/g" ${pyproject_file} | ||
sed -i "/ptxcompiler/d" ${pyproject_file} | ||
sed -i "/cubinlinker/d" ${pyproject_file} | ||
fi | ||
|
||
cd "${package_dir}" | ||
|
||
python -m pip wheel . -w dist -vvv --no-deps --disable-pip-version-check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.