Skip to content

Commit

Permalink
Create Conda test environment in one go
Browse files Browse the repository at this point in the history
Instead of creating the Conda test environment and then installing the
test dependencies into the environment, create the Conda environment
once with the test dependencies.
  • Loading branch information
jakirkham committed Jan 7, 2025
1 parent 09085cb commit ae54f63
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
16 changes: 6 additions & 10 deletions ci/test_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@ set -euo pipefail
# Support invoking test_python.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../

rapids-logger "Create test conda environment"
rapids-logger "Create test conda environment using artifacts from previous job"
. /opt/conda/etc/profile.d/conda.sh

UCX_PY_VERSION="$(head -1 ./VERSION)"
PYTHON_CHANNEL=$(rapids-download-conda-from-s3 python)

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 "${PYTHON_CHANNEL}" \
| tee env.yaml

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

rapids-print-env
Expand Down Expand Up @@ -47,13 +50,6 @@ run_tests() {
./ci/run_benchmark_pytests.sh
}

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

rapids-mamba-retry install \
--channel "${PYTHON_CHANNEL}" \
"ucx-py=${UCX_PY_VERSION}"

rapids-logger "Run tests with conda package"
run_tests

Expand Down
6 changes: 6 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ files:
- cuda_version
- depends_on_cupy
- py_version
- test_ucx_py
- test_python
checks:
output: none
Expand Down Expand Up @@ -212,6 +213,11 @@ dependencies:
# without CUDA, e.g. 'pip install .'
- matrix: null
packages: null
test_ucx-py:
common:
- output_types: conda
packages:
- ucx-py==0.42.*,>=0.0.0a0
test_python:
common:
- output_types: [conda, requirements, pyproject]
Expand Down

0 comments on commit ae54f63

Please sign in to comment.