Skip to content
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

flux-mini: need specific option for setting system attributes #4481

Closed
grondo opened this issue Aug 9, 2022 · 1 comment
Closed

flux-mini: need specific option for setting system attributes #4481

grondo opened this issue Aug 9, 2022 · 1 comment

Comments

@grondo
Copy link
Contributor

grondo commented Aug 9, 2022

The use of "system" attributes under attributes.system in jobspec may become more prevalent as we move forward. E.g. one use case is to set system jobspec attributes that optionally affect the behavior of the job prolog and epilog.

However, the current method to set these attributes requires the use of a long option --setattr and explicit designation of the attribute under the system dictionary, e.g. --setattr=system.prolog.clear-ssd. This could get tedious if a user is setting many of these attributes.

We should add a new option that sets system attributes specifically, perhaps with a short option equivalent (similar to what these commands provide for -o, --setopt=OPTION.

Another idea might be to have the system. prefix implied if the attribute doesn't already start with system. or user.. I'm just not sure if that approach would get us into trouble later.

@ryanday36
Copy link

I like these modifications to the simplify the --setattr option and make it more usable. @grondo also suggested having it default to 1 if no option is given, which would simplify things even further. So, --setattr=system.clear-ssd=1 could be simplified to --setattr=clear-ssd.

grondo added a commit to grondo/flux-core that referenced this issue Aug 10, 2022
Problem: The flux-mini --setattr option is almost always used to set
attributes in the system dictionary, and therefore its use can be
very repetitive and inefficient.

Prepend "system." to the KEY specified in --setattar=KEY=VAL when
it doesn't already begin with "system." or "user.". To force
a different top-level target value, also allow keys to be prefixed
with "." (e.g. --setattr=.foo will set attributes.foo=1).

Fixes flux-framework#4481
grondo added a commit to grondo/flux-core that referenced this issue Aug 10, 2022
Problem: The flux-mini --setattr option is almost always used to set
attributes in the system dictionary, and therefore its use can be
very repetitive and inefficient.

Prepend "system." to the KEY specified in --setattar=KEY=VAL when
it doesn't already begin with "system." or "user.". To force
a different top-level target value, also allow keys to be prefixed
with "." (e.g. --setattr=.foo will set attributes.foo=1).

Fix one use of --setattr=foo=val in the testsuite with
--setattr=.foo=val.

Fixes flux-framework#4481
@mergify mergify bot closed this as completed in 48a29a1 Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants