luet icon indicating copy to clipboard operation
luet copied to clipboard

RFC: Introduce a new build section on spec to use with `package_dir` if required

Open geaaru opened this issue 3 years ago • 2 comments

Inside the portage-tree with package per single package, there are a lot of layers and space required. The use of the package_dir requires post-build steps that aren't really used in the next layers.

In general, in use cases like this, it's not needed that the files copied inside the package_dir directory that in a long time it duplicates the space required for the final image will be used.

Describe the solution you'd like We could provide an epilogue section with steps that are executed in the images to get the package files but that isn't inside the pushed image.

epilogue:
- cp ${my_files} /${package_dir}/

It will add complexity but it reduces i/o operations that are very slow.

geaaru avatar Mar 02 '21 13:03 geaaru

A possibility could be to create an external plugin that removes the package_dir content before pushes the image.

geaaru avatar Mar 05 '21 09:03 geaaru

I investigate this but could not be handled at the moment with a plugin because the analysis of the package_dir is done after the push. So, the alternative is to elaborate package_dir before pushing the layer or add an epilogue section.

 🐋  Squashing image quay.io/geaaru/portage-tree-amd64-cache:3beac90ff71b5312ceca2ec2889b7735e205c6ec04777e99b722d9b4d714f12f
 🐋  Squashing image quay.io/geaaru/portage-tree-amd64-cache:3beac90ff71b5312ceca2ec2889b7735e205c6ec04777e99b722d9b4d714f12f done
 🐋  Pushed image: quay.io/geaaru/portage-tree-amd64-cache:3beac90ff71b5312ceca2ec2889b7735e205c6ec04777e99b722d9b4d714f12f
 🎩  Packing from output dir /go-portage
 📦  dev-lang/go-portage-1.15.3    ✅  Done
 Artifact generated: /srv/mottainai/build/27866084/luet-repo/build/go-portage-dev-lang-1.15.3.package.tar.gz

geaaru avatar Apr 07 '21 07:04 geaaru