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

Conversation

harrism
Copy link
Member

@harrism harrism commented Nov 9, 2023

I found myself creating a bunch of PRs to test downstream affects of an RMM PR on various RAPIDS repos. Each of these required a lot of boiler plate like the following to compute the path to a CI artifact from RMM and other dependent PRs (e.g. cuML depends on RMM and RAFT and CUDF).

REPO="rmm"
PR_NUMBER="1095"
COMMIT=$(git ls-remote https://github.com/rapidsai/${REPO}.git refs/heads/pull-request/${PR_NUMBER} | cut -c1-7)
RAPIDS_CUDA_MAJOR="${RAPIDS_CUDA_VERSION%%.*}"
PYTHON_MINOR_VERSION=$(python --version | sed -E 's/Python [0-9]+\.([0-9]+)\.[0-9]+/\1/g')
LIBRMM_CHANNEL=$(rapids-get-artifact ci/${REPO}/pull-request/${PR_NUMBER}/${COMMIT}/rmm_conda_cpp_cuda${RAPIDS_CUDA_MAJOR}_$(arch).tar.gz)
RMM_CHANNEL=$(rapids-get-artifact ci/${REPO}/pull-request/${PR_NUMBER}/${COMMIT}/rmm_conda_python_cuda${RAPIDS_CUDA_MAJOR}_3${PYTHON_MINOR_VERSION}_$(arch).tar.gz)

This PR adds a new gha-tools script to eliminate a lot of this boilerplate. Now you can do like this:

LIBRMM_CHANNEL=$(rapids-get-pr-conda-artifact rmm 1095 cpp)
RMM_CHANNEL=$(rapids-get-pr-conda-artifact rmm 1095 python)
LIBCUDF_CHANNEL=$(rapids-get-pr-conda-artifact cudf 14365 cpp)
CUDF_CHANNEL=$(rapids-get-pr-conda-artifact cudf 14365 python)

@harrism harrism changed the title New script to generate path to latest artifact given a repo and PR# New script to get latest artifact from a given repo PR Nov 9, 2023
tools/rapids-get-pr-artifact Outdated Show resolved Hide resolved
tools/rapids-get-pr-artifact Outdated Show resolved Hide resolved
tools/rapids-get-pr-artifact Outdated Show resolved Hide resolved
tools/rapids-get-pr-artifact Outdated Show resolved Hide resolved
tools/rapids-get-pr-artifact Outdated Show resolved Hide resolved
@harrism harrism changed the title New script to get latest artifact from a given repo PR New script to get latest conda artifact from a given repo PR Nov 9, 2023
@harrism
Copy link
Member Author

harrism commented Nov 13, 2023

Can someone /ok to test this?

@AyodeAwe
Copy link
Contributor

/ok to test

Copy link
Member

@ajschmidt8 ajschmidt8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocking merge while I leave some feedback

@ajschmidt8
Copy link
Member

blocking merge while I leave some feedback

The feedback I would've left would've touched the entire file. So I opted to just push a commit instead. Hope you don't mind Mark.

The commit I pushed consists of the following changes:

  • Uses rapids-package-name to compute the package name
  • Uses a case statement instead if if/elif for consistency with the other scripts in this repository
  • Switch the git command to use the gh CLI instead (it's a bit less verbose)

@ajschmidt8 ajschmidt8 merged commit f441379 into rapidsai:main Nov 13, 2023
1 check passed
@bdice
Copy link
Contributor

bdice commented Nov 13, 2023

Thanks @ajschmidt8!

ajschmidt8 added a commit to rapidsai/shared-workflows that referenced this pull request Nov 13, 2023
We recently added some functionality in rapidsai/gha-tools#85 that depends on the `gh` CLI, which depends on the `GH_TOKEN` variable being set in GHAs.

This PR adds the `GH_TOKEN` to our test workflows. It's already included in our build workflows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants