Skip to content

Commit

Permalink
Create Conda CI test env in one step (#4935)
Browse files Browse the repository at this point in the history
Issue: rapidsai/build-planning#22

Authors:
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)
  - Mike Sarahan (https://github.com/msarahan)

Approvers:
  - Chuck Hastings (https://github.com/ChuckHastings)
  - James Lamb (https://github.com/jameslamb)

URL: #4935
  • Loading branch information
KyleFromNVIDIA authored Feb 20, 2025
1 parent b777261 commit 2bcf76e
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 72 deletions.
52 changes: 20 additions & 32 deletions ci/build_docs.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
#!/bin/bash
# Copyright (c) 2023-2024, NVIDIA CORPORATION.
# Copyright (c) 2023-2025, NVIDIA CORPORATION.

set -euo pipefail

if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then
CONDA_CUDA_VERSION="11.8"
DGL_CHANNEL="dglteam/label/th23_cu118"
else
CONDA_CUDA_VERSION="12.1"
DGL_CHANNEL="dglteam/label/th23_cu121"
fi

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 "Create test conda environment"
. /opt/conda/etc/profile.d/conda.sh

Expand All @@ -13,43 +25,19 @@ export RAPIDS_VERSION_NUMBER="$RAPIDS_VERSION_MAJOR_MINOR"
rapids-dependency-file-generator \
--output conda \
--file-key docs \
--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}" \
--prepend-channel "${CPP_CHANNEL}" \
--prepend-channel "${PYTHON_CHANNEL}" \
--prepend-channel conda-forge \
--prepend-channel nvidia \
--prepend-channel "${DGL_CHANNEL}" \
| tee env.yaml

rapids-mamba-retry env create --yes -f env.yaml -n docs
conda activate docs

rapids-print-env

rapids-logger "Downloading artifacts from previous jobs"
CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)
PYTHON_CHANNEL=$(rapids-download-conda-from-s3 python)

if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then
CONDA_CUDA_VERSION="11.8"
DGL_CHANNEL="dglteam/label/th23_cu118"
else
CONDA_CUDA_VERSION="12.1"
DGL_CHANNEL="dglteam/label/th23_cu121"
fi

rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
--channel "${PYTHON_CHANNEL}" \
--channel conda-forge \
--channel nvidia \
--channel "${DGL_CHANNEL}" \
"libcugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"pylibcugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"cugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"cugraph-pyg=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"cugraph-dgl=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"cugraph-service-server=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"cugraph-service-client=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"libcugraph_etl=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"pylibwholegraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
'pytorch>=2.3' \
"cuda-version=${CONDA_CUDA_VERSION}"

export RAPIDS_DOCS_DIR="$(mktemp -d)"

rapids-logger "Build CPP docs"
Expand Down
2 changes: 2 additions & 0 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ NEXT_UCXX_SHORT_TAG_PEP440=$(python -c "from packaging.version import Version; p
DEPENDENCIES=(
cudf
cugraph
cugraph-dgl
cugraph-pyg
cugraph-service-server
cugraph-service-client
cuxfilter
Expand Down
14 changes: 4 additions & 10 deletions ci/test_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../

. /opt/conda/etc/profile.d/conda.sh

RAPIDS_VERSION_MAJOR_MINOR="$(rapids-version-major-minor)"
CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)

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

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

Expand All @@ -23,19 +25,11 @@ set +u
conda activate test
set -u

CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)

RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"

rapids-print-env

rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
"libcugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"libcugraph_etl=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"libcugraph-tests=${RAPIDS_VERSION_MAJOR_MINOR}.*"

rapids-logger "Check GPU usage"
nvidia-smi

Expand Down
22 changes: 8 additions & 14 deletions ci/test_notebooks.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
#!/bin/bash
# Copyright (c) 2020-2024, NVIDIA CORPORATION.
# Copyright (c) 2020-2025, NVIDIA CORPORATION.

set -Eeuo pipefail

. /opt/conda/etc/profile.d/conda.sh

RAPIDS_VERSION_MAJOR_MINOR="$(rapids-version-major-minor)"
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 notebook testing dependencies"
rapids-dependency-file-generator \
--output conda \
--file-key test_notebooks \
--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}" \
--prepend-channel "${CPP_CHANNEL}" \
--prepend-channel "${PYTHON_CHANNEL}" \
| tee env.yaml

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

Expand All @@ -22,17 +27,6 @@ set -u

rapids-print-env

rapids-logger "Downloading artifacts from previous jobs"
CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)
PYTHON_CHANNEL=$(rapids-download-conda-from-s3 python)

rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
--channel "${PYTHON_CHANNEL}" \
"libcugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"pylibcugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"cugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*"

NBTEST="$(realpath "$(dirname "$0")/utils/nbtest.sh")"
NOTEBOOK_LIST="$(realpath "$(dirname "$0")/notebook_list.py")"
EXITCODE=0
Expand Down
24 changes: 8 additions & 16 deletions ci/test_python.sh
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 @@ -8,13 +8,18 @@ cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../

. /opt/conda/etc/profile.d/conda.sh

RAPIDS_VERSION_MAJOR_MINOR="$(rapids-version-major-minor)"
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}" | tee env.yaml
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" \
--prepend-channel "${CPP_CHANNEL}" \
--prepend-channel "${PYTHON_CHANNEL}" \
| tee env.yaml

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

Expand All @@ -23,25 +28,12 @@ set +u
conda activate test
set -u

rapids-logger "Downloading artifacts from previous jobs"
CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)
PYTHON_CHANNEL=$(rapids-download-conda-from-s3 python)

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}"

rapids-print-env

rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
--channel "${PYTHON_CHANNEL}" \
"libcugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"pylibcugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"cugraph=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"cugraph-service-server=${RAPIDS_VERSION_MAJOR_MINOR}.*" \
"cugraph-service-client=${RAPIDS_VERSION_MAJOR_MINOR}.*"

rapids-logger "Check GPU usage"
nvidia-smi

Expand Down
56 changes: 56 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,24 @@ files:
- cuda_version
- docs
- py_version
- depends_on_libcugraph
- depends_on_pylibcugraph
- depends_on_cugraph
- depends_on_cugraph_pyg
- depends_on_cugraph_dgl
- depends_on_cugraph_service_server
- depends_on_cugraph_service_client
- depends_on_libcugraph_etl
- depends_on_pylibwholegraph
- depends_on_pytorch
test_cpp:
output: none
includes:
- cuda_version
- test_cpp
- depends_on_libcugraph
- depends_on_libcugraph_etl
- depends_on_libcugraph_tests
test_notebooks:
output: none
includes:
Expand All @@ -59,6 +72,9 @@ files:
- test_notebook
- test_python_common
- test_python_cugraph
- depends_on_libcugraph
- depends_on_pylibcugraph
- depends_on_cugraph
test_python:
output: none
includes:
Expand All @@ -70,6 +86,11 @@ files:
- test_python_common
- test_python_cugraph
- test_python_pylibcugraph
- depends_on_libcugraph
- depends_on_pylibcugraph
- depends_on_cugraph
- depends_on_cugraph_service_server
- depends_on_cugraph_service_client
py_build_cugraph:
output: pyproject
pyproject_dir: python/cugraph
Expand Down Expand Up @@ -517,6 +538,18 @@ dependencies:
- cugraph-cu11==25.4.*,>=0.0.0a0
- {matrix: null, packages: [*cugraph_unsuffixed]}

depends_on_cugraph_dgl:
common:
- output_types: conda
packages:
- cugraph-dgl==25.4.*,>=0.0.0a0

depends_on_cugraph_pyg:
common:
- output_types: conda
packages:
- cugraph-pyg==25.4.*,>=0.0.0a0

depends_on_cugraph_service_client:
common:
- output_types: [conda, requirements, pyproject]
Expand All @@ -528,6 +561,29 @@ dependencies:
- --extra-index-url=https://pypi.nvidia.com
- --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple

depends_on_cugraph_service_server:
common:
- output_types: [conda, requirements, pyproject]
packages:
- cugraph-service-server==25.4.*,>=0.0.0a0
- output_types: requirements
packages:
# pip recognizes the index as a global option for the requirements.txt file
- --extra-index-url=https://pypi.nvidia.com
- --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple

depends_on_libcugraph_etl:
common:
- output_types: conda
packages:
- libcugraph_etl==25.4.*,>=0.0.0a0

depends_on_libcugraph_tests:
common:
- output_types: conda
packages:
- libcugraph-tests==25.4.*,>=0.0.0a0

depends_on_pytorch:
common:
- output_types: [conda]
Expand Down

0 comments on commit 2bcf76e

Please sign in to comment.