Skip to content

ci: caching mechanism for stateless agents

Administrator requested to merge jh/asdf-cache into main

Created by: jhchabran

This PR is a draft exploring how caching helps to improve build times on caching agents. Without it, the build times are so high that it challenges the whole idea of going stateless.

I'll make another pass on the numbers tomorrow to provide more precise insights.

It caches the biggest drags of moving to stateless agents (Docker excluded)

  • Node modules
    • about 200s saved on every build involving node
    • that can be taken further by working with yarn specifics, but it requires investing more time.
  • asdf installations
    • about 20s saved on every builds
    • less external HTTP calls
  • Go modules Cache will fix later
    • Need to enable the cache plugins to deal with absolute paths, postponed for the moment, should just be a matter of patching the plugin for those specific cases.

Other changes:

  • Fixed the Plugin function that allowed to use of only a single plugin
  • Added docs enabling everyone to make use of the cache.
  • Removed the post-command hook that installed asdf tool versions on every command in favour of a post-checkout one.

See https://github.com/sourcegraph/sourcegraph/issues/21130

TODO @jhchabran

  • It seems there is a bug that made the misc linters pass even if there was an error.

Merge request reports

Loading