vagga icon indicating copy to clipboard operation
vagga copied to clipboard

Support setting image-cache-url in the project-local settings

Open lilianmoraru opened this issue 9 years ago • 1 comments

I have a vagga file with many containers that build one over the other through !Container. In my $HOME/.vagga/settings.yaml I have these 2:

storage-dir: /home/lilian/.vagga/image-storage
cache-dir: /home/lilian/.vagga/vagga-cache

So, naturally, I created next to them a image-cache and now I wanted to add image-cache-url and I find myself just copy-pasting the same image-cache-url to every container. I think it would be more useful if image-cache-url would be in the project-local settings and if the option needs to be kept in container builds, than optionally be overridden in container builds inside vagga.yaml.

I don't store these images on a server but even on a server it is relevant. Let's say you have them at(not a real address): ftp://vagga-images.org/${container_name}.${short_hash}.tar.xz . Still every container can be placed at the same place and they will have different names and hashes.

lilianmoraru avatar May 11 '16 05:05 lilianmoraru

The reason it's in specific container name, is that vagga encourages to you to have different commands and therefore different images, for example:

  1. Normal containers that run your app
  2. Utility containers: docs, nginx, db, deploy tools
  3. Test containers: which insert build artifacts to the container and run tests
  4. Deployment container: adds application code to container, used for deployment

The differences are:

  1. Normal containers are probably cached per-project
  2. The cache of utility containers may be shared between projects within the company
  3. Test containers are useless to cache, they are different after each built
  4. Deployment containers should not be cached (or even built) by users, but rather always built by CI system, and put in a mirror accessible to production

So while you might have some boilerplate, it can be easily overcome by &anchors and *aliases. I think we need to wait to gain more experience with this option and for more edge cases to appear.

Copying some configs is a small enough price to pay for not making vagga a monster with tons of useless options in the long term.

tailhook avatar May 17 '16 23:05 tailhook