Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b6fb6b1
added tools for Github artifact download
jayavenkatesh19 Feb 5, 2025
5b325b4
made changes to download scripts
jayavenkatesh19 Feb 5, 2025
e2aa648
Update release.yaml to generate releases on fork
jayavenkatesh19 Feb 6, 2025
9a86d12
Update release.yaml to run release action
jayavenkatesh19 Feb 6, 2025
c40dbe5
made files executable
jayavenkatesh19 Feb 6, 2025
e2d6ebd
fixed error in download script
jayavenkatesh19 Feb 6, 2025
a745ffb
fixed error in run-id script
jayavenkatesh19 Feb 6, 2025
3006ba4
added wheel download script
jayavenkatesh19 Feb 11, 2025
d115043
Merge branch 'main' into test-github-artifacts
jayavenkatesh19 Feb 11, 2025
f193a1b
Merge remote-tracking branch 'origin/main' into test-github-artifacts
jayavenkatesh19 Feb 19, 2025
16ef8c0
add newlines at the end
jayavenkatesh19 Feb 19, 2025
5cf9875
added support for PR artifact downloads from Github
jayavenkatesh19 Feb 28, 2025
6d5f691
Merge remote-tracking branch 'origin/main' into test-github-artifacts
jayavenkatesh19 Mar 10, 2025
92b5e11
made changes to comments and revert package name to use .tar.gz
jayavenkatesh19 Mar 11, 2025
b9202b1
reverted ci workflow
jayavenkatesh19 Mar 11, 2025
5ee86fc
added newline at the end
jayavenkatesh19 Mar 11, 2025
af2e8df
fixed newline in release.yaml
jayavenkatesh19 Mar 11, 2025
cb79a11
added double-quotes for shellchecker
jayavenkatesh19 Mar 11, 2025
feb6f30
made files executable
jayavenkatesh19 Mar 11, 2025
d1bbfd7
made changes as per code review
jayavenkatesh19 Mar 12, 2025
a2cd7a2
use ghcli to get latest commit
jayavenkatesh19 Mar 12, 2025
9458fc1
made changes as per review comments
jayavenkatesh19 Mar 13, 2025
ac1067a
added flag to remove .tar.gz extension
jayavenkatesh19 Mar 14, 2025
d8056d7
added double quotes to prevent globbing
jayavenkatesh19 Mar 14, 2025
b4b0fbb
Update tools/rapids-get-pr-wheel-artifact-github
jayavenkatesh19 Mar 14, 2025
32eca28
added download string to rapids-logger
jayavenkatesh19 Mar 14, 2025
578ad3c
switched logger back to stderr
jayavenkatesh19 Mar 14, 2025
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
24 changes: 24 additions & 0 deletions tools/rapids-download-conda-from-github
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# A utility script that downloads a conda artifact archive from Github Artifacts, unzips it,
# and returns the path to the directory where it was unzipped.
# Positional Arguments:
# 1) a string of "cpp" or "python" which determines which conda artifact
# should be downloaded
set -euo pipefail
export RAPIDS_SCRIPT_NAME="rapids-download-conda-from-github"

source rapids-prompt-local-repo-config

# Validate package type argument
pkg_type="$1"
case "${pkg_type}" in
cpp|python)
pkg_name="$(rapids-package-name "conda_${pkg_type}")"
;;
*)
rapids-echo-stderr 'Pass "cpp" or "python" as an argument.'
exit 1
;;
esac
Comment thread
jayavenkatesh19 marked this conversation as resolved.
Resolved

rapids-download-from-github "${pkg_name}"
21 changes: 21 additions & 0 deletions tools/rapids-download-from-github
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
# A utility script that downloads an artifact from Github Artifacts, unzips it to a temporary directory,
# and prints the location where it was unzipped.
# Positional Arguments:
# 1) package name to download from Github Artifacts
set -euo pipefail
export RAPIDS_SCRIPT_NAME="rapids-download-from-github"

if [ -z "$1" ]; then
rapids-echo-stderr "Must specify input arguments: PKG_NAME"
exit 1
fi

github_run_id="$(rapids-github-run-id)"
Comment thread
jayavenkatesh19 marked this conversation as resolved.
Resolved
pkg_name="$1"
unzip_dest="${RAPIDS_UNZIP_DIR:-$(mktemp -d)}"

rapids-echo-stderr "Downloading and decompressing ${pkg_name} from Run ID ${github_run_id} into ${unzip_dest}"
Comment thread
gforsyth marked this conversation as resolved.
Resolved
gh run download "${github_run_id}" --repo "${RAPIDS_REPOSITORY}" --name "${pkg_name}" --dir "${unzip_dest}"

echo -n "${unzip_dest}"
24 changes: 24 additions & 0 deletions tools/rapids-download-wheels-from-github
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
# A utility script that downloads a wheel artifact archive from Github Artifacts, unzips it,
# and returns the path to the directory where it was unzipped.
# Positional Arguments:
# 1) a string of "cpp" or "python" which determines which wheel artifact
# should be downloaded
set -eo pipefail
export RAPIDS_SCRIPT_NAME="rapids-download-wheels-from-github"

source rapids-prompt-local-repo-config

# Validate package type argument
pkg_type="$1"
case "${pkg_type}" in
cpp|python)
pkg_name="$(rapids-package-name "wheel_${pkg_type}")"
;;
*)
rapids-echo-stderr 'Pass "cpp" or "python" as an argument.'
exit 1
;;
esac

rapids-download-from-github "${pkg_name}"
42 changes: 42 additions & 0 deletions tools/rapids-get-pr-conda-artifact-github
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
# Downloads and decompresses a conda artifact for a specific PR from GitHub Artifacts.
# Finds and uses the latest commit on the PR.
#
# Positional Arguments:
# 1) repo name
# 2) PR number
# 3) "cpp" or "python", to get the conda artifact for the C++ or Python build, respectively
# 4) [optional] commit hash, to get the conda artifact for a specific commit
#
# Optional Environment Variables:
# RAPIDS_UNZIP_DIR: directory to unzip the conda artifact into
#
# Example Usage:
# rapids-get-pr-conda-artifact-github rmm 1095 cpp
set -euo pipefail
export RAPIDS_SCRIPT_NAME="rapids-get-pr-conda-artifact-github"

repo="${1}"
pr="${2}"
package_type="${3}"
commit="${4:-}"

# If commit is not provided, get the latest commit on the PR
if [[ -z "${commit}" ]]; then
commit=$(gh pr view "${pr}" --repo rapidsai/"${repo}" --json headRefOid --jq '.headRefOid[0:7]')
fi

# Use a subshell to isolate environment variable changes
(
# Set up environment variables needed for GitHub artifact download
export RAPIDS_REPOSITORY="rapidsai/${repo}"
export RAPIDS_BUILD_TYPE="pull-request"
export RAPIDS_SHA="${commit}"
export RAPIDS_REF_NAME="pull-request/${pr}"

# Generate the artifact name
artifact_name=$(rapids-package-name "conda_${package_type}")

unzip_dir=$(rapids-download-from-github "${artifact_name}")
echo -n "${unzip_dir}"
)
48 changes: 48 additions & 0 deletions tools/rapids-get-pr-wheel-artifact-github
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash
# Downloads and decompresses a wheel artifact for a specific PR from GitHub Artifacts.
# Finds and uses the latest commit on the PR.
#
# Positional Arguments:
# 1) repo name
# 2) PR number
# 3) "cpp" or "python", to get the wheel artifact for the C++ or Python build, respectively
# 4) [optional] commit hash, to get the wheel artifact for a specific commit
#
# Optional Environment Variables:
# RAPIDS_UNZIP_DIR: directory to unzip the wheel artifact into
#
# Example Usage:
# rapids-get-pr-wheel-artifact-github rmm 1095 cpp
set -euo pipefail
export RAPIDS_SCRIPT_NAME="rapids-get-pr-wheel-artifact-github"

repo="${1}"
pr="${2}"
package_type="${3}"
commit="${4:-}"

# Check if RAPIDS_PY_WHEEL_NAME is set when fetching a wheel
if [[ -z "${RAPIDS_PY_WHEEL_NAME}" ]]; then
echo "The RAPIDS_PY_WHEEL_NAME variable must be set when fetching a wheel artifact"
Comment thread
jayavenkatesh19 marked this conversation as resolved.
Resolved
exit 1
fi

# If commit is not provided, get the latest commit on the PR
if [[ -z "${commit}" ]]; then
commit=$(gh pr view "${pr}" --repo rapidsai/"${repo}" --json headRefOid --jq '.headRefOid[0:7]')
fi

# Use a subshell to isolate environment variable changes
(
# Set up environment variables needed for GitHub artifact download
export RAPIDS_REPOSITORY="rapidsai/${repo}"
export RAPIDS_BUILD_TYPE="pull-request"
export RAPIDS_SHA="${commit}"
export RAPIDS_REF_NAME="pull-request/${pr}"

# Generate the artifact name
artifact_name=$(rapids-package-name "wheel_${package_type}")

unzip_dir=$(rapids-download-from-github "${artifact_name}")
echo -n "${unzip_dir}"
)
19 changes: 19 additions & 0 deletions tools/rapids-github-run-id
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
# A utility script that examines environment variables provided
# by GitHub Actions to print out a Github Workflow Run ID where the expected artifact
# should be.
set -euo pipefail
export RAPIDS_SCRIPT_NAME="rapids-github-run-id"

# While called by CI, all the environment variables are set by the caller. However when run locally, these environment variables are set by rapids-prompt-local-repo-config
case "${RAPIDS_BUILD_TYPE}" in
pull-request|branch|nightly)
run_id=$(gh run list --repo "${RAPIDS_REPOSITORY}" --branch "${RAPIDS_REF_NAME}" --commit "${RAPIDS_SHA}" --json databaseId --jq '.[0] | .databaseId')
;;
*)
rapids-echo-stderr "please pass a valid RAPIDS_BUILD_TYPE"
exit 1
;;
esac
Comment thread
jayavenkatesh19 marked this conversation as resolved.
Resolved

echo -n "${run_id}"