Request: Redesign and improve deadlinecommand

I’ve wanted to submit this request for awhile, and I was going to try and mock up a whole suggested outline of how things could be reorganized, but I’d rather just get the request out there with some broad suggestions.

As command-line tools go, deadlinecommand is very unintuitive to use, is difficult to interrogate for possible commands and options, and seems to have become bloated over time with a lot of very specific one-off type of operations. I would really like to see it get an overhaul to behave more intuitively, and use syntax constructs that are common in other such tools. Mercurial and git are both great examples of how a command-line tool with a ton of functionality can still be approachable and usable.

In no particular order, here are some suggestions that I think would go a long way toward making it more useful

  • Build it around a subparser system, with global and command-specific flags (short and long versions where possible). Again, see Mercurial for how to make this work well; just run hg help and go from there.

deadlinecommand slave --list deadlinecommand slave --log rd-124 deadlinecommand job --list --fields Name,User,Pool,Errors,ID deadlinecommand job --delete <jobid> ... deadlinecommand user --delete ruschn deadlinecommand control --slaves rd-002,rd-125 <command> <args> deadliencommand config --set RestartStalledSlave true --set LicenseServer sv-lic13

  • Shorter name. This is a no-brainer with a tool people may need to use a lot, although I understand it would break the naming consistency across the various binaries.
  • Among other global flags, definitely one for specifying which repository path to use. With Mercurial, for instance, the default behavior is to check the current directory for a repository store, but the -R flag can be used to explicitly specify which repository to use. In this case, it could use the default value from the Deadline config file, rather than checking the current directory.
deadlinecommand submit --jobinfo /path/to/jobInfo -R /path/to/repository/directory
  • I would strongly suggest getting rid of the really specific commands that deadlinecommand currently contains. For instance, things that are only run during installation, or that are only run by internal Deadline tools. If that stuff actually needs to be an external tool, it could be that a second binary (deadlineadmin?) would be a better place for some of this functionality. I also have a feeling there are a lot of legacy commands or duplicates with different names that don’t really need to stick around.
  • Better support for arbitrary Python execution (in the Python.NET environment)
    • Add a REPL mode!
    • Add a ‘pyeval’ mode (a la python -c)
    • Make execution of .py files implicit

deadlinecommand /path/to/a/python/script.py deadlinecommand shell deadlinecommand pyeval 'import sys; print sys.executable'

  • Better output handling. Errors/warnings to stderr, output to stdout.
  • Better use of exit statuses. Exit with non-zero if something goes wrong. Bonus points for categorizing errors with different exit codes.

Anyway, as I mentioned, I just wanted to get this out there, as I feel like deadlinecommand could be a much more useful tool.

Thanks.

Hello,

I am going to pass this along to the devs in the morning, and I’ll see if they have any thoughts or comments.

Cheers,

Hello,

I have passed along your request to the dev team and while I think this might get implemented, I can’t really give an estimate on when or in what version we might see it. Thank you for passing along the request.