Conversation
|
I have yet to implement this in the CLI. Just thought I should show the schema we could use before I continue. |
Deploying bluebuild-schema with
|
| Latest commit: |
2341f4d
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://280786ca.schema-e29.pages.dev |
| Branch Preview URL: | https://module-if.schema-e29.pages.dev |
|
We're all for new features here, but personally stuff like For me, a That's why I've been (not actively right now, but regardless) looking into YAML-alternatives that would allow more intelligent build matrixing with if statements and such. RCL was the greatest of these I found, although obscure, it worked really nicely with BlueBuild. Of course, the if-statements in RCL are entirely different from those proposed here. If BlueBuild was a programming framework in a real programming language built on say, a Containerfile-less Buildah workflow, we would have these features almost for free. Not saying no here, to be clear. I'm saying that the world is not perfect. |
Well good thing it's already implemented and seems to work really well. |
Why did I never know this? This might be the way to go in the future. |
I really don't see how adding
So you're more comfortable moving to an obscure configuration language that requires another external program in order to process it and output a yaml file? Yaml is far more well known. I'm sorry but this doesn't sound like it's based on any technical standing and is more about how you "feel" it should be. The implementation of this schema prints out the conditions being tested and which one causes the module to be skipped, allowing users to see the decision being made. There is no setting variables. There are no loops. This is not making recipes a programming language any more than writing the scripts themselves. |
Yeah, I guess. But I'm not talking about "moving to", just that "if someone needs complicated build matrixing with if statements etc., there is a tool for that and it works well so we don't have to worry about hacking that feature into YAML". Even the "identity crisis" thing was just something I was feeling (like a slippery-slope gut reaction) and not something "real". It's like the "well if we have if statements, then we could build multiple different images from the same configuration, so why not also add build matrixing, so why not make the recipe into a function with arbitrary inputs that generates an image as an output" etc. etc. But of course, this is not that. This is a feature that enables doing maybe some useful things that were not previously possible without custom scripts. |
I do have to correct myself here, we do have the
Yeah I think we can leave that to the ci providers or shells. My goal with these changes is not to implement a full build matrixing. I'm aiming for a way to consolidate modules so that they're easier to manage and include in multiple recipes. Similar on the |
This PR sets up the schema for a new functionality that would allow users to have a module be conditionally executed. Both build-time and template-time on the host.
My main reason for wanting to create something like this was to help with maintaining recipes for various distros and versions. This would allow users to consolidate all their modules for say installing Nvidia drivers for all of their distros into a single recipe module file. Or if you have steps for signing a kernel module (like we do in
base-images), having ahost-file.existscheck for the step that signs modules will be useful for allowing other users/developers that do not have the signing key to build our images locally without it.Examples
Build-time
Only runs on
fedora:Runs based on the os/version:
Evaluate a shell expression:
Template-time
Only runs if the private key exists: