Feature #7867

Alternative interface to command line

Added by Dominick Rocco over 5 years ago. Updated almost 2 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:


A command line interface is convenient for quick things, but jobsub_client submission configurations end up being relatively detailed. It is almost impossible to write one freehand, especially with new arguments like --resource-provides. A common solution is to write the arguments into a shell script which can be cargo-culted around and modified as necessary. This solution works, but it can be frustrating since shell scripts are so punctuation sensitive (think slashes and trailing whitespace) and can lead to strange errors. It would be nice to have a configuration file option which didn't involve an executable file to store submission details. For context, it appears that jobsub_client is a wrapper which is difficult to use without an additional wrapper layer.

A very simple solution would be to add an option to read arguments from a text file and pass them to the argument parser with all whitespace replaced with single spaces and # style comments stripped out. I recently implemented this solution for a script I was working on which used Python's argparse, although I get the sense that jobsub_client is using a custom parser. There was a little bit of gymnastics to parse and reparse the options, but in the end it was less than ten lines. Comment stripping was handled using the Python tokenize module by way of a function stolen from Stack Exchange.

Other alternatives for a configuration language would be FHICL (heaven help us), JSON or the standard Python ConfigParser. I would rule out such things as XML based on the level of punctuation required; even JSON might be pushing it in that regard.

A Python API for jobsub_client probably belongs as a separate feature request, but it would prove to be very useful for things like batch automation.


#1 Updated by Dennis Box almost 2 years ago

  • Status changed from New to Closed

heaven help us, we implemented a json config file input option. closing ticket

Also available in: Atom PDF