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

[Python] Uploading nightly wheels to the scientific python nightly channel #40216

Closed
jarrodmillman opened this issue Feb 23, 2024 · 52 comments
Closed

Comments

@jarrodmillman
Copy link

jarrodmillman commented Feb 23, 2024

Describe the enhancement requested

It looks like you already build nightly Python wheels:

Would you be interested/willing to upload nightly wheels to he scientific-python nightly channel instead:

This would make the wheels easier to discover by hosting them in a "standard" place. It will also make it easier for downstream projects to test against multiple packages, since they won't need to specify multiple locations in their CI scripts.

You can read more about why and how we are building / testing against nightly wheels here:
https://scientific-python.org/specs/spec-0004/

We also provide a GitHub action to upload and manage nightly builds:
https://github.com/scientific-python/upload-nightly-action/

We @matthewfeickert, @larsoner, @tupui are happy to help.

Component(s)

Python

Linked PRs

@jorisvandenbossche
Copy link
Member

cc @raulcd

This sounds as an interesting idea to me. My understanding is that our nightly wheels are not "official" release artifacts anyway, so it shouldn't matter too much where it is hosted? (also not sure if the current hosting location is actually tied to the Apache foundation)

I suppose the main cost is the cost of switching for current users of this (and for them to first find out that the old link no longer gives them the latest packages, at the time we would decide to stop uploading there as well)

@jorisvandenbossche jorisvandenbossche changed the title Uploading nightly wheels to the scientific python nightly channel [Python] Uploading nightly wheels to the scientific python nightly channel Feb 28, 2024
@matthewfeickert
Copy link

👋 @jorisvandenbossche Just wanted to see if the team had any further thoughts on this. Let us know if we can help answer any questions.

@raulcd
Copy link
Member

raulcd commented Mar 25, 2024

We probably could upload wheels to both places. In terms of discoverability we have to advise to users that the wheels provided are not official releases and should be used at their own risk. Similar to what we have at the documentation:
These packages are not official releases. Use them at your own risk.
This is because the Apache Release Policy (https://www.apache.org/legal/release-policy.html#what) says:

During the process of developing software and preparing a release, various packages are made available to the developer community for testing purposes. Do not include any links on the project website that might encourage non-developers to download and use nightly builds, snapshots, release candidates, or any other similar package. The only people who are supposed to know about such packages are the people following the dev list (or searching its archives) and thus aware of the conditions placed on the package. If you find that the general public are downloading such test packages, then remove them.

I think we are ok publishing the nightly wheels under the scientific python nightly channel.

@matthewfeickert
Copy link

matthewfeickert commented Mar 25, 2024

I think we are ok publishing the nightly wheels under the scientific python nightly channel.

@raulcd Great! To move forward we need someone in the Arrow organization to do the following:

image

If you'd also like to use the scientific/upload-nightly-action GitHub Action please check out the action repo's README. If you need to collect wheels from different CI jobs, consider creating a new GitHub Actions workflow with logic similar to matplotlib's or Awkward's.

@kou
Copy link
Member

kou commented Mar 26, 2024

Could you add me https://anaconda.org/ktou/ to the pyarrow team "Group" too?

@matthewfeickert
Copy link

@kou done. As soon as you generate an API token you can start uploading to https://anaconda.org/scientific-python-nightly-wheels/pyarrow. 👍 Let's leave this Issue open though until the first automated CI/CD upload passes.

@kou
Copy link
Member

kou commented Mar 27, 2024

Thanks! I confirmed that I'm a member of the group.

@assignUser We need to ask INFRA to set ANACONDA_ORG_UPLOAD_TOKEN secret to our GitHub Actions. Could you also join the group, generate your API token and ask INFRA to set ANACONDA_ORG_UPLOAD_TOKEN?

@matthewfeickert
Copy link

Could you also join the group, generate your API token and ask INFRA to set ANACONDA_ORG_UPLOAD_TOKEN?

@assignUser Can you also share your Anaconda Cloud account name so I can add you to the pyarrow group?

@assignUser
Copy link
Member

@matthewfeickert Sorry I missed the notifications 🙈 https://anaconda.org/assignuser

@matthewfeickert
Copy link

@assignUser added. 👍

@assignUser
Copy link
Member

I'll take care of adding the token with infra

@assignUser
Copy link
Member

@assignUser
Copy link
Member

@kou infra just added the secret so we can create a workflow (will close the ticket once we can confirm it works)

@kou
Copy link
Member

kou commented Apr 9, 2024

Thanks!

@assignUser
Copy link
Member

INFRA will add the secret but with a ARROW_ prefix for organizational reasons, as we have to pull it into an envar anyway it shouldn't matter.

@matthewfeickert
Copy link

INFRA will add the secret but with a ARROW_ prefix for organizational reasons

That's totally fine. The secret name is arbitrary even if the GitHub Actions uploaded is used, but I just suggest a name to keep it simple for people. 👍

@kou
Copy link
Member

kou commented Apr 11, 2024

OK. What is the next action then? We need to update our workflows?

@assignUser
Copy link
Member

assignUser commented Apr 11, 2024

@kou As far as I understand we need to create a workflow similiar to r_nightly.yml that collects the pyarrow wheels from crossbow and then uploads them to the anaconda channel using the new secret.

@matthewfeickert
Copy link

matthewfeickert commented Apr 11, 2024

we need to create a workflow similar to r_nightly.yml that collects the pyarrow wheels from crossbow and then uploads them to the anaconda channel using the new secret.

Yeah. #40216 (comment) has some linked examples of how other projects are doing this.

@kou
Copy link
Member

kou commented Apr 12, 2024

I see! Thanks!

@matthewfeickert
Copy link

👋 @kou @assignUser I just wanted to follow up on this to see if there are any questions on your end RE: getting deployments up.

@kou
Copy link
Member

kou commented May 23, 2024

@assignUser Can you work on this? Or should someone work on this?

@assignUser
Copy link
Member

@kou I won't get to it quickly but I can take a look 'soon'(tm), maybe @matthewfeickert would be interested in working on it? The way we generate the wheels is a bit complex but it seems you have looked into that already?

@matthewfeickert
Copy link

@assignUser Realistically I don't have time at the moment, given that summer is peak everything time for academia.

@jorisvandenbossche jorisvandenbossche added this to the 18.0.0 milestone Aug 1, 2024
@jorisvandenbossche
Copy link
Member

As far as I understand we need to create a workflow similiar to r_nightly.yml that collects the pyarrow wheels from crossbow and then uploads them to the anaconda channel using the new secret.

For uploading the wheels, we currently have the github_upload_gemfury github actions macro, that is used to upload the built nightly wheels directly from the jobs building and testing them, for example at

{{ macros.github_upload_gemfury("arrow/python/repaired_wheels/*.whl")|indent }}

We could do this with a similar approach adding an extra macro to upload the wheels to anaconda.org?
Or @assignUser is there a reason for (or advantage to) using an approach like r_nightly.yml collecting all artifacts and uploading from a run on this repo? (the file mention "Due to authorization requirements, this upload can't be done from the crossbow repository.", but is that because this one is syncing with nightlies.apache.org? Uploading to gemfury doesn't seem to have that issue)

mapleFU pushed a commit to mapleFU/arrow that referenced this issue Sep 3, 2024
… to scientific python channel on Anaconda (apache#43862)

### Rationale for this change

As discussed on the main issue is interesting for discoverability to have the wheels uploaded to the nightly channel.

### What changes are included in this PR?

Added macro to upload wheel to scientific python channel

### Are these changes tested?

Via archery

### Are there any user-facing changes?

No but nightly wheels will be available on scientific python channel
* GitHub Issue: apache#40216

Authored-by: Raúl Cumplido <[email protected]>
Signed-off-by: Jacob Wujciak-Jens <[email protected]>
mapleFU pushed a commit to mapleFU/arrow that referenced this issue Sep 3, 2024
… label of scientific-python-nightly-wheels channel (apache#43932)

### Rationale for this change

Small follow-up on apache#43862, correcting the `label` being used to upload the wheels. See apache#40216 (comment) for context.

* GitHub Issue: apache#40216

Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Joris Van den Bossche <[email protected]>
@raulcd
Copy link
Member

raulcd commented Sep 3, 2024

Some of the nightly wheels have also failed to upload similar to the failures that we found on the latest PR from @jorisvandenbossche :
wheel-macos-monterey-cp310-amd64
wheel-windows-cp310-amd64
wheel-windows-cp313-amd64
wheel-windows-cp39-amd64
Those errors might have been temporary network errors but we should monitor and maybe add some retry mechanism to the upload if this is common.

@matthewfeickert
Copy link

Quick comments as I'm in transit (sorry):

  • yes, if you want the dev label please add that in addition to main.

c.f. https://github.com/scientific-python/upload-nightly-action/blob/b3d150d89b9500cd5623f211d6214f1d8b50fac5/action.yml#L21-L24 and https://github.com/scientific-python/upload-nightly-action/blob/b3d150d89b9500cd5623f211d6214f1d8b50fac5/cmd.sh#L44-L53

  • In general we'd prefer to only upload wheels so that people using the index for testing don't accidentally run into situations in which they trigger a build from sdist.

@jorisvandenbossche
Copy link
Member

  • In general we'd prefer to only upload wheels so that people using the index for testing don't accidentally run into situations in which they trigger a build from sdist.

Opened a PR to remove the sdist uploading: #43943

raulcd pushed a commit that referenced this issue Sep 4, 2024
…thon nightly channel (only wheels) (#43943)

### Rationale for this change

See #40216 (comment) for context. It might be expected that the channel only holds wheels, to users (downstream projects' CI) would accidentally try build from the sdist (e.g. when a wheel is missing).

* GitHub Issue: #40216

Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
@raulcd
Copy link
Member

raulcd commented Sep 4, 2024

Issue resolved by pull request 43943
#43943

@raulcd raulcd closed this as completed Sep 4, 2024
@raulcd
Copy link
Member

raulcd commented Sep 4, 2024

With the latest changes I've closed the issue as done. Please re-open or open a new issue if any follow up is necessary.
Thanks @jorisvandenbossche for following this up!

zanmato1984 pushed a commit to zanmato1984/arrow that referenced this issue Sep 6, 2024
… to scientific python channel on Anaconda (apache#43862)

### Rationale for this change

As discussed on the main issue is interesting for discoverability to have the wheels uploaded to the nightly channel.

### What changes are included in this PR?

Added macro to upload wheel to scientific python channel

### Are these changes tested?

Via archery

### Are there any user-facing changes?

No but nightly wheels will be available on scientific python channel
* GitHub Issue: apache#40216

Authored-by: Raúl Cumplido <[email protected]>
Signed-off-by: Jacob Wujciak-Jens <[email protected]>
zanmato1984 pushed a commit to zanmato1984/arrow that referenced this issue Sep 6, 2024
… label of scientific-python-nightly-wheels channel (apache#43932)

### Rationale for this change

Small follow-up on apache#43862, correcting the `label` being used to upload the wheels. See apache#40216 (comment) for context.

* GitHub Issue: apache#40216

Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Joris Van den Bossche <[email protected]>
zanmato1984 pushed a commit to zanmato1984/arrow that referenced this issue Sep 6, 2024
…fic-python nightly channel (only wheels) (apache#43943)

### Rationale for this change

See apache#40216 (comment) for context. It might be expected that the channel only holds wheels, to users (downstream projects' CI) would accidentally try build from the sdist (e.g. when a wheel is missing).

* GitHub Issue: apache#40216

Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
khwilson pushed a commit to khwilson/arrow that referenced this issue Sep 14, 2024
… to scientific python channel on Anaconda (apache#43862)

### Rationale for this change

As discussed on the main issue is interesting for discoverability to have the wheels uploaded to the nightly channel.

### What changes are included in this PR?

Added macro to upload wheel to scientific python channel

### Are these changes tested?

Via archery

### Are there any user-facing changes?

No but nightly wheels will be available on scientific python channel
* GitHub Issue: apache#40216

Authored-by: Raúl Cumplido <[email protected]>
Signed-off-by: Jacob Wujciak-Jens <[email protected]>
khwilson pushed a commit to khwilson/arrow that referenced this issue Sep 14, 2024
… label of scientific-python-nightly-wheels channel (apache#43932)

### Rationale for this change

Small follow-up on apache#43862, correcting the `label` being used to upload the wheels. See apache#40216 (comment) for context.

* GitHub Issue: apache#40216

Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Joris Van den Bossche <[email protected]>
khwilson pushed a commit to khwilson/arrow that referenced this issue Sep 14, 2024
…fic-python nightly channel (only wheels) (apache#43943)

### Rationale for this change

See apache#40216 (comment) for context. It might be expected that the channel only holds wheels, to users (downstream projects' CI) would accidentally try build from the sdist (e.g. when a wheel is missing).

* GitHub Issue: apache#40216

Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
@larsoner
Copy link

There are no longer any Windows wheels up at https://pypi.anaconda.org/scientific-python-nightly-wheels/simple/pyarrow/ , is this intentional? At least I think there used to be Windows wheels

@assignUser
Copy link
Member

Looks like the windows nightly builds have failed for a few days and the channel is removing old files?

@larsoner
Copy link

Yeah I know there is some removal policy, I thought it was a month but I could be wrong (and it might also be per-project configurable, not sure!). A few days seems like too short a removal period in any case.

@matthewfeickert
Copy link

matthewfeickert commented Feb 24, 2025

Yeah I know there is some removal policy, I thought it was a month but I could be wrong

It is 30 days (c.f. https://github.com/scientific-python/upload-nightly-action/blob/07ba11e3fcd43a475f9f56a9b06555aa2c621136/.github/workflows/remove-wheels.yml#L61-L66)

(and it might also be per-project configurable, not sure!).

Currently, no. There is a "never delete anything" option, but the only project that had a good use case for that no longer needs it.

@raulcd
Copy link
Member

raulcd commented Feb 24, 2025

From my understanding there is still a max number of wheels allowed too, right? Taking into account all our different wheels (macos arm + x86_64, manylinux_2014 and manylinux_2_28 both for arm + x86_64 for Python versions from 3.9 to 3.13) we get about ~6 days of wheels. See the oldest ones here: https://anaconda.org/scientific-python-nightly-wheels/pyarrow/files?page=4
The Windows nightly jobs have failed for slightly longer so they've just been removed.

@matthewfeickert
Copy link

matthewfeickert commented Feb 24, 2025

From my understanding there is still a max number of wheels allowed too, right?

We don't impose a maximum number of artifacts. If any project takes up too much total storage we would look into how to reduce it, but the automatic removal workflow is meant to avoid this and also have "nightly" mean something relatively recent.

Taking into account all our different wheels (macos arm + x86_64, manylinux_2014 and manylinux_2_28 both for arm + x86_64 for Python versions from 3.9 to 3.13) we get about ~6 days of wheels.

I assume (don't have time to check) you're just seeing that we also keep only the last 5 uploads by default:

https://github.com/scientific-python/upload-nightly-action/blob/07ba11e3fcd43a475f9f56a9b06555aa2c621136/.github/workflows/remove-wheels.yml#L19

again, focusing on "nightly".

@kou
Copy link
Member

kou commented Feb 24, 2025

Our nightly Windows wheel builds are broken recently. (They will be fixed by #45442.)

Is it related?

@raulcd
Copy link
Member

raulcd commented Feb 25, 2025

I assume (don't have time to check) you're just seeing that we also keep only the last 5 uploads by default:

If I understand correctly that snippet on the GH actions if we upload a single wheel with a newer version, all wheels that have an older than 5 versions will be removed. That seems to match what we are seeing, we are still uploading newer wheels but the Windows wheels stopped to be uploaded 15 days ago due to CI failures.

Our nightly Windows wheel builds are broken recently. (They will be fixed by #45442.) Is it related?

Yes, it will be fixed today but it's more to understand when are those removed as this is the second time that something like this happens.

@matthewfeickert
Copy link

If I understand correctly that snippet on the GH actions if we upload a single wheel with a newer version, all wheels that have an older than 5 versions will be removed.

@raulcd Yes. Within 24 hours of an upload the CI will trim it down to 5 versions max (so you can have more than up there for a brief period).

I see that PR #45442 has been merged now (👍). Let us know if in the next automated upload the Windows wheels aren't restored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants