Skip to content

fermitools/jobsub_lite

Repository files navigation

pre-commit.ci status build-sl7-push build-al9-push

jobsub_lite Overview

jobsub_lite is a wrapper for Condor job submission, intended to be backwards compatible with the actively used options of the past Fermilab jobsub tools, while being smaller and easier to maintain, and handling new requirements (i.e SciTokens authentication, etc.)

The basic design of jobsub_lite is straightforward. It will:

  • obtain credentials (using cigetcert, htgettoken, etc.)
  • parse command line arguments into a (Python) dictionary
  • optionally upload tarballs to the fast cvmfs distribution service
  • add other data to the dictionary from the environment, etc.
  • render (Jinja) templates with info from said dictionary to generate: - condor .cmd file(s) - job wrapper script(s) - condor dagman .dag files (in some cases)
  • use the Condor python bindings and command line tools to submit the above

There is also a simplified dagnabbit parser (again for past jobsub DAG tools compatbility) that reuses the same command line parser to generate .cmd and .sh files for each stage in the DAG.

Credentials

This version of jobsub is expected to deal with SciTokens credentials; and will use the new ifdhc getToken call to fetch them, which in turn will call the htgettoken utility. Production accounts will have special production tokens pushed to them via the Managed Tokens Service, and this utility will not have to get those tokens.

Command line parsing

This is done with the usual Python argument parser. Options supported are those from Dennis Box's summary of jobsub options actually used in the last 6 months. list (Sorry, Fermilab folks only)

Tarball uploads

This is currently implemented using Python's requests module for https access to the pubapi ; it is planned to improve it using the streaming mulipart uploader so we do not have to read the whole tarball into memory.

Tempates of .cmd .sh, and .dag files

The Jinja template code is used to generate the job submission files. For example, the template for the .cmd file for a simple submission is simple.cmd where a name (or expression) in doubled curly braces {{name}} is replaced when generating the output, and conditional geneartion is done with {%if expr%}...{%endif%}. (There are other Jinja features, but that is mainly what is used now in jobsub_lite). The majority of template replacement values are directly command line options or their defaults, which makes adding new features easy; you add an option (say --fred ) to the command line parser, and then add a suitable entry to the appropriate template(s) using that value ( {{fred}} or {%if fred %} xyzzy={{fred}} {%endif%} .