flux.job.frobnicator.frobnicator module
- class flux.job.frobnicator.frobnicator.FrobnicatorPlugin(parser)
Bases:
objectBase 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.
- queue_conf (
- configure(args, config)
Configure a FrobnicatorPlugin. Run after arguments are parsed
- Parameters
args (
Namespace) -- The resulting namespace after callingargparse.parse_args() --
config (
dict) -- The current broker config, stored as a Pythondictionary. --
- 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
infoparameter.- Parameters
jobspec (
Jobspec) -- The jobspec to modifyuserid (
int) -- Submitting userurgency (
int) -- Initial job urgencyflags (
int) -- Job submission flags
- Returns
None or raises exception.
- queue_conf = None
- class flux.job.frobnicator.frobnicator.JobFrobnicator(argv, pluginpath=None, parser=None)
Bases:
objectA 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 placeuserid (
int) -- Submitting userflags (
int) -- Job submission flagsurgency (
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