floki icon indicating copy to clipboard operation
floki copied to clipboard

WIP: Subcommand to list volumes and their paths

Open rlupton20 opened this issue 4 years ago • 2 comments

Signed-off-by: Richard Lupton [email protected]

Subcommand to provide information on volumes. e.g.

$ ./target/x86_64-unknown-linux-musl/debug/floki volumes
NAME                 MOUNT                HOSTPATH
cache                /cache               /home/richard/.floki/volumes/26c9c57f7c619e3d06f9c4df03e7fd881e59d0986128b6b68af1dd2fb49ee508-cache
global-cache         /global-cache        /home/richard/.floki/volumes/global-cache

rlupton20 avatar Jul 17 '20 00:07 rlupton20

@bossmc fyi. I will change the interface a bit, but this is a first small step on providing better volume ergonomics.

rlupton20 avatar Jul 17 '20 00:07 rlupton20

Cool! Some early comments (some of which you may already have done):

  • The path to the non-shared volume is kinda unwieldy to print by default (and are likely not that interesting in 99% of cases)
  • The name of non-shared volumes is namespaced by the floki file right? Suspect you'll want to include the path to the floki-file for those volumes
  • The combination of the above suggests maybe treating the two types of volume completely separately? Maybe floki volume list [--all] or something to hide the non-shared volumes completely by default?
  • It might even be cool to record which floki-files are referencing a shared volume? To help answer questions like "am I using the same .cargo/ cache for all my rust codebases? Probably either behind floki volume inspect <name> or floki volume list --verbose?

This also brings up a question - what cleans up the volumes? The shared ones, probably nothing, that makes sense, but the non-shared ones are invalidated by any change to the floki file right (or maybe it's just the path)?

Also - could/should non-shared volumes be docker volumes rather than host volumes? We don't need the "real" nature of the host volume for non-shared ones, we just want persistence (in theory we could have shared-volumes in docker, but there I suspect the ability to share the volume with the host is valuable)?

bossmc avatar Jul 20 '20 12:07 bossmc