Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate wheel workflow scripts locally #1546

Merged
merged 49 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
edfd4a3
try locally building wheels
divyegala May 23, 2023
e013fd9
add package-dir back, use correct branch
divyegala May 23, 2023
27363dd
temporarily update dependencies to 23.8
divyegala May 23, 2023
c7fd706
use double equals
divyegala May 23, 2023
25d8908
change file permissions
divyegala May 23, 2023
40e140d
try to fix dfg
divyegala May 23, 2023
3c52c30
use abs path
divyegala May 23, 2023
71cb1b7
use matrix.arch from env
divyegala May 23, 2023
3a2b609
try to remove unbound variable error
divyegala May 23, 2023
3c7c7a2
move pypi password back to upstream
divyegala May 24, 2023
dde3fa0
correctly pass var
divyegala May 24, 2023
d296027
add logs to see what arg is being set
divyegala May 24, 2023
8cc9251
account for changes to new images, gha tools
divyegala May 26, 2023
b868d72
bump
divyegala May 26, 2023
a630e51
dont use rapids-env-update
divyegala May 26, 2023
0046571
bump
divyegala May 26, 2023
ec59f9a
bump
divyegala May 27, 2023
56a4701
only download custom gha-tools if not available
divyegala May 30, 2023
38bdd85
Merge branch 'branch-23.08' into local-wheel-build-scripts
divyegala May 31, 2023
fa8b403
bump
divyegala Jun 1, 2023
aefea72
update wheel builds to new workflow, minor fixes
divyegala Jul 13, 2023
bcb0c14
merge upstream
divyegala Jul 13, 2023
c9c8f52
Remove guard for uploading wheels
divyegala Jul 13, 2023
1b0299a
Apply suggestions from code review
divyegala Jul 14, 2023
306a00d
address review, account for workflows/gha-tools changes
divyegala Jul 17, 2023
8ccffd6
remove package-dir arg from workflows
divyegala Jul 17, 2023
331b854
use rapids-configure-sccache directly instead of rapids-env-update
divyegala Jul 17, 2023
53d6c1b
use correct temp gha-tools path for rapids-configure-sccache
divyegala Jul 17, 2023
f503881
set RAPIDS_EPOCH_TIMESTAMP
divyegala Jul 18, 2023
62a5ede
Switch to local testing script
vyasr Jul 19, 2023
c606cf8
Remove parallelism from testing
vyasr Jul 19, 2023
4830736
Fix some typos
vyasr Jul 19, 2023
94b4051
address review
divyegala Jul 19, 2023
7f4faa9
merge upstream
divyegala Jul 19, 2023
97ef672
use correct path for gha tools
divyegala Jul 19, 2023
8e78315
Remove index setting
vyasr Jul 19, 2023
44aadc9
Update workflow filename
vyasr Jul 19, 2023
4c81ee5
Apply suggestions from code review
divyegala Jul 19, 2023
ac6aeb0
bump
vyasr Jul 20, 2023
e47b637
bump
vyasr Jul 20, 2023
95d6860
address review
divyegala Jul 20, 2023
75920cb
Merge remote-tracking branch 'upstream/branch-23.08' into local-wheel…
divyegala Jul 20, 2023
594f4ce
Merge remote-tracking branch 'vyas/feat/test_wheel_scripts' into loca…
divyegala Jul 20, 2023
4708393
add publish/test
divyegala Jul 20, 2023
6f7ccd0
Apply suggestions from code review
divyegala Jul 20, 2023
ead668d
Apply suggestions from code review
divyegala Jul 20, 2023
b060f7c
Merge remote-tracking branch 'upstream/branch-23.08' into local-wheel…
divyegala Jul 21, 2023
2f2e58a
revert workflows pin
divyegala Jul 21, 2023
98f3522
Merge branch 'local-wheel-build-scripts' of github.com:divyegala/raft…
divyegala Jul 21, 2023
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
16 changes: 6 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,17 @@ jobs:
run_script: "ci/build_docs.sh"
wheel-build-pylibraft:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-build.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-build.yaml@branch-23.08
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: pylibraft
package-dir: python/pylibraft
skbuild-configure-options: "-DRAFT_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF -DFIND_RAFT_CPP=OFF"
script: ci/build_wheel_pylibraft.sh
wheel-publish-pylibraft:
needs: wheel-build-pylibraft
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-publish.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-publish.yaml@branch-23.08
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
Expand All @@ -88,19 +86,17 @@ jobs:
wheel-build-raft-dask:
needs: wheel-publish-pylibraft
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-build.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-build.yaml@branch-23.08
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: raft_dask
package-dir: python/raft-dask
skbuild-configure-options: "-DRAFT_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF -DFIND_RAFT_CPP=OFF"
script: ci/build_wheel_raft_dask.sh
wheel-publish-raft-dask:
needs: wheel-build-raft-dask
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-publish.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-publish.yaml@branch-23.08
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
Expand Down
28 changes: 8 additions & 20 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,40 +67,28 @@ jobs:
wheel-build-pylibraft:
needs: checks
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-build.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-build.yaml@branch-23.08
with:
build_type: pull-request
package-name: pylibraft
package-dir: python/pylibraft
skbuild-configure-options: "-DRAFT_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF -DFIND_RAFT_CPP=OFF"
script: ci/build_wheel_pylibraft.sh
wheel-tests-pylibraft:
needs: wheel-build-pylibraft
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-test.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-test.yaml@branch-23.08
with:
build_type: pull-request
package-name: pylibraft
test-unittest: "python -m pytest ./python/pylibraft/pylibraft/test"
test-smoketest: "python ./ci/wheel_smoke_test_pylibraft.py"
script: ci/test_wheel_pylibraft.sh
wheel-build-raft-dask:
needs: wheel-tests-pylibraft
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-build.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-build.yaml@branch-23.08
with:
build_type: pull-request
package-name: raft_dask
package-dir: python/raft-dask
before-wheel: "RAPIDS_PY_WHEEL_NAME=pylibraft_${{ '${PIP_CU_VERSION}' }} rapids-download-wheels-from-s3 ./local-pylibraft && python -m pip install --no-deps ./local-pylibraft/pylibraft*.whl"
skbuild-configure-options: "-DRAFT_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF -DFIND_RAFT_CPP=OFF"
script: "ci/build_wheel_raft_dask.sh"
wheel-tests-raft-dask:
needs: wheel-build-raft-dask
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-test.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-test.yaml@branch-23.08
with:
build_type: pull-request
package-name: raft_dask
# Always want to test against latest dask/distributed.
test-before-amd64: "RAPIDS_PY_WHEEL_NAME=pylibraft_${{ '${PIP_CU_VERSION}' }} rapids-download-wheels-from-s3 ./local-pylibraft-dep && pip install --no-deps ./local-pylibraft-dep/pylibraft*.whl && pip install git+https://github.com/dask/dask.git@main git+https://github.com/dask/distributed.git@main git+https://github.com/rapidsai/[email protected]"
test-before-arm64: "RAPIDS_PY_WHEEL_NAME=pylibraft_${{ '${PIP_CU_VERSION}' }} rapids-download-wheels-from-s3 ./local-pylibraft-dep && pip install --no-deps ./local-pylibraft-dep/pylibraft*.whl && pip install git+https://github.com/dask/dask.git@main git+https://github.com/dask/distributed.git@main git+https://github.com/rapidsai/[email protected]"
test-unittest: "python -m pytest ./python/raft-dask/raft_dask/test"
test-smoketest: "python ./ci/wheel_smoke_test_raft_dask.py"
script: ci/test_wheel_raft_dask.sh
12 changes: 4 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,19 @@ jobs:
sha: ${{ inputs.sha }}
wheel-tests-pylibraft:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-test.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-test.yaml@branch-23.08
with:
build_type: nightly
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
package-name: pylibraft
test-unittest: "python -m pytest -v ./python/pylibraft/pylibraft/test"
script: ci/test_wheel_pylibraft.sh
wheel-tests-raft-dask:
secrets: inherit
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-manylinux-test.yml@branch-23.08
uses: rapidsai/shared-action-workflows/.github/workflows/wheels-test.yaml@branch-23.08
with:
build_type: nightly
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
package-name: raft_dask
test-before-amd64: "pip install git+https://github.com/dask/dask.git@main git+https://github.com/dask/distributed.git@main git+https://github.com/rapidsai/[email protected]"
test-before-arm64: "pip install git+https://github.com/dask/dask.git@main git+https://github.com/dask/distributed.git@main git+https://github.com/rapidsai/[email protected]"
test-unittest: "python -m pytest -v ./python/raft-dask/raft_dask/test"
script: ci/test_wheel_raft_dask.sh
30 changes: 30 additions & 0 deletions ci/build_wheel.sh
divyegala marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/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})"

ci/release/apply_wheel_modifications.sh ${version_override} "-${RAPIDS_PY_CUDA_SUFFIX}"
echo "The package name and/or version was modified in the package source. The git diff is:"
git diff

cd "${package_dir}"

# Hardcode the output dir
python -m pip wheel . -w dist -vvv --no-deps --disable-pip-version-check
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
python -m pip wheel . -w dist -vvv --no-deps --disable-pip-version-check
python -m pip wheel . -w dist --no-deps --disable-pip-version-check

Is the verbosity here necessary?

In the past, we've intentionally turned off verbosity for things like pytest because it can make the GHA logs difficult to read.

Copy link
Member Author

Choose a reason for hiding this comment

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

I will let @vyasr comment on the verbosity questions

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes I was going to raise this point towards the end. I say let's turn off the verbosity for tests, but keep it for builds (i.e. pip wheel -v) That matches what we do for conda and I think that's generally helpful. Test failures tend to be self-contained, so it's enough to see that a single test failure to know what's going on, whereas with builds the real cause can often be hidden (e.g. pip does something wrong in dependency installation which results in compile-time errors).


mkdir -p final_dist
python -m auditwheel repair -w final_dist dist/*

RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 final_dist
divyegala marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 9 additions & 0 deletions ci/build_wheel_pylibraft.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -euo pipefail

# Set up skbuild options. Enable sccache in skbuild config options
export SKBUILD_CONFIGURE_OPTIONS="-DRAFT_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF -DFIND_RAFT_CPP=OFF"

ci/build_wheel.sh pylibraft python/pylibraft
14 changes: 14 additions & 0 deletions ci/build_wheel_raft_dask.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -euo pipefail

# Set up skbuild options. Enable sccache in skbuild config options
export SKBUILD_CONFIGURE_OPTIONS="-DRAFT_BUILD_WHEELS=ON -DDETECT_CONDA_ENV=OFF -DFIND_RAFT_CPP=OFF"

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"

RAPIDS_PY_WHEEL_NAME=pylibraft_${RAPIDS_PY_CUDA_SUFFIX} rapids-download-wheels-from-s3 ./local-pylibraft
python -m pip install --no-deps ./local-pylibraft/pylibraft*.whl

ci/build_wheel.sh raft_dask python/raft-dask
18 changes: 18 additions & 0 deletions ci/test_wheel_pylibraft.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -euo pipefail

mkdir -p ./dist
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
RAPIDS_PY_WHEEL_NAME="pylibraft_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./dist

# echo to expand wildcard before adding `[extra]` requires for pip
python -m pip install $(echo ./dist/pylibraft*.whl)[test]

# Run smoke tests for aarch64 pull requests
if [[ "$(arch)" == "aarch64" && "${RAPIDS_BUILD_TYPE}" == "pull-request" ]]; then
python ./ci/wheel_smoke_test_pylibraft.py
else
python -m pytest ./python/pylibraft/pylibraft/test
fi
25 changes: 25 additions & 0 deletions ci/test_wheel_raft_dask.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -euo pipefail

mkdir -p ./dist
RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
RAPIDS_PY_WHEEL_NAME="raft_dask_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./dist

# Download the pylibraft built in the previous step
RAPIDS_PY_WHEEL_NAME="pylibraft_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./local-pylibraft-dep
python -m pip install --no-deps ./local-pylibraft-dep/pylibraft*.whl

# Always install latest dask for testing
python -m pip install git+https://github.com/dask/dask.git@main git+https://github.com/dask/distributed.git@main git+https://github.com/rapidsai/[email protected]

# echo to expand wildcard before adding `[extra]` requires for pip
python -m pip install $(echo ./dist/raft_dask*.whl)[test]

# Run smoke tests for aarch64 pull requests
if [[ "$(arch)" == "aarch64" && "${RAPIDS_BUILD_TYPE}" == "pull-request" ]]; then
python ./ci/wheel_smoke_test_raft_dask.py
else
python -m pytest ./python/raft-dask/raft_dask/test
fi