Skip to content

Conversation

@cderv
Copy link
Collaborator

@cderv cderv commented Feb 18, 2025

save-always is deprecated, and now it needs to be a two step process: restore and save

based on adaptation at r-lib/actions/setup-renv in r-lib/actions@108c7a6

@cderv
Copy link
Collaborator Author

cderv commented Feb 18, 2025

It seems new cache API has changed a few things as we are hitting this issue

with

  • my first attempt : 7aad8ed
  • Julia cache action

I subscribed to upstream issue and we'll see.

Restoring and saving cache seems to have become more complicated, especially when a new cache key will be necessary. As we are running multiple workflow in parallel, in case of new cache

  • They all have a cache not found at restore
  • So they will all try to save cache at save state but...
  • ...cache can be created once and otherwise it will fail with warning.

Not a problem to have a working workflow but a lot of noise as Warning in log 😞

Let's see if they can improve this - I may find a workaround otherwise.

@cderv
Copy link
Collaborator Author

cderv commented Feb 19, 2025

This PR also try to fix Typst caching. The new cache API in github does not allow to save always the cache as before. It is now immutable and can't be updated.

So this needs to be improved for more efficiency.

Or we need to delete cache more regularly. I'll see later.

@cderv cderv changed the title gha - adapt renv cache saving to new actions/cache@v4 gha - adapt cache saving to new actions/cache@v4 Feb 19, 2025
@cderv cderv marked this pull request as ready for review February 19, 2025 17:44
`save-always` is deprecated, and now it needs to be a two step process: restore and save

based on adaptation at r-lib/actions/setup-renv in r-lib/actions@108c7a6

gha - new cache does not allow overwrite

and it does not deal with skipping existing cache.

So it is a bit different that `save-always`. Cache will only be updated when renv.lock changes
with new cache we can't alway save the cache anymore without removing previous one.

This means typst caching is way less efficient than designed initially. This change will allow to use the cache, but it will require manual update of the id to trigger a new caching
This reverts commit 210961e.

Julia cache is required to speed up each job. However, the caching mechanism is still a problem as it will throw a warning for each other job than the one which managed to save with action v4

Saving a cache for each buckets would be too heavy in total storage (we are limited to 10Go).
@cderv
Copy link
Collaborator Author

cderv commented Feb 20, 2025

So we get those warning
image

quite verbose because of what is discussed at actions/cache#1541

We'll live with that until I managed to improve it

@cderv cderv merged commit 46d71b0 into main Feb 20, 2025
47 checks passed
@cderv cderv deleted the gha/cache-update branch February 20, 2025 12:59
cderv added a commit that referenced this pull request Feb 20, 2025
(cherry picked from commit 46d71b0)

from #12108 (quarto-dev/gha/cache-update)

# Conflicts:
#	.github/actions/cache-typst/action.yml
#	.github/workflows/test-smokes.yml
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.

2 participants