-
Notifications
You must be signed in to change notification settings - Fork 44
Provide a way to cache the installation #50
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
Comments
Afair we currently only cache the downloaded packages, which doesn't save much. The reinstall will always happen. |
Oh, are there reasons against caching the installations too? |
Assuming you install some software or change some files in the installation we'd restore that on the next run, but ideally a cache would be transparent. Ideas welcome. Think like you'd want to cache "/" in an Arch Linux install. |
I'll look into enabling package caching by default. That will at least avoid the confusion regarding the "cache" option we provide (by removing it..) |
As an end user who just uses MSYS2 to compile C files using CMake, I don't have too much knowledge about what paths there are overall. Thank you for looking into it! Really appreciated. |
Unless you install with it, no. It might still change /home and /tmp. Point is we can't cover all cases because the user can do everything. We'll probably have to expose the cache functionality to the user and let the user decide if and when keeping the whole directory around is OK. |
I've created #51 for removing the cache option |
I think a good strategy for a full install cache would be to expose a Open question if we go that way: "pacman -Scc" would be a good idea to clear the package cache, so we don't cache twice. And maybe we should nuke /home on restore? And what to do if an update after the cache restore fails? Maybe then just nuke everything and start new. -> all in all, tricky, but not impossible. |
Sounds good, I guess in my use case I would just pick a constant key like |
Yeah, probably. Or include the architecture if you want a separate cache for 32bit and 64bit etc. @eine any thoughts on my suggestion #50 (comment) ? |
I'm not sure... My initial try was to use a single key and retrieve/update it every time. That didn't work. Then, I thought about letting users specify a key. But that was not intuitive. The point, as commented in #23, is that it seems not possible to share a cache between jobs or workflows. It is neither possible to update a key. Hence, I don't know what's the namespace where the keys are being used. That is, I have no idea if the cache that is restored makes any sense. |
I got confused again with my comments above.. we store the cache before anything uses it, and not after, so we have perfect control of what we store anyway, so please forget everything I said :/ Re sharing: Based on my experiments in #51 sharing caches between different jobs works fine. Here is one run that gets a cache from a different config: https://github.com/msys2/setup-msys2/runs/888874485?check_suite_focus=true According to https://docs.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache caches can also be read from PRs, but updates will be created in the PR scope. Re key: I think the current approach is similar to what we'd need: Have one key which is used as a restore and one that is unique. The restore should be a combination of all settings, the action version, the installer URL, so you can be sure you just get an older version of a "similar" run. For the unique key we can hash |
@lazka, as far as I understand the proposal is to cache the installed dependencies. Does that mean caching |
Yeah, that's what I had in mind by adding "the installer URL". |
I like it, specially because retrieving the full installation from the cache will significantly reduce the traffic in msys2's servers. Users will retrieve the installer once only. Do you want to prototype it in a PR and I will release a "temporal" branch for users to try before merging it to master? |
I'll open a PR once I have something, not sure re branches, let's see how it works out. |
In case release=true we try to cache the whole installation. As cache restore key we use the whole input + the installer checksum, so we only get a similar setup back. For saving we hash the content of /var/lib/pacman/local which contains all the info about which packages are installed. Fixes msys2#50
In case release=true we try to cache the whole installation. As cache restore key we use the whole input + the installer checksum, so we only get a similar setup back. For saving we hash the content of /var/lib/pacman/local which contains all the info about which packages are installed. Fixes msys2#50
In case release=true we try to cache the whole installation. As cache restore key we use the whole input + the installer checksum, so we only get a similar setup back. For saving we hash the content of /var/lib/pacman/local which contains all the info about which packages are installed. Fixes msys2#50
In case release=true we try to cache the whole installation. As cache restore key we use the whole input + the installer checksum, so we only get a similar setup back. For saving we hash the content of /var/lib/pacman/local which contains all the info about which packages are installed. Fixes msys2#50
In case release=true we try to cache the whole installation. As cache restore key we use the whole input + the installer checksum, so we only get a similar setup back. For saving we hash the content of /var/lib/pacman/local which contains all the info about which packages are installed. Fixes msys2#50
In case release=true we try to cache the whole installation. As cache restore key we use the whole input + the installer checksum, so we only get a similar setup back. For saving we hash the content of /var/lib/pacman/local which contains all the info about which packages are installed. Fixes msys2#50
In case release=true we try to cache the whole installation. As cache restore key we use the whole input + the installer checksum, so we only get a similar setup back. For saving we hash the content of /var/lib/pacman/local which contains all the info about which packages are installed. Fixes msys2#50
In case release=true we try to cache the whole installation. As cache restore key we use the whole input + the installer checksum, so we only get a similar setup back. For saving we hash the content of /var/lib/pacman/local which contains all the info about which packages are installed. Fixes msys2#50
In case release=true we try to cache the whole installation. As cache restore key we use the whole input + the installer checksum, so we only get a similar setup back. For saving we hash the content of /var/lib/pacman/local which contains all the info about which packages are installed. Fixes msys2#50
In case release=true we try to cache the whole installation. As cache restore key we use the whole input + the installer checksum, so we only get a similar setup back. For saving we hash the content of /var/lib/pacman/local which contains all the info about which packages are installed. Fixes #50
Is there any sample on this? |
@tavrez, caching of packages is done by default. What do you mean with "a sample"? |
I thought we can use actions/cache with proper keys to cache the whole setup process, and wanted to see a sample workflow with setup-msys2 and cache with keys and cache folders |
Since June (see https://github.com/msys2/setup-msys2/blob/master/CHANGELOG.md#110---20200605) the packages are cached by default (using actions/cache) (see #51, #54). For some time, both packages and the full installation were cached. However, there were some issues with lost files (#61), and we decided to disable it (temporaly, at least) (see #63). As a result, this action is already caching as much of the setup as possible, there is no need for users to handle keys and folders explicitly. See, for example: https://github.com/ghdl/ghdl/runs/1170192304?check_suite_focus=true#step:2:104. You see a similar output anywhere you use this action as explained in Usage. Is there some specific use case that we are not covering yet? |
Thanks for clarification.
I'll report if I found anything |
I currently have the workflow file below. Now I am still fiddling with it and whenever I add or change a step that is even unrelated to the
msys2/setup-msys2
step, in the next run this action will still redownload and reinstall all packages.The text was updated successfully, but these errors were encountered: