#cache volume names need to be unique

1 messages ยท Page 1 of 1 (latest)

orchid pumice
#

๐Ÿ‘‹ Do cache volume names need to be globally unique?
Yes, today cache volumes are globally referenced by name across all the pipelines of a dagger engine so as long as you use the same dag.CacheVolume("name")

Whether different teams sharing a cache volume is a problem, will depend on the type of cache contents. If you're pointing at a proper cache directory used by the tool like go or npm, then data is likely going to be safely content-addressed and you'll only need to watch the storage space consumed by a long-lived, growing cache.

It seems, for example, that go build cache and go module cache will likely do just fine as two globally-shared caches since

  • The build cache organizes its contents based on a hash of the build inputs, including the source code, compiler flags, and Go version.
  • The module cache organizes downloaded go modules by their module path and version.

Likely also, the npm cache will be fine to share as it's content-addressed: https://docs.npmjs.com/cli/v10/commands/npm-cache

gusty vortex
brittle fjord
#

Thanks @orchid pumice, @gusty vortex ๐Ÿ™‚ Making them namespaced would be great.