8000 Prune conda nightlies on release by charlesbluca · Pull Request #11294 · dask/dask · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Prune conda nightlies on release #11294

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

charlesbluca
Copy link
Member

Contributes to dask/community#394

This PR makes the following changes to our conda nightly workflow:

  • on tag pushes that trigger the workflow, we now run anaconda remove dask/dask-core to prune out all existing nightlies prior to uploading a new one
  • adds a check_tag job, which is used to conditionally skip building/uploading on pushes to main that are tagged, since at this point the same workflow should've already been triggered by the tag push itself

Copy link
Contributor
github-actions bot commented Aug 9, 2024

Unit Test Results

See test report for an extended history of previous test failures. This is useful for diagnosing flaky tests.

     13 files  ± 0       13 suites  ±0   3h 3m 21s ⏱️ -55s
 13 174 tests + 1   12 118 ✅ +1   1 056 💤 ±0  0 ❌ ±0 
137 304 runs  +13  118 284 ✅ +9  19 020 💤 +4  0 ❌ ±0 

Results for commit 223b915. ± Comparison against base commit a747fd4.

♻️ This comment has been updated with latest results.

Copy link
Member
@jakirkham jakirkham left a comment

Choose a reason for hiding this comment

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

Thanks Charles! 🙏

Had a few questions below

@@ -38,6 +54,15 @@ jobs:
use-mamba: true
python-version: 3.9
channel-priority: strict
- name: Remove outdated conda nightlies
if: github.event_name == 'push' && github.repository == 'dask/dask' && startsWith(github.ref, 'refs/tags/')
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to check is_tagged_commit here as well? Or is that not needed for some reason?

Copy link
Member Author
@charlesbluca charlesbluca Sep 3, 2024

Choose a reason for hiding this comment

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

Or is that not needed for some reason?

At this point we should've already successfully prevented the race condition described in #11294 (comment), so think at this point the value of is_tagged_commit is interchangeable with that of startsWith(github.ref, 'refs/tags/'), such that we could represent this with something like

Suggested change
if: github.event_name == 'push' && github.repository == 'dask/dask' && startsWith(github.ref, 'refs/tags/')
if: github.event_name == 'push' && github.repository == 'dask/dask' && needs.check_tag.outputs.is_tagged_commit == 'true'

We should be good with what we have here, not sure if the suggestion would improve readability at all

@@ -4,7 +4,7 @@ on:
branches:
- main
tags:
- "*"
- "*.*.*"
Copy link
Member

Choose a reason for hiding this comment

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

Am curious why the additional .*s are needed now. Are there some cases we would like to filter out?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was just lifted from the on.push.tags block in the release publisher workflow - made this change to be in line with what we consider an event for a pushed "release" tag, but don't think it should be needed for the rest of these changes and can drop if that makes sense

Comment on lines +44 to +45
needs: check_tag
if: startsWith(github.ref, 'refs/tags/') || needs.check_tag.outputs.is_tagged_commit == 'false'
Copy link
Member

Choose a reason for hiding this comment

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

So this needs to be a tag or not? Is there a particular case we are trying to exclude here?

Copy link
Member Author

Choose a reason for hiding this comment

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

TLDR - this filters out branch push-triggered runs if we see the push was associated with a tag, since we already know this workflow was triggered by the corresponding tag push

Since #11014 there's been a race condition on release (which coincides with the push of a tagged commit) where this workflow is triggered twice for a branch and tag push and attempts to upload the same package twice. Consider these workflows for the 2024.8.1 release, one passing and one failing at the upload stage:

There are probably a few different ways to handle something like this, but I opted to check if the current HEAD is an exact match with a tag as a filtering condition to stop branch-triggered runs since at that point we know there's a corresponding tag triggered run, which we can now treat as the "definitive" run of this workflow on a release.

# install anaconda for removal
mamba install -c conda-forge anaconda-client

anaconda remove dask/dask-core --force
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to make sure the nightlies removed are older than a certain version? Or is that case unlikely to occur?

Copy link
Member Author

Choose a reason for hiding this comment

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

Definitely think if we wanted to, we could be explicit here and specify to remove all packages older than the current computed "nightly" version rather than everything, which could guard against the edge case that we somehow upload post-release nighties to the c 8000 hannel before the release workflow run is able to reach this point.

Were you thinking of any particular edge cases? In my head, I see the above case as niche enough that we'd probably not encounter even if we merged this in as is, but want to make sure I'm not missing a more crucial situation here

@rjzamora
Copy link
Member

Rerun tests

@rjzamora rjzamora mentioned this pull request Aug 23, 2024
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.

3 participants
0