Skip to content

Commit

Permalink
Fix artifact path and make a utility function
Browse files Browse the repository at this point in the history
  • Loading branch information
harrism committed Nov 9, 2023
1 parent 3bd0240 commit 4743b62
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 117 deletions.
24 changes: 4 additions & 20 deletions ci/build_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,10 @@ source rapids-env-update

export CMAKE_GENERATOR=Ninja

RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"

rapids_repo_pr_artifact_channel () {
local repo=$1
local pr=$2
local commit=$(git ls-remote https://github.com/rapidsai/${repo}.git refs/heads/pull-request/${pr} | cut -c1-7)

if [[ $3 == "cpp" ]]
then
echo $(rapids-get-artifact ci/${repo}/pull-request/${pr}/${commit}/rmm_conda_cpp_cuda${RAPIDS_CUDA_MAJOR}_$(arch).tar.gz)
else
echo $(rapids-get-artifact ci/${repo}/pull-request/${pr}/${commit}/rmm_conda_python_cuda${RAPIDS_CUDA_MAJOR}_3${PYTHON_MINOR_VERSION}_$(arch).tar.gz)
fi
}

LIBRMM_CHANNEL=$(rapids_repo_pr_artifact_channel rmm 1095 cpp)
LIBCUDF_CHANNEL=$(rapids_repo_pr_artifact_channel cudf 14365 cpp)

echo "LIBRMM_CHANNEL == " ${LIBRMM_CHANNEL}
echo "LIBCUDF_CHANNEL == " ${LIBCUDF_CHANNEL}
ARTIFACT="$(realpath "$(dirname "$0")/utils/rapids-pr-artifact-path.sh")"

LIBRMM_CHANNEL=$(${ARTIFACT} rmm 1095 cpp)
LIBCUDF_CHANNEL=$(${ARTIFACT} cudf 14365 cpp)

rapids-print-env

Expand Down
24 changes: 5 additions & 19 deletions ci/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,12 @@ rapids-logger "Downloading artifacts from previous jobs"
CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)
PYTHON_CHANNEL=$(rapids-download-conda-from-s3 python)

RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"
PYTHON_MINOR_VERSION=$(python --version | sed -E 's/Python [0-9]+\.([0-9]+)\.[0-9]+/\1/g')
ARTIFACT="$(realpath "$(dirname "$0")/utils/rapids-pr-artifact-path.sh")"

rapids_repo_pr_artifact_channel () {
local repo=$1
local pr=$2
local commit=$(git ls-remote https://github.com/rapidsai/${repo}.git refs/heads/pull-request/${pr} | cut -c1-7)

if [[ $3 == "cpp" ]]
then
echo $(rapids-get-artifact ci/${repo}/pull-request/${pr}/${commit}/rmm_conda_cpp_cuda${RAPIDS_CUDA_MAJOR}_$(arch).tar.gz)
else
echo $(rapids-get-artifact ci/${repo}/pull-request/${pr}/${commit}/rmm_conda_python_cuda${RAPIDS_CUDA_MAJOR}_3${PYTHON_MINOR_VERSION}_$(arch).tar.gz)
fi
}

LIBRMM_CHANNEL=$(rapids_repo_pr_artifact_channel rmm 1095 cpp)
RMM_CHANNEL=$(rapids_repo_pr_artifact_channel rmm 1095 python)
LIBCUDF_CHANNEL=$(rapids_repo_pr_artifact_channel cudf 14365 cpp)
CUDF_CHANNEL=$(rapids_repo_pr_artifact_channel cudf 14365 python)
LIBRMM_CHANNEL=$(${ARTIFACT} rmm 1095 cpp)
RMM_CHANNEL=$(${ARTIFACT} rmm 1095 python)
LIBCUDF_CHANNEL=$(${ARTIFACT} cudf 14365 cpp)
CUDF_CHANNEL=$(${ARTIFACT} cudf 14365 python)

rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
Expand Down
24 changes: 5 additions & 19 deletions ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,14 @@ for package_name in cuspatial cuproj; do
sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" "${package_dir}/${package_name}/${package_name}/_version.py"
done

RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"
PYTHON_MINOR_VERSION=$(python --version | sed -E 's/Python [0-9]+\.([0-9]+)\.[0-9]+/\1/g')

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

rapids_repo_pr_artifact_channel () {
local repo=$1
local pr=$2
local commit=$(git ls-remote https://github.com/rapidsai/${repo}.git refs/heads/pull-request/${pr} | cut -c1-7)

if [[ $3 == "cpp" ]]
then
echo $(rapids-get-artifact ci/${repo}/pull-request/${pr}/${commit}/rmm_conda_cpp_cuda${RAPIDS_CUDA_MAJOR}_$(arch).tar.gz)
else
echo $(rapids-get-artifact ci/${repo}/pull-request/${pr}/${commit}/rmm_conda_python_cuda${RAPIDS_CUDA_MAJOR}_3${PYTHON_MINOR_VERSION}_$(arch).tar.gz)
fi
}
ARTIFACT="$(realpath "$(dirname "$0")/utils/rapids-pr-artifact-path.sh")"

LIBRMM_CHANNEL=$(rapids_repo_pr_artifact_channel rmm 1095 cpp)
RMM_CHANNEL=$(rapids_repo_pr_artifact_channel rmm 1095 python)
LIBCUDF_CHANNEL=$(rapids_repo_pr_artifact_channel cudf 14365 cpp)
CUDF_CHANNEL=$(rapids_repo_pr_artifact_channel cudf 14365 python)
LIBRMM_CHANNEL=$(${ARTIFACT} rmm 1095 cpp)
RMM_CHANNEL=$(${ARTIFACT} rmm 1095 python)
LIBCUDF_CHANNEL=$(${ARTIFACT} cudf 14365 cpp)
CUDF_CHANNEL=$(${ARTIFACT} cudf 14365 python)

rapids-logger "Begin py build cuSpatial"

Expand Down
26 changes: 6 additions & 20 deletions ci/test_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,14 @@ set +u
conda activate test
set -u

RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"
PYTHON_MINOR_VERSION=$(python --version | sed -E 's/Python [0-9]+\.([0-9]+)\.[0-9]+/\1/g')

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

rapids_repo_pr_artifact_channel () {
local repo=$1
local pr=$2
local commit=$(git ls-remote https://github.com/rapidsai/${repo}.git refs/heads/pull-request/${pr} | cut -c1-7)

if [[ $3 == "cpp" ]]
then
echo $(rapids-get-artifact ci/${repo}/pull-request/${pr}/${commit}/rmm_conda_cpp_cuda${RAPIDS_CUDA_MAJOR}_$(arch).tar.gz)
else
echo $(rapids-get-artifact ci/${repo}/pull-request/${pr}/${commit}/rmm_conda_python_cuda${RAPIDS_CUDA_MAJOR}_3${PYTHON_MINOR_VERSION}_$(arch).tar.gz)
fi
}

LIBRMM_CHANNEL=$(rapids_repo_pr_artifact_channel rmm 1095 cpp)
RMM_CHANNEL=$(rapids_repo_pr_artifact_channel rmm 1095 python)
LIBCUDF_CHANNEL=$(rapids_repo_pr_artifact_channel cudf 14365 cpp)
CUDF_CHANNEL=$(rapids_repo_pr_artifact_channel cudf 14365 python)
ARTIFACT="$(realpath "$(dirname "$0")/utils/rapids-pr-artifact-path.sh")"

LIBRMM_CHANNEL=$(${ARTIFACT} rmm 1095 cpp)
RMM_CHANNEL=$(${ARTIFACT} rmm 1095 python)
LIBCUDF_CHANNEL=$(${ARTIFACT} cudf 14365 cpp)
CUDF_CHANNEL=$(${ARTIFACT} cudf 14365 python)

RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}/
mkdir -p "${RAPIDS_TESTS_DIR}"
Expand Down
24 changes: 5 additions & 19 deletions ci/test_notebooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,12 @@ rapids-logger "Downloading artifacts from previous jobs"
CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)
PYTHON_CHANNEL=$(rapids-download-conda-from-s3 python)

RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"
PYTHON_MINOR_VERSION=$(python --version | sed -E 's/Python [0-9]+\.([0-9]+)\.[0-9]+/\1/g')
ARTIFACT="$(realpath "$(dirname "$0")/utils/rapids-pr-artifact-path.sh")"

rapids_repo_pr_artifact_channel () {
local repo=$1
local pr=$2
local commit=$(git ls-remote https://github.com/rapidsai/${repo}.git refs/heads/pull-request/${pr} | cut -c1-7)

if [[ $3 == "cpp" ]]
then
echo $(rapids-get-artifact ci/${repo}/pull-request/${pr}/${commit}/rmm_conda_cpp_cuda${RAPIDS_CUDA_MAJOR}_$(arch).tar.gz)
else
echo $(rapids-get-artifact ci/${repo}/pull-request/${pr}/${commit}/rmm_conda_python_cuda${RAPIDS_CUDA_MAJOR}_3${PYTHON_MINOR_VERSION}_$(arch).tar.gz)
fi
}

LIBRMM_CHANNEL=$(rapids_repo_pr_artifact_channel rmm 1095 cpp)
RMM_CHANNEL=$(rapids_repo_pr_artifact_channel rmm 1095 python)
LIBCUDF_CHANNEL=$(rapids_repo_pr_artifact_channel cudf 14365 cpp)
CUDF_CHANNEL=$(rapids_repo_pr_artifact_channel cudf 14365 python)
LIBRMM_CHANNEL=$(${ARTIFACT} rmm 1095 cpp)
RMM_CHANNEL=$(${ARTIFACT} rmm 1095 python)
LIBCUDF_CHANNEL=$(${ARTIFACT} cudf 14365 cpp)
CUDF_CHANNEL=$(${ARTIFACT} cudf 14365 python)

rapids-mamba-retry install \
--channel "${CPP_CHANNEL}" \
Expand Down
26 changes: 6 additions & 20 deletions ci/test_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,12 @@ rapids-logger "Downloading artifacts from previous jobs"
CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)
PYTHON_CHANNEL=$(rapids-download-conda-from-s3 python)

RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"
PYTHON_MINOR_VERSION=$(python --version | sed -E 's/Python [0-9]+\.([0-9]+)\.[0-9]+/\1/g')

rapids_repo_pr_artifact_channel () {
local repo=$1
local pr=$2
local commit=$(git ls-remote https://github.com/rapidsai/${repo}.git refs/heads/pull-request/${pr} | cut -c1-7)

if [[ $3 == "cpp" ]]
then
echo $(rapids-get-artifact ci/${repo}/pull-request/${pr}/${commit}/rmm_conda_cpp_cuda${RAPIDS_CUDA_MAJOR}_$(arch).tar.gz)
else
echo $(rapids-get-artifact ci/${repo}/pull-request/${pr}/${commit}/rmm_conda_python_cuda${RAPIDS_CUDA_MAJOR}_3${PYTHON_MINOR_VERSION}_$(arch).tar.gz)
fi
}

LIBRMM_CHANNEL=$(rapids_repo_pr_artifact_channel rmm 1095 cpp)
RMM_CHANNEL=$(rapids_repo_pr_artifact_channel rmm 1095 python)
LIBCUDF_CHANNEL=$(rapids_repo_pr_artifact_channel cudf 14365 cpp)
CUDF_CHANNEL=$(rapids_repo_pr_artifact_channel cudf 14365 python)
ARTIFACT="$(realpath "$(dirname "$0")/utils/rapids-pr-artifact-path.sh")"

LIBRMM_CHANNEL=$(${ARTIFACT} rmm 1095 cpp)
RMM_CHANNEL=$(${ARTIFACT} rmm 1095 python)
LIBCUDF_CHANNEL=$(${ARTIFACT} cudf 14365 cpp)
CUDF_CHANNEL=$(${ARTIFACT} cudf 14365 python)

RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}
RAPIDS_COVERAGE_DIR=${RAPIDS_COVERAGE_DIR:-"${PWD}/coverage-results"}
Expand Down
Empty file.

0 comments on commit 4743b62

Please sign in to comment.