containers-tools / cct

containers configuration tool
MIT License
9 stars 6 forks source link

Make it possible to add environment variables and labels as part of module.yaml #81

Open goldmann opened 7 years ago

goldmann commented 7 years ago

It would be a nice feature if we would be able to add to image env variables and labels that are defined in module.yaml.

Low priority.

rwngwn commented 7 years ago

this is very nice feature - and will be pretty neat to do. It will be much more easy to do with a buildah.

goldmann commented 7 years ago

I would probably raise priority of this issue, for me this looks like an important thing to maintain units of changes (modules).

rwngwn commented 7 years ago

lets talk about this when we split repos and start using CCT.

rcernich commented 7 years ago

Why don't we broaden the whole idea such that image.yaml is an extension of module.yaml that adds image specific details, mainly FROM. At that point, the module system is really just merging a set of files to create what was our old image.yaml format. This would make image.yaml look something like:

name: "jboss-eap-6/eap64-openshift
description: "..."
version: "..."
from: "jboss-eap-6/eap64:latest"
labels: [...]
envs: [...]
requires:
  - name: "core.jolokia"
    url: https://github.com/jboss-openshift/modules-core.git
    path: jolokia
...

Adding in "overrides," one could specify a property like: module.core.jolokia.url=/home/me/src/modules-core. (I'll add this and more to jboss-dockerfiles/dogen#12.) It would also be great if version could be specified during the build or from the tag/ref specified.

rcernich commented 7 years ago

The biggest benefit of this approach is that the logic for processing image.yaml can be reused for all of the modules. For example, the jinja template might simply be:

for each module in requires
  labels
  env
  packages
  scripts

This would greatly simplify the amount of new code we'd need to write for dogen as we'd simply be adding the mechanics for module retrieval and overrides via properties.

rcernich commented 7 years ago

A more concrete, complete example: https://github.com/rcernich/cct_module/tree/module-refactoring/common

rwngwn commented 7 years ago

I like that idea, but as you suggested it will need some bigger changes in CCT/Dogen, I think for this we should first merge CCT inside dogen, make it cooperate and create tight relationship. Then we can do this - maybe we should schedule some call about this and plan Dogen 3.0 with CCT inside?