-
Notifications
You must be signed in to change notification settings - Fork 109
templating support for definition file #1738
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
templating support for definition file #1738
Conversation
75de3bd
to
ea9061f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the approach to the replacement here, vs what's in the initial cherry pick 👍.
Generally, the more I look at this, the more I think there need to be some researched and carefully considered design decisions made... which may or may not mesh with the Apptainer implementation. From an initial reading:
- What should be the restrictions on build arg names?
- Should there be a way to escape the
{{ ... }}
pattern in a def file? Some programs will take arguments in that format. It's not uncommon for Go programs to take Go template snippets to format output.
We also need to carefully consider what happens with remote builds. Is this parsing on the client side (okay)... or will the def currently be sent up to the remote builder before the replacements occur?
d25f03f
to
336b719
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lookst prety good to me at this point. Definitely prefer the code as re-written.
I think It'd be good for a docs PR to be written up in parallel with this WIP PR, so that they can be merged together. The reason for this is that it'll focus some attention on what key/val pairs are allowed, and how things like quoting etc. differ between CLI and file. I'm not convinced there aren't some rough edges there that we might want to address, yet.
b6d01d7
to
af2bf8f
Compare
540adf2
to
17fc2d5
Compare
17fc2d5
to
09a9ae9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ... This is a ✅ just held in order to raise it with @EmmEff tomorrow, just to 100% confirm we are all good with the exact change in types.Definition
4280dcc
to
ef5f9af
Compare
ef5f9af
to
6d87087
Compare
Just thought.... this only works for local builds, at present, right? If that's the case we should have a warning/error if used with |
Description of the Pull Request (PR):
Provides support for
--build-arg
and--build-arg-file
to pass variables to build process, allowing definition file to use values using{{ argname }}
strings. Also supports an%arguments
section in definition file to provide default values for the arguments used by the definition file, which can then be overridden via the aforementioned command-line options.This is a pick of apptainer/apptainer#1356