flux.job.frobnicator.frobnicator module

class flux.job.frobnicator.frobnicator.FrobnicatorPlugin(parser)

Bases: object

Base class for plugins which modify jobspec in place

configure(args, config)

Configure a FrobnicatorPlugin. Run after arguments are parsed

  • args (Namespace) -- The resulting namespace after calling

  • argparse.parse_args() --

  • config (dict) -- The current broker config, stored as a Python

  • dictionary. --

abstract frob(jobspec, userid, urgency, flags)

Modify jobspec. A FrobnicatorPlugin must implement this method.

The plugin should modify the jobspec parameter directly. Extra job information (user, urgency, flags) are available in the info parameter.

  • jobspec (Jobspec) -- The jobspec to modify

  • userid (int) -- Submitting user

  • urgency (int) -- Initial job urgency

  • flags (int) -- Job submission flags


None or raises exception.

class flux.job.frobnicator.frobnicator.JobFrobnicator(argv, pluginpath=None, parser=None)

Bases: object

A plugin-based job modification class

JobFrobnicator loads an ordered stack of plugins that implement the FrobnicatorPlugin interface from the 'flux.job.frobnicator.plugins' namespace.

default_frobnicators = ['defaults', 'constraints']
frob(jobspec, user=None, flags=None, urgency=16)

Modify jobspec using stack of loaded frobnicator plugins

  • jobspec (Jobspec) -- A Jobspec or JobspecV1 object which will be modified in place

  • userid (int) -- Submitting user

  • flags (int) -- Job submission flags

  • urgency (int) -- Initial job urgency


A dictionary containing a result object, including keys:

    'errnum': 0,
    'errmsg': "An error message",
    'data': jobspec or None

Return type


plugin_namespace = 'flux.job.frobnicator.plugins'

Read broker config, select and configure frobnicator plugins