Skip to content

Commit

Permalink
do not require first arg to upload to be pkg_type
Browse files Browse the repository at this point in the history
  • Loading branch information
msarahan committed Apr 3, 2024
1 parent 7d65933 commit 93c5a5d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
15 changes: 7 additions & 8 deletions tools/rapids-download-wheels-from-s3
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ set -eo pipefail

source rapids-prompt-local-repo-config

# For legacy reasons, allow this script to be run without the pkg_type being the first arg
pkg_name="$(rapids-package-name "wheel_python")"

pkg_type="$1"
if [ "${pkg_type}" != "cpp" ] && [ "${pkg_type}" != "python" ]; then
rapids-echo-error "Wheel cpp packages are now supported."
rapids-echo-error "You must specify package type as the first argument to rapids-upload-wheels-to-s3"
if [ "${pkg_type}" = "cpp" ] && [ "${pkg_type}" = "python" ]; then
# remove pkg_type from args because we handle it in this script
shift;
pkg_name="$(rapids-package-name "wheel_${pkg_type}")"
fi

# remove pkg_type from args because we handle it in this script
shift;

pkg_name="$(rapids-package-name "wheel_${pkg_type}")"

rapids-download-from-s3 "${pkg_name}" "$@"
15 changes: 7 additions & 8 deletions tools/rapids-upload-wheels-to-s3
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,20 @@
# 1) wheel path to tar up
set -e

# For legacy reasons, allow this script to be run without the pkg_type being the first arg
pkg_name="$(rapids-package-name "wheel_python")"

pkg_type="$1"
if [ "${pkg_type}" != "cpp" ] && [ "${pkg_type}" != "python" ]; then
rapids-echo-error "Wheel cpp packages are now supported."
rapids-echo-error "You must specify package type as the first argument to rapids-upload-wheels-to-s3"
if [ "${pkg_type}" = "cpp" ] && [ "${pkg_type}" = "python" ]; then
# remove pkg_type from args because we handle it in this script
shift;
pkg_name="$(rapids-package-name "wheel_${pkg_type}")"
fi

# remove pkg_type from args because we handle it in this script
shift;

if [ "${CI:-false}" = "false" ]; then
rapids-echo-stderr "Packages from local builds cannot be uploaded to S3."
rapids-echo-stderr "Open a PR to have successful builds uploaded."
exit 0
fi

pkg_name="$(rapids-package-name "wheel_${pkg_type}")"

rapids-upload-to-s3 "${pkg_name}" "$@"

0 comments on commit 93c5a5d

Please sign in to comment.