build-image
build-image copied to clipboard
Make cache logging quieter
Cache restore
- In most cases we conditionally restore the cache (and log about it), eg. Node and Ruby based on whether we think the cache is needed. In other cases we always restore the cache (even if it would be empty or unneeded), eg Go.
- We log both the start and finish of the restore, eg.
4:56:14 PM: Started restoring cached build plugins
4:56:14 PM: Finished restoring cached build plugins
Cache save
- When caching from the build directory, we only log if the directory we're trying to cache in non-empty
- When caching from the home directory, we log about every attempted cache save, regardless of whether there's actually something to put in the cache.
- In both cases, we log both starting and finishing the save.
Proposal
In my opinion, these log lines are adding too much noise to our build logs relative to the debug value they're providing. I propose the following:
- Only log cache restore/save where there are actually files present to be restored or saved
- Don't log when a cache restore/save operation starts. Only log when it completes. We lose some debug data because output from the install script can't be sent to the system log, but it can be inferred from the timestamp of the previous cache log line. Another option would be to add a timer like
Saved pip cache in 50ms.
Yes! :100:
Related: https://github.com/netlify/buildbot/issues/682