Replies: 6 comments 11 replies
-
I don't remember how much of blueprints have been designed, but could blueprints be an archive instead of a text file? And there would be the toml file at the root of the archive and files in their directories alongside with it? |
Beta Was this translation helpful? Give feedback.
-
So two questions:
|
Beta Was this translation helpful? Give feedback.
-
I'd also like to add that @bcl proposed a 3rd approach which was to use RPMs to package these files in a (I believe) custom repository. Personally I like the simplicity of this but I'm torn because it requires people that build images to familiarize themselves with the RPM format and repositories which might be a big hurdle to 'just' place some files into an artifact. |
Beta Was this translation helpful? Give feedback.
-
My issues with the "blueprint and associated data" proposal is that it will inevitable lead to creating of a blueprint pre-pre-processor - a script that will take a blueprint and a directory and output a tarball, that's ready for being sent to the pre-preprocessor. Thus, if we just allow blueprints to include any files from the cwd, we will save ourselves time coding a pre-pre-processor. Also, people are already used to build images using a recipe and files from a directory: Dockerfiles. RPMs are nice, but they require too much setup imho. Finally, regarding the "custom directive": I think we should still use a plain TOML/JSON, otherwise you cannot simply deal with blueprints using standard tools and libraries. Thus, I suggest something like this:
This would instruct |
Beta Was this translation helpful? Give feedback.
-
And for reference here is the work I've done previously - https://github.com/bcl/osbuild/commits/master-copy-file that was never merged (and not quite done, I think? I need to reread all the commits to refresh my memory). |
Beta Was this translation helpful? Give feedback.
-
Another idea is to follow the example of rpm creation and use a separate upload for large files, and refer to them in the blueprint using a custom URI of some kind. |
Beta Was this translation helpful? Give feedback.
-
There are quite a few requests for an easier way to include files in blueprints, currently we support inline file contents through the
files
customization.Papercuts
These file customizations need their full data to be put inline in the blueprint. There's a few papercuts with this approach:
Binary Data
TOML strings have some escaping rules; however, putting in binary data requires application-specific encoding (such as base64) which we currently don't have.
Many Files
Having to copy-paste a billion files into the blueprint and then keeping them up to date with where they came from is a huge chore.
Ideas
Some ideas have been proposed to deal with this issue:
Blueprint Preprocessor
A thing that lives in weldr-client to parse a blueprint and replace custom directives with their content; an example idea would be:
@include-file(src, dst, ...)
which would expand to the normal file data in a blueprint as we have now.
Blueprint and Associated Data
An alternative to the preprocessor to pre-empt some problems (mentioned later) is to put the blueprint and all data it needs into a single archive file (format can be chosen later); the proposed
@include-file
directive can only refer to files included in the same archive.Crystal Ball
Using our crystal ball we can predict issues with some of the approaches suggested here; these will need to be resolved.
Blueprint Preprocessor
Where does it run, we're deprecating the weldr API in osbuild-composer and work is ongoing to convert blueprints to cloudapi compose requests which is being discussed: https://github.com/orgs/osbuild/discussions/2
Summarizing that: we will likely be converting the blueprint server side where there is no access to any local files referred to by the blueprint.
Other Problems
Whatever we do, the requests to the cloudapi will get large; this might not be a problem, or it might be. Where more of a problem lies is how to send all that data to the workers after a build is started.
We'll likely also need a format for the osbuild side of things; copying all the files into the manifest leads to huge manifests. Perhaps a manifest and associated data is in place there as well, where the other files in the archive can be exposed as an input?
Beta Was this translation helpful? Give feedback.
All reactions