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

Create Conda CI test env in one step #144

Open
wants to merge 4 commits into
base: branch-25.04
Choose a base branch
from
Open
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
75 changes: 34 additions & 41 deletions ci/test_python.sh
Copy link
Contributor

@bdice bdice Feb 11, 2025

Choose a reason for hiding this comment

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

Are ARM tests doing anything here? Maybe they should exit earlier (or be skipped in the CI matrix) if not.

There are a few comments of the form # Reactivate the test environment back. I’m not sure if we have a test environment to go back to, with the new single-solve environments.

Copy link
Author

Choose a reason for hiding this comment

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

We can do that in a follow-up PR. I'd like to limit the scope of this one to consolidating the environment creation.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2022-2024, NVIDIA CORPORATION.
# Copyright (c) 2022-2025, NVIDIA CORPORATION.

set -euo pipefail

Expand All @@ -14,15 +14,6 @@ rapids-logger "Downloading artifacts from previous jobs"
CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)
PYTHON_CHANNEL=$(rapids-download-conda-from-s3 python)

rapids-logger "Generate Python testing dependencies"
rapids-dependency-file-generator \
--output conda \
--file-key test_python \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" \
--prepend-channel "${CPP_CHANNEL}" \
--prepend-channel "${PYTHON_CHANNEL}" \
| tee env.yaml

RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}
RAPIDS_COVERAGE_DIR=${RAPIDS_COVERAGE_DIR:-"${PWD}/coverage-results"}
mkdir -p "${RAPIDS_TESTS_DIR}" "${RAPIDS_COVERAGE_DIR}"
Expand Down Expand Up @@ -50,6 +41,19 @@ set +e
# bulk sampler IO tests (hangs in CI)

if [[ "${RUNNER_ARCH}" != "ARM64" ]]; then
rapids-logger "Generate Python testing dependencies"
rapids-dependency-file-generator \
--output conda \
--file-key test_cugraph_dgl \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" \
--prepend-channel "${CPP_CHANNEL}" \
--prepend-channel "${PYTHON_CHANNEL}" \
--prepend-channel pytorch \
--prepend-channel conda-forge \
--prepend-channel "${DGL_CHANNEL}" \
--prepend-channel nvidia \
| tee env.yaml

rapids-mamba-retry env create --yes -f env.yaml -n test_cugraph_dgl

# activate test_cugraph_dgl environment for dgl
Expand All @@ -64,18 +68,6 @@ if [[ "${RUNNER_ARCH}" != "ARM64" ]]; then
fi


rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
--channel "${PYTHON_CHANNEL}" \
--channel pytorch \
--channel conda-forge \
--channel "${DGL_CHANNEL}" \
--channel nvidia \
"pylibwholegraph=${RAPIDS_VERSION}" \
"cugraph-dgl=${RAPIDS_VERSION}" \
'pytorch>=2.3' \
"ogb"

rapids-print-env

rapids-logger "Check GPU usage"
Expand All @@ -98,22 +90,23 @@ else
fi

if [[ "${RUNNER_ARCH}" != "ARM64" ]]; then
rapids-logger "Generate Python testing dependencies"
rapids-dependency-file-generator \
--output conda \
--file-key test_cugraph_pyg \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" \
--prepend-channel "${CPP_CHANNEL}" \
--prepend-channel "${PYTHON_CHANNEL}" \
--prepend-channel pytorch \
| tee env.yaml

rapids-mamba-retry env create --yes -f env.yaml -n test_cugraph_pyg

# Temporarily allow unbound variables for conda activation.
set +u
conda activate test_cugraph_pyg
set -u

rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
--channel "${PYTHON_CHANNEL}" \
--channel pytorch \
"pylibwholegraph=${RAPIDS_VERSION}" \
"cugraph-pyg=${RAPIDS_VERSION}" \
'pytorch>=2.3' \
'ogb'

rapids-print-env

rapids-logger "Check GPU usage"
Expand All @@ -136,23 +129,23 @@ else
fi

if [[ "${RUNNER_ARCH}" != "ARM64" ]]; then
rapids-logger "Generate Python testing dependencies"
rapids-dependency-file-generator \
--output conda \
--file-key test_pylibwholegraph \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" \
--prepend-channel "${CPP_CHANNEL}" \
--prepend-channel "${PYTHON_CHANNEL}" \
--prepend-channel pytorch \
| tee env.yaml

rapids-mamba-retry env create --yes -f env.yaml -n test_pylibwholegraph

# Temporarily allow unbound variables for conda activation.
set +u
conda activate test_pylibwholegraph
set -u

rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
--channel "${PYTHON_CHANNEL}" \
--channel pytorch \
'mkl<2024.1.0' \
"pylibwholegraph=${RAPIDS_VERSION}" \
'pytorch>=2.3' \
'pytest-forked' \
'ogb'

rapids-print-env

rapids-logger "Check GPU usage"
Expand Down
50 changes: 50 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,46 @@ files:
- depends_on_ogb
- py_version
- test_python_common
test_cugraph_dgl:
output: none
includes:
- cuda_version
- depends_on_cugraph
- depends_on_cudf
- depends_on_dgl
- depends_on_pytorch
- depends_on_ogb
- py_version
- test_python_common
- depends_on_pylibwholegraph
- depends_on_cugraph_dgl
test_cugraph_pyg:
output: none
includes:
- cuda_version
- depends_on_cugraph
- depends_on_cudf
- depends_on_dgl
- depends_on_pytorch
- depends_on_ogb
- py_version
- test_python_common
- depends_on_pylibwholegraph
- depends_on_cugraph_pyg
test_pylibwholegraph:
output: none
includes:
- cuda_version
- depends_on_cugraph
- depends_on_cudf
- depends_on_dgl
- depends_on_pytorch
- depends_on_ogb
- py_version
- test_python_common
- depends_on_mkl
- depends_on_pylibwholegraph
- test_python_pylibwholegraph

py_build_pylibwholegraph:
output: pyproject
Expand Down Expand Up @@ -658,3 +698,13 @@ dependencies:
packages: &cupy_packages_cu11
- cupy-cuda11x>=13.2.0
- {matrix: null, packages: *cupy_packages_cu11}
depends_on_cugraph_pyg:
common:
- output_types: conda
packages:
- cugraph-pyg==25.4.*,>=0.0.0a0
depends_on_mkl:
common:
- output_types: conda
packages:
- mkl<2024.1.0
Loading