Skip to content

Allow submit description values to use Pythonic types

This MR adds a naive implementation to allow users to use more-intuitive Python types as submit_description values when constructing a Layer, which are then formatted appropriately when the submit description is added to the DAG.

This supports things like the following (extract from the README.md example):

requirements = {
    "request_cpus": 1,
    "request_memory": 2000,
    "environment": {
        "GWDATAFIND_SERVER": "datafind.ligo.org",
    },
    "use_oauth_services": "igwn",
    "igwn_oauth_permissions": ["read:/ligo", "read:/virgo"],
}

process_layer = Layer("process_bins", submit_description=requirements)

and results in the following entries in the submit file:

environment = "GWDATAFIND_SERVER='datafind.ligo.org'"
use_oauth_services = igwn
igwn_oauth_permissions = read:/ligo read:/virgo

Merge request reports