alces-software / adminware

A sandbox CLI for running commands remotely across nodes
1 stars 0 forks source link

Inteligently reconcile running namespaces with tool arguments #180

Open DavidMarchant opened 5 years ago

DavidMarchant commented 5 years ago

Tool arguments have been re-implemented with the merging of #175. Arguments are now essential parameters to run commands for tools that define them in their config files. If you try to run a tool with arguments defined without specifying those arguments in the run command a run-time error is produced. However, as it stands, namespaces cannot be ran with arguments and all tools within the namespace will be ran as though they were called without arguments, producing no errors even where errors should be produced.

This functionality is counter intuitive and will be changed.

Sub-optimally, the solution would be to error if a namespace that contains tools that require arguments is ran. Ideally, however, a better solution (and the solution we will work towards) is to implement an intelligent way of passing arguments to all the tools in a namespace when that namespace is run. This will still involve error-ing if no arguments are provided as above but each argument defined within the namespace should be specified in the run [namespace] command. Additionally all arguments defined with the same name in separate configs should be specified with the same value [1], this is possible due to each arguments existence as a key in a key-value pair.

[1] e.g. if the argument 'USER' is defined namespace1 tool1 and namespace1 tool3 it should have a value specified once in the run command which will then be applied to both tools.

WilliamMcCumstie commented 5 years ago

I wouldn't worry about trying to implement a suboptimum solution for the bug, we might as well invest the time to fix it properly

WilliamMcCumstie commented 5 years ago

As the arguments form key value pairs, it should be possible to add argument passing to groups of tools.

This would require parsing the configs for a complete list of arguments to feed into the CLI. The arguments then need to be unpacked (this maybe easier said then done).

The final question is should all the arguments be passed to every command? Or just the relevant ones?