dazzle
dazzle copied to clipboard
Support chunk dependencies on other chunks
I would like to specify when a chunk requires another chunk. For example, if I want to have multiple chunks which install independent s6-init services, I don't want to have to install and configure s6 separately in each chunk.
It would be great if I could have an s6 chunk, and then several other chunks which just install tools and setup the service files to run them.
This could be performed through the chunk.yaml file which could look something like:
dependencies:
chunks:
- s6-init
This could perform either by automatically adding the s6-init chunk to any combinations specifying the current chunk, or by throwing an error if all dependent chunks have not been specified.
@tculp Hi, first of all, thanks for rising this PR. dazzle has a function to set the base image. Could you use this instead? e.g.
- specify the base image
- https://github.com/gitpod-io/workspace-images/blob/2d150603fa60ede62039d79be9f6e059b0036dda/chunks/lang-python/Dockerfile#L1-L4
- the base image is here
- https://github.com/gitpod-io/workspace-images/blob/master/base/Dockerfile
Introducing chunk dependencies would mean we'd need to ship that information on the images somehow, so that we can support combinations without the dazzle.yaml
in the future. Not a problem, just something to consider.
Dependencies would be reasonably straight forward to implement: we'd flatten the dependency DAG and just end up with a flat list of chunks afterwards.
Today we already support one combination referring to another combination, but afaik we're not using that feature.
@utam0k That wouldn't really solve the problem, because there may not be an image that has that (combination of) dependency(ies) to use as base, hence why we'd be using dazzle in the first place.
@csweichel I think it could be done without adding that information to the images, just with the caveat of it assumes the dependencies will all be pulled in while the dazzle.yaml is available
it assumes the dependencies will all be pulled in while the dazzle.yaml is available
We will need to be able to build dazzle images from the chunks alone, in absence of the the dazzle.yaml
file. I think adding this information as OCI annotations would be reasonably straight forward.