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

Allow testing of earliest/latest dependencies. #1606

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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: 8 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ concurrency:
jobs:
cpp-build:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@earliest-dependencies
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
Expand All @@ -37,7 +37,7 @@ jobs:
python-build:
needs: [cpp-build]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@earliest-dependencies
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
Expand All @@ -46,7 +46,7 @@ jobs:
upload-conda:
needs: [cpp-build, python-build]
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/conda-upload-packages.yaml@earliest-dependencies
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
Expand All @@ -56,7 +56,7 @@ jobs:
if: github.ref_type == 'branch'
needs: python-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@earliest-dependencies
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
Expand All @@ -68,7 +68,7 @@ jobs:
run_script: "ci/build_docs.sh"
wheel-build-cpp:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@earliest-dependencies
with:
matrix_filter: group_by([.ARCH, (.CUDA_VER|split(".")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(".")|map(tonumber)))
build_type: ${{ inputs.build_type || 'branch' }}
Expand All @@ -79,7 +79,7 @@ jobs:
wheel-build-python:
needs: wheel-build-cpp
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@earliest-dependencies
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
Expand All @@ -89,7 +89,7 @@ jobs:
wheel-publish-cpp:
needs: wheel-build-cpp
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@earliest-dependencies
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
Expand All @@ -100,7 +100,7 @@ jobs:
wheel-publish-python:
needs: wheel-build-python
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/wheels-publish.yaml@earliest-dependencies
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,40 +23,40 @@ jobs:
- wheel-tests
- devcontainer
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/pr-builder.yaml@earliest-dependencies
checks:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/checks.yaml@earliest-dependencies
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.08
uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-build.yaml@earliest-dependencies
with:
build_type: pull-request
conda-cpp-tests:
needs: conda-cpp-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@earliest-dependencies
with:
build_type: pull-request
conda-python-build:
needs: conda-cpp-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/conda-python-build.yaml@earliest-dependencies
with:
build_type: pull-request
conda-python-tests:
needs: conda-python-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@earliest-dependencies
with:
build_type: pull-request
docs-build:
needs: conda-python-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/custom-job.yaml@earliest-dependencies
with:
build_type: pull-request
node_type: "gpu-v100-latest-1"
Expand All @@ -66,28 +66,28 @@ jobs:
wheel-build-cpp:
needs: checks
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@earliest-dependencies
with:
matrix_filter: group_by([.ARCH, (.CUDA_VER|split(".")|map(tonumber)|.[0])]) | map(max_by(.PY_VER|split(".")|map(tonumber)))
build_type: pull-request
script: ci/build_wheel_cpp.sh
wheel-build-python:
needs: wheel-build-cpp
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/wheels-build.yaml@earliest-dependencies
with:
build_type: pull-request
script: ci/build_wheel_python.sh
wheel-tests:
needs: wheel-build-python
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@earliest-dependencies
with:
build_type: pull-request
script: ci/test_wheel.sh
devcontainer:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/build-in-devcontainer.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/build-in-devcontainer.yaml@earliest-dependencies
with:
arch: '["amd64"]'
cuda: '["12.2"]'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,23 @@ on:
jobs:
cpp-tests:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/conda-cpp-tests.yaml@earliest-dependencies
with:
build_type: nightly
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
python-tests:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/conda-python-tests.yaml@earliest-dependencies
with:
build_type: nightly
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
wheel-tests:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@branch-24.08
uses: rapidsai/shared-workflows/.github/workflows/wheels-test.yaml@earliest-dependencies
with:
build_type: nightly
branch: ${{ inputs.branch }}
Expand Down
2 changes: 1 addition & 1 deletion ci/test_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rapids-logger "Create test conda environment"
rapids-dependency-file-generator \
--output conda \
--file-key test_python \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};dependencies=${RAPIDS_DEPENDENCIES}" | tee env.yaml
Copy link
Contributor Author

@bdice bdice Jul 11, 2024

Choose a reason for hiding this comment

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

For wheel tests, we will have to engineer a way to use the oldest dependencies. We determine the test dependencies at build time, via [test] extras that are baked into the package. However, for testing earliest dependency pinnings, we really just want to add some extra pinnings to the environment at test time based on the value of RAPIDS_DEPENDENCIES. We may have to add a call in ci/test_wheel.sh that invokes rapids-dependency-file-generator to create a requirements.txt file that we install after installing the previously-built wheel.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, that makes sense to me (and it is really cool to see how straight forward this is looking like).
Don't want to mess with the builds, just testing, so branching between using package[test] and a custom requirements install on RAPIDS_DEPENDENCIES="earliest" seems good.


rapids-mamba-retry env create --yes -f env.yaml -n test
set +u
Expand Down
11 changes: 11 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -306,3 +306,14 @@ dependencies:
- cuda-nvcc
- matrix:
packages:
specific:
- output_types: [conda, requirements, pyproject]
matrices:
- matrix:
dependencies: "earliest"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This worked as desired:

RAPIDS logger » [07/11/24 17:12:53]
┌─────────────────────────────────────┐
|    Create test conda environment    |
└─────────────────────────────────────┘

# This file is generated by `rapids-dependency-file-generator`.
# To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
channels:
- rapidsai
- rapidsai-nightly
- conda-forge
dependencies:
- cuda-version=11.8
- numba==0.57.*
- numpy==1.23.*
- pytest
- pytest-cov
- python=3.9
name: test_python_cuda-118_arch-x86_64_py-39_dependencies-earliest

...

numba                     0.57.1           py39hb75a051_0    conda-forge
numpy                     1.23.5           py39h3d75532_0    conda-forge

Copy link
Contributor

Choose a reason for hiding this comment

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

  1. An optional suggestion for terminology: maybe "oldest" or "minimum" instead of "earliest"?
  2. Not sure if any RAPIDS libraries support optional dependencies, but one would be able to both required and optional dependencies here?
  3. Speculating a use case: I would imagine for a particular common block, a project would ideally want to test both the latest and earliest dependencies so would a specification like:
    common:
      - output_types: [conda, requirements, pyproject]
      - version_types: [latest, earliest]

make sense?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't have an opinion on naming, the name "earliest" already exists in the common workflow (but not sure it is actually used for much there).

earliest/latest is only really relevant for testing, so I think we don't need any of the other things mentioned and this is just fine.
I.e. all we need is a way to generate two variations for the testing step, which is already fully separated from the build step.

Copy link
Contributor

Choose a reason for hiding this comment

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

Needed a bit to realize that a currently valid way to specify say that something works for say Python 3.12 and 3.13 is 3.1[23] fromn the fnmatch synatx.

Likely not often needed in rapids, but it occurred to me that minimal versions can often be Python version dependent.
(It's unfortunate that conda/pip have no tool to ask to resolve the oldest versions.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In RAPIDS we have historically chosen lower bounds that work for all RAPIDS-supported Python versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I chose “earliest/latest” because we named our CUDA drivers that way in shared-workflows. There is also precedent for “oldest” in packages like “oldest-supported-numpy.” Please feel free to change it — I have bequeathed these pull requests to @seberg.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have a very weak preference to avoid calling it “minimum” versions because we usually say a package with few dependencies or no optional dependencies has “minimal dependencies.”

packages:
- numba==0.57.*
- numpy==1.23.*
# No pinnings except for earliest dependencies
- matrix:
packages:
Loading