Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

CI: caching: add early termination & run check on schedule #2506

Merged

Conversation

Anton-Latukha
Copy link
Collaborator

@Anton-Latukha Anton-Latukha commented Dec 18, 2021

This PR allows to forget about cache pool exhaustion through internal branches.

Despite caching workflow runs on master only, GitHub caching is designed such that every workflow run that uses the cache (test, bench) can also save cache into the pool of own git repo. Which means the changes to the project configuration files inside PRs would produce caches for PR, which when there is enough internal branches PRs activity would push master cache out of the 10G FIFO pool because GitHub removes from the pool by the creation time. While PR caches that would stay - have a sharing & access scope limited to the PRs they are built for.

Screenshot-2021-12-18-22:36:49

Removal of the master cache out of the pool means that cache that was shared for all PRs - no longer there, which ⇒ ∀ PRs to build & save their own cache - which creates the pool exhaustion & congestion problem.

For example: in #2502 https://github.com/haskell/haskell-language-server/runs/4571293708?check_suite_focus=true we see that master cache got pushed-out & see this situation.

afaik there is no way (documented one or more KISS/elegant one) to prioritize main branch cache better.

@Anton-Latukha Anton-Latukha force-pushed the 2021-12-18-keep-main-cache-by-schedule branch from 4b9f50e to a7a2e89 Compare December 18, 2021 21:07
@jneira

This comment has been minimized.

@Anton-Latukha

This comment has been minimized.

@jneira

This comment has been minimized.

@Anton-Latukha
Copy link
Collaborator Author

Yep. I became aware of the Windows caching problem & its cache somehow does not work properly. I think it is better to devote attention to it in #2507

@Anton-Latukha Anton-Latukha force-pushed the 2021-12-18-keep-main-cache-by-schedule branch 3 times, most recently from 338b3ed to 779fc5b Compare December 19, 2021 12:55
@Anton-Latukha Anton-Latukha changed the title CI: caching: build once a day CI: caching: add early termination & run check on schedule Dec 19, 2021
@Anton-Latukha
Copy link
Collaborator Author

Early termination is seen in: https://github.com/haskell/haskell-language-server/actions/runs/1598559261

Now removing the WIP PR hook.

@Anton-Latukha Anton-Latukha force-pushed the 2021-12-18-keep-main-cache-by-schedule branch from 779fc5b to 913a895 Compare December 19, 2021 13:04
@Anton-Latukha

This comment has been minimized.

@Anton-Latukha Anton-Latukha marked this pull request as ready for review December 19, 2021 15:30
@Anton-Latukha

This comment has been minimized.

@Anton-Latukha

This comment has been minimized.

@Anton-Latukha Anton-Latukha force-pushed the 2021-12-18-keep-main-cache-by-schedule branch from abb61bb to f8312b4 Compare December 19, 2021 18:24
Recently there is a lot of PRs/builds from internal repo branches. Repo cache
has 10G pool limit & PR caches are not shared between PRs, but main branch cache
is.

Checking & when missing rebuilding it ensures that if internal branch PRs pushed main state
out of the pool - it gets reinstituted.

*afaik* there is no way to prioritize main branch cache better, since GitHub CI
FIFO caches out of the pool by build time.
@Anton-Latukha Anton-Latukha force-pushed the 2021-12-18-keep-main-cache-by-schedule branch from f8312b4 to bab8157 Compare December 19, 2021 18:25
@Anton-Latukha Anton-Latukha requested a review from jneira December 19, 2021 18:26
Copy link
Member

@jneira jneira left a comment

Choose a reason for hiding this comment

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

great analysis and a pragmatic solution, thanks!

@jneira jneira added the merge me Label to trigger pull request merge label Dec 21, 2021
@Anton-Latukha
Copy link
Collaborator Author

Yep. 3 checks a day may seem excessive. Until some hackathon 8), or community growth.

Thank you 8)

@Anton-Latukha
Copy link
Collaborator Author

Anton-Latukha commented Dec 21, 2021

Restarted the checks to see caching at work.

We shortened the CI cycle by 50 minutes: https://github.com/haskell/haskell-language-server/runs/4591646270?check_suite_focus=true 🌀 🥳

@jneira
Copy link
Member

jneira commented Dec 21, 2021

really great news, love to see again a windows build of 6 min

@Anton-Latukha
Copy link
Collaborator Author

Anton-Latukha commented Dec 21, 2021

Yes, >2 hours cycles were very painful.

1:15 is much tolerable (these cycles feel very tolerable to me), now the person knows that basically in an hour testing would be done.

Would've been great to sneak favors from GitHub 😉.

@jneira
Copy link
Member

jneira commented Dec 21, 2021

Would've been great to sneak favors from GitHub wink.

I am on it 😄

@mergify mergify bot merged commit d1e6d3c into haskell:master Dec 21, 2021
@Anton-Latukha Anton-Latukha deleted the 2021-12-18-keep-main-cache-by-schedule branch December 21, 2021 10:12
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants