Repository navigation
Add Github Run ID logic locally to pr scripts #165
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -23,20 +23,23 @@ commit="${4:-}" | |||||
|
|
||||||
| # If commit is not provided, get the latest commit on the PR | ||||||
| if [[ -z "${commit}" ]]; then | ||||||
| commit=$(rapids-retry gh pr view "${pr}" --repo rapidsai/"${repo}" --json headRefOid --jq '.headRefOid') | ||||||
| commit=$(git ls-remote https://github.com/rapidsai/"${repo}".git refs/heads/pull-request/"${pr}" | cut -f1) | ||||||
| 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}" | ||||||
| RAPIDS_REPOSITORY="rapidsai/${repo}" | ||||||
| RAPIDS_SHA="${commit}" | ||||||
| RAPIDS_REF_NAME="pull-request/${pr}" | ||||||
|
|
||||||
| # Generate the artifact name | ||||||
| artifact_name="$(RAPIDS_NO_PKG_EXTENSION=true rapids-package-name "conda_${package_type}")" | ||||||
| pkg_name="$(RAPIDS_NO_PKG_EXTENSION=true rapids-package-name "conda_${package_type}")" | ||||||
| github_run_id=$(gh run list --repo "${RAPIDS_REPOSITORY}" --branch "${RAPIDS_REF_NAME}" --commit "${RAPIDS_SHA}" --json databaseId --jq '.[0] | .databaseId') | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this need to use
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This PR (#164) changes the way Once those changes have been approved and merged, I will make those changes here. |
||||||
| unzip_dest="${RAPIDS_UNZIP_DIR:-$(mktemp -d)}" | ||||||
|
|
||||||
| unzip_dir=$(rapids-download-from-github "${artifact_name}") | ||||||
| echo -n "${unzip_dir}" | ||||||
| rapids-echo-stderr "Downloading and decompressing ${pkg_name} from Run ID ${github_run_id} into ${unzip_dest}" | ||||||
| rapids-retry gh run download "${github_run_id}" --repo "${RAPIDS_REPOSITORY}" --name "${pkg_name}" --dir "${unzip_dest}" | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so it seems like this is a workaround for the current behavior of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In Making this change here would be the best option for both Actions and for reproducing CI locally. |
||||||
|
|
||||||
| echo -n "${unzip_dest}" | ||||||
| ) | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this logic be refactored into a common file? See https://github.com/rapidsai/gha-tools/blob/main/tools/_rapids-download-from-s3 for an example.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's a great idea. Refactored the logic into a common file called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two seem the same -- is there a reason to change this and miss out on the retries?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refer to the comment above about the
rapids-retryPR. (#164).However, using gh lets us access PR artifacts from private repositories, so I will switch it back to using
ghpr view