From a423dc646ac932d3d5bfe79c53a1e934bf36227c Mon Sep 17 00:00:00 2001 From: Jonathon Anderson <17242663+blue42u@users.noreply.github.com> Date: Wed, 19 Oct 2022 10:36:27 -0500 Subject: Update the binary index before attempting direct fetches (#32137) "spack install" will not update the binary index if given a concrete spec, which causes it to fall back to direct fetches when a simple index update would have helped. For S3 buckets in particular, this significantly and needlessly slows down the install process. This commit alters the logic so that the binary index is updated whenever a by-hash lookup fails. The lookup is attempted again with the updated index before falling back to direct fetches. To avoid updating too frequently (potentially once for each spec being installed), BinaryCacheIndex.update now includes a "cooldown" option, and when this option is enabled it will not update more than once in a cooldown window (set in config.yaml). Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> --- etc/spack/defaults/config.yaml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'etc') diff --git a/etc/spack/defaults/config.yaml b/etc/spack/defaults/config.yaml index d3e7e4ce68..e72608248f 100644 --- a/etc/spack/defaults/config.yaml +++ b/etc/spack/defaults/config.yaml @@ -201,3 +201,7 @@ config: # building and installing packages. This gives information about Spack's # current progress as well as the current and total number of packages. terminal_title: false + + # Number of seconds a buildcache's index.json is cached locally before probing + # for updates, within a single Spack invocation. Defaults to 10 minutes. + binary_index_ttl: 600 \ No newline at end of file -- cgit v1.2.3-60-g2f50