flux.job.frobnicator.frobnicator module

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

Bases: object

Base class for plugins which modify jobspec in place

The following base class attributes are used to pass optional, extensible context to plugins without perturbing plugin callback method signatures, and will be available from within all callbacks unless otherwise noted:

Attrs:
queue_conf (flux.queue.QueueConf): The instance's queue

configuration, as fetched from the job-manager.queue-list RPC.

configure(args, config)

Configure a FrobnicatorPlugin. Run after arguments are parsed

Parameters
  • 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.

Parameters
  • jobspec (Jobspec) -- The jobspec to modify

  • userid (int) -- Submitting user

  • urgency (int) -- Initial job urgency

  • flags (int) -- Job submission flags

Returns

None or raises exception.

queue_conf = None
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

Parameters
  • 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

Returns

A dictionary containing a result object, including keys:

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

Return type

dict

plugin_namespace = 'flux.job.frobnicator.plugins'
start()

Read broker config, select and configure frobnicator plugins