blablacar / dgr

Container build and runtime tool
Apache License 2.0
249 stars 21 forks source link

fix pod's aci dependency version during build #171

Closed n0rad closed 7 years ago

n0rad commented 8 years ago

aci's dependencies labels are not fixed if dependency info is not fixed.

During build, we can get all labels used from dependency and fix it in final pod's aci

n0rad commented 8 years ago

I cannot find a way during the build to get manifests of dependencies.

Nothing in /var/lib/rkt/pods/run/{id}/ have the dependencies manifest. I thought about parsing mount to find the /var/lib/rkt/cas/tree, but it does not seems to be a simple overlay.

@alban do you have a clue how I can find labels of a dependency from the stage1 ?

alban commented 8 years ago

@sgotti: maybe you have an idea for the question above? dgr uses their own stage1 for building ACIs (see e.g. here). If the builder has access to CAS database (/var/lib/rkt/cas/db/ql.db), is it possible to find which version of dependencies a rendered tree was build from?

sgotti commented 8 years ago

I commented on https://github.com/coreos/rkt/issues/2491#issuecomment-235330900

Is your need to have the manifests of all the dependencies used to render a specific image?

If you have access to the store you can just use acirenderer to get the dependency tree. This will work if dependencies in the image store aren't changed between preparing the pod an getting the dependency tree from acirenderer.

n0rad commented 8 years ago

@sgotti The problem I'm trying to solve is that if the version of a dependency is not fixed, when you push it to a production server it will download it once, and then will never update it.

I could use --no-store but it will re-download all the aci/dependencies of the pod at each run (around 10 for our regular pods. More than 1Gb for some pods).

it's linked to https://github.com/coreos/rkt/issues/2276, but since it's not fixed yet, I was thinking about discovering the version during the build.

To define the version I need the complete list of labels so I need the manifest of the dependency.

I could use acirenderer, but It will not be safe in a CI environment where concurrent builds occurs.

n0rad commented 7 years ago

done in v88 by :