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

New script to get latest conda artifact from a given repo PR #85

Merged
merged 8 commits into from
Nov 13, 2023
Merged
Changes from 5 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
35 changes: 35 additions & 0 deletions tools/rapids-get-pr-conda-artifact
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
# Echo path to an artifact for a specific PR. Finds and uses the latest commit on the PR.
#
# Positional Arguments:
# 1) repo name
# 2) PR number
# 3) "cpp" or "python", to get the artifact for the C++ or Python build, respectively
# 4) [optional] commit hash, to get the artifact for a specific commit
#
# Example Usage:
# rapids-get-pr-conda-artifact rmm 1095 cpp

set -euo pipefail

repo="$1"
pr="$2"

if [[ $# -eq 4 ]]
commit="$4"
harrism marked this conversation as resolved.
Show resolved Hide resolved
else
commit=$(git ls-remote https://github.com/rapidsai/"${repo}".git refs/heads/pull-request/"${pr}" | cut -c1-7)
fi

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

if [[ $3 == "cpp" ]]
then
rapids-get-artifact ci/"${repo}"/pull-request/"${pr}"/"${commit}"/"${repo}"_conda_cpp_cuda"${rapids_cuda_major}"_"$(arch)".tar.gz
elif [[ $3 == "python" ]]
rapids-get-artifact ci/"${repo}"/pull-request/"${pr}"/"${commit}"/"${repo}"_conda_python_cuda"${rapids_cuda_major}"_"${python_majorminor}"_"$(arch)".tar.gz
else
echo "Error: 3rd argument must be 'cpp' or 'python'"
exit 1
fi
Loading