Skip to content
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

Improve reuse of /compiled cache in CI #50667

Closed
7 of 8 tasks
IanButterworth opened this issue Jul 25, 2023 · 3 comments
Closed
7 of 8 tasks

Improve reuse of /compiled cache in CI #50667

IanButterworth opened this issue Jul 25, 2023 · 3 comments
Labels
domain:ci Continuous integration

Comments

@IanButterworth
Copy link
Sponsor Member

IanButterworth commented Jul 25, 2023

It would be nice to speed up julia CI startup time

Take GitHub julia CI, which typically

  • downloads any registries
  • downloads packages
  • downloads any artifacts
  • builds all packages
  • precompiles all packages with test args (--coverage and --check-bounds etc.)
  • runs tests

https://github.com/julia-actions/cache provides a way to cache useful parts of the depot between runs.

However two of the above are disabled by default:

I tried enabling caching of /compiled over at JuliaIO/PNGFiles.jl#66

However on the second run it hits re-precompilation for most of the packages because:

  1. pkgimages are disabled in the test environment due to coverage being on by default on julia-runtest
  2. We only ship julia with stdlib caches with pkgimages on (default and --check-bounds=yes)

i.e.

 Debug: Rejecting cache file /opt/hostedtoolcache/julia/1.9.2/x64/share/julia/compiled/v1.9/MbedTLS_jll/u5NEn_RmBmg.ji for  [top-level] since the flags are mismatched
│   current session: use_pkgimages = false, debug_level = 1, check_bounds = 1, inline = true, opt_level = 2
│   cache file:      use_pkgimages = true, debug_level = 1, check_bounds = 1, inline = true, opt_level = 2
└ @ Base loading.jl:2730

Two ways to improve this caching would be to

@IanButterworth
Copy link
Sponsor Member Author

Also, if both /registries and /compiled become default on, https://github.com/julia-actions/cache becomes quite powerful so https://github.com/julia-actions/julia-runtest could be trained to suggest the cache action if it sees that a depot doesn't exist yet.

@IanButterworth
Copy link
Sponsor Member Author

Now that #52123 is merged we're able to see the effect of caching /compiled over at julia-actions/cache#71

For an install and load-only CI run, 1.11 goes from 2 minutes to 40s.

@IanButterworth
Copy link
Sponsor Member Author

IanButterworth commented Jan 5, 2024

v1.9.5 of julia-actions/setup-julia fixes this now for all julia versions, by maintaining the mtime of the julia source files from the archives.

You can see that in this run no platform re-precompiled anything but the checked out package https://github.com/IanButterworth/PowerMonitor.jl/actions/runs/7425482162/job/20207208161

The only remaining things to do is to get more CI to use julia-actions/cache which I'm proposing by getting other actions to notify if caching isn't detected

But this is now just an adoption issue, so I think we can close this.

And for those looking to get these benefits, you just need to specify v1 of setup-julia and cache as shown here https://github.com/julia-actions/cache#usage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:ci Continuous integration
Projects
None yet
Development

No branches or pull requests

2 participants