Skip to content

Conversation

Dreamsorcerer
Copy link
Member

No description provided.

@Dreamsorcerer Dreamsorcerer requested a review from webknjaz as a code owner July 27, 2023 23:45
@Dreamsorcerer Dreamsorcerer added bot:chronographer:skip This PR does not need to include a change note backport-3.9 labels Jul 27, 2023
@webknjaz
Copy link
Member

I remember avoiding this because of some quirks. But can't recall why exactly.. I'll try to look into this.

@Dreamsorcerer
Copy link
Member Author

OK, on other repos the cache wasn't working correctly with the old cache action, and setup-python worked first time (I think it's aiohttp-demos which takes about 10 mins extra without caching).

@webknjaz
Copy link
Member

@Dreamsorcerer

OK, on other repos the cache wasn't working correctly with the old cache action

One common mistake is making checkout prior to invoking cache. Check for that first.

I remember avoiding this because of some quirks. But can't recall why exactly.. I'll try to look into this.

I tried to recall what were the corner cases. And I found two:

  1. Skipping caching for release CI/CD invocations — this allows to catch weird cases that don't come up in PRs because they use older versions of packages, for example: https://github.com/cherrypy/cheroot/blob/0fd16f0/.github/workflows/ci-cd.yml#L246-L247
  2. Skipping caching for unstable/nightly/dev Python jobs, especially in the period when CPython transitions between alpha/beta/rc. This is because older package versions may be picked up by pip earlier and the, they'd break when GitHub updates their CPython alpha build but the cached packages aren't updated. Example: https://github.com/cherrypy/cheroot/blob/0fd16f0/.github/workflows/ci-cd.yml#L717-L775.

@webknjaz
Copy link
Member

FTR, the caching works as it is configured today: https://github.com/aio-libs/aiohttp/actions/runs/7688751163/job/20950541567#step:5:25.

It doesn't implement those stable ABI-conditional hacks, though. Would be nice to have them here too.

@bdraco bdraco force-pushed the Dreamsorcerer-patch-2 branch from c1a9e4b to ad21bc0 Compare November 9, 2024 20:02
key: pip-ci-${{ runner.os }}-${{ matrix.pyver }}-${{ matrix.no-extensions }}-${{ hashFiles('requirements/*.txt') }}
path: ${{ steps.pip-cache.outputs.dir }}
restore-keys: |
pip-ci-${{ runner.os }}-${{ matrix.pyver }}-${{ matrix.no-extensions }}-
Copy link
Member

Choose a reason for hiding this comment

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

I'm worried it won't take matrix.no-extensions into consideration

Copy link
Member

Choose a reason for hiding this comment

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

When it runs I think we can look at the cache key it generates and see if it has no-ext

Copy link

codspeed-hq bot commented Nov 9, 2024

CodSpeed Performance Report

Merging #7442 will not alter performance

Comparing Dreamsorcerer-patch-2 (ad21bc0) with master (5a1c3be)

Summary

✅ 14 untouched benchmarks

@bdraco
Copy link
Member

bdraco commented Nov 9, 2024

Test (3.13, Y, ubuntu, false)
setup-python-Linux-x64-22.04-Ubuntu-python-3.13.0-pip-16df3627115a202aec77821077e7df01ad7900a81e1096da766b5297341a202b

Test (3.13, ubuntu, false)
setup-python-Linux-x64-22.04-Ubuntu-python-3.13.0-pip-16df3627115a202aec77821077e7df01ad7900a81e1096da766b5297341a202b

no-extensions isn't considered in the cache key

Copy link

codecov bot commented Nov 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.67%. Comparing base (5a1c3be) to head (ad21bc0).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7442      +/-   ##
==========================================
+ Coverage   98.65%   98.67%   +0.01%     
==========================================
  Files         117      117              
  Lines       35893    35893              
  Branches     4260     4260              
==========================================
+ Hits        35410    35417       +7     
+ Misses        324      320       -4     
+ Partials      159      156       -3     
Flag Coverage Δ
CI-GHA 98.56% <ø> (+0.01%) ⬆️
OS-Linux 98.24% <ø> (+0.10%) ⬆️
OS-Windows 96.01% <ø> (+0.09%) ⬆️
OS-macOS 97.31% <ø> (ø)
Py-3.10.11 97.16% <ø> (-0.01%) ⬇️
Py-3.10.15 97.72% <ø> (ø)
Py-3.11.10 97.76% <ø> (-0.01%) ⬇️
Py-3.11.9 97.21% <ø> (-0.01%) ⬇️
Py-3.12.7 98.31% <ø> (ø)
Py-3.13.0 98.30% <ø> (+0.28%) ⬆️
Py-3.9.13 97.08% <ø> (+0.30%) ⬆️
Py-3.9.20 97.68% <ø> (?)
Py-pypy7.3.16 97.25% <ø> (?)
VM-macos 97.31% <ø> (ø)
VM-ubuntu 98.24% <ø> (+0.10%) ⬆️
VM-windows 96.01% <ø> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@webknjaz
Copy link
Member

no-extensions isn't considered in the cache key

Is that important, though? Wouldn't the deps be mostly the same in both cases?

@webknjaz
Copy link
Member

@Dreamsorcerer I finally have the preferred solution to show: aio-libs/frozenlist#622. Let's replicate it instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:skip This PR does not need to include a change note
Projects
Development

Successfully merging this pull request may close these issues.

3 participants