Skip to content

Use twine to upload wheels #286

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

Merged
merged 2 commits into from
Mar 10, 2025

Conversation

KyleFromNVIDIA
Copy link
Member

@KyleFromNVIDIA KyleFromNVIDIA commented Feb 28, 2025

The gh-action-pypi-publish action is having problems with some repos. Try uploading with twine instead.

The `gh-action-pypi-publish` action does not officially support
self-hosted runners, so publish from a GitHub runner instead.

Resolves NVIDIA/numba-cuda#75
@KyleFromNVIDIA KyleFromNVIDIA requested a review from a team as a code owner February 28, 2025 18:11
@KyleFromNVIDIA KyleFromNVIDIA added bug Something isn't working non-breaking Introduces a non-breaking change labels Feb 28, 2025
@KyleFromNVIDIA KyleFromNVIDIA changed the title Publish wheels from ubuntu-latest Use twine to upload images Mar 10, 2025
Copy link
Member

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

The gh-action-pypi-publish action is having problems with some repos. Try uploading with twine instead.

What are the problems, specifically? I'd like to know that before reviewing.

@KyleFromNVIDIA
Copy link
Member Author

From https://github.com/rapidsai/pynvjitlink/actions/runs/13730908249/job/38407961979#step:9:106:

/pyenv/versions/3.12.9/bin/python3: can't open file '/home/runner/work/_actions/pypa/gh-action-pypi-publish/release/v1/create-docker-action.py': [Errno 2] No such file or directory

@jameslamb
Copy link
Member

Oh. I thought that specific problem was something we thought was related to running on self-hosted runners, and that we thought could be fixed by just switching to the GitHub Actions ubuntu-latest image.

I have one more idea we could try.... could we running pypa/gh-action-pypi-publish on ubuntu-latest and not in a container?

Removing this:

container:
# CUDA toolkit version of the container is irrelevant in the publish step.
# This just uploads already-built wheels to remote storage.
image: "rapidsai/ci-wheel:latest"
env:
RAPIDS_BUILD_TYPE: ${{ inputs.build_type }}

And then doing whatever's required to make the relevant bits of gha-tools work outside of one of our CI images.

I just searched around and found some discussion suggesting that this type of issue might be something known and related to how that action sets paths when run in a container:

@vyasr
Copy link
Contributor

vyasr commented Mar 10, 2025

Yes, James is right, see rapidsai/pynvjitlink#132 (comment) most recently.

@KyleFromNVIDIA
Copy link
Member Author

Even if we did move it outside of the container, there are still other issues, like the fact that we're using it from a reusable workflow. I think we should use twine instead.

@webknjaz
Copy link

Even if we did move it outside of the container, there are still other issues, like the fact that we're using it from a reusable workflow. I think we should use twine instead.

You can do that at the cost of losing the ability to

  1. do tokenless uploads (trusted publishing enables one to get rid of API tokens, so it's less secrets to maintain/scope/rotate)
  2. improve the supply chain situation through standardized digital signatures (PEP 740)
  3. display more bits of metadata as verified on the public PyPI project page

But even if you go this route, you can still improve security a little bit by storing the in-repo secrets within GitHub Environments scope as opposed to having them repo-global in the settings.

@jakirkham jakirkham changed the title Use twine to upload images Use twine to upload wheels Mar 10, 2025
Copy link
Contributor

@bdice bdice left a comment

Choose a reason for hiding this comment

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

This worked for the pynvjitlink 0.5.2 release! Approving.

@KyleFromNVIDIA KyleFromNVIDIA merged commit 1513a30 into branch-25.04 Mar 10, 2025
1 check passed
KyleFromNVIDIA added a commit to KyleFromNVIDIA/pynvjitlink that referenced this pull request Mar 10, 2025
With rapidsai/shared-workflows#286 merged,
we no longer need to use a test branch from shared-workflows.
jakirkham pushed a commit to rapidsai/pynvjitlink that referenced this pull request Mar 10, 2025
With rapidsai/shared-workflows#286 merged, we no
longer need to use a test branch from shared-workflows.

<!--

Thank you for contributing to pynvjitlink :)

Here are some guidelines to help the review process go smoothly.

1. Please write a description in this text box of the changes that are
being
   made.

2. Please ensure that you have written units tests for the changes
made/features
   added.

3. If you are closing an issue please use one of the automatic closing
words as
noted here:
https://help.github.com/articles/closing-issues-using-keywords/

4. If your pull request is not ready for review but you want to make use
of the
continuous integration testing facilities please label it with `[WIP]`.

5. If your pull request is ready to be reviewed without requiring
additional
work on top of it, then remove the `[WIP]` label (if present) and
replace
it with `[REVIEW]`. If assistance is required to complete the
functionality,
for example when the C/C++ code of a feature is complete but Python
bindings
are still required, then add the label `[HELP-REQ]` so that others can
triage
and assist. The additional changes then can be implemented on top of the
same PR. If the assistance is done by members of the rapidsAI team, then
no
additional actions are required by the creator of the original PR for
this,
otherwise the original author of the PR needs to give permission to the
person(s) assisting to commit to their personal fork of the project. If
that
doesn't happen then a new PR based on the code of the original PR can be
opened by the person assisting, which then will be the PR that will be
   merged.

6. Once all work has been done and review has taken place please do not
add
features or make changes out of the scope of those requested by the
reviewer
(doing this just add delays as already reviewed code ends up having to
be
re-reviewed/it is hard to tell what is new etc!). Further, please do not
rebase your branch on main/force push/rewrite history, doing any of
these
   causes the context of any comments made by reviewers to be lost. If
   conflicts occur against main they should be resolved by merging main
   into the branch used for making the pull request.

Many thanks in advance for your cooperation!

-->
@jakirkham
Copy link
Member

Deleting publish-wheels-on-github-runners as it is no longer in use

(only pynvjitlink used and it has already switched back to branch-25.04)

Can always restore the branch if needed

@jakirkham jakirkham deleted the publish-wheels-on-github-runners branch March 10, 2025 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working non-breaking Introduces a non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants