-
Notifications
You must be signed in to change notification settings - Fork 931
/
Copy pathtest_python_common.sh
executable file
·44 lines (32 loc) · 1.26 KB
/
test_python_common.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
# Copyright (c) 2022-2025, NVIDIA CORPORATION.
# Common setup steps shared by Python test jobs
set -euo pipefail
. /opt/conda/etc/profile.d/conda.sh
RAPIDS_VERSION="$(rapids-version)"
rapids-logger "Generate Python testing dependencies"
ENV_YAML_DIR="$(mktemp -d)"
FILE_KEY=$1
rapids-dependency-file-generator \
--output conda \
--file-key "${FILE_KEY}" \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION};dependencies=${RAPIDS_DEPENDENCIES}" \
| tee "${ENV_YAML_DIR}/env.yaml"
rapids-mamba-retry env create --yes -f "${ENV_YAML_DIR}/env.yaml" -n test
# Temporarily allow unbound variables for conda activation.
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)
RESULTS_DIR=${RAPIDS_TESTS_DIR:-"$(mktemp -d)"}
RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${RESULTS_DIR}/test-results"}/
RAPIDS_COVERAGE_DIR=${RAPIDS_COVERAGE_DIR:-"${RESULTS_DIR}/coverage-results"}
mkdir -p "${RAPIDS_TESTS_DIR}" "${RAPIDS_COVERAGE_DIR}"
rapids-print-env
rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
--channel "${PYTHON_CHANNEL}" \
"cudf=${RAPIDS_VERSION}" \
"libcudf=${RAPIDS_VERSION}"