Scheduler domain¶
- momotor.options.domain.scheduler.preflight.create_preflight_result(providers, trigger, action, status)¶
Create a
ResultsBundlewith a pre-flight result for the given action- Return type:
- momotor.options.domain.scheduler.preflight.preflight_check(providers)¶
Evaluate a
preflight@scheduleroption in the given providers and return aResultsBundlewith a result as defined by the preflight option for the task with id task_id if any pre-flight options activated.- Parameters:
providers (
Providers) – the providers to use for resolving the pre-flight option- Return type:
- Returns:
a
ResultsBundlewith a result as defined by the preflight option, or None if no pre-flight action should be taken.
- momotor.options.domain.scheduler.preflight.PREFLIGHT_OPTION = OptionDefinition(name='preflight', type='string', doc=' A preflight check handled by the scheduler. This allows recipes to indicate situations in which the\n step does not have to be executed.\n\n See :external+momotor-engine-options:ref:`scheduler preflight option` for the documentation of this option.\n ', required=False, multiple=True, all=True, location=('config', 'recipe', 'step'), domain='scheduler', default=<object object>, enable=True, deprecated=None, _cast=<class 'str'>)¶
The
preflight@scheduleroption allows recipes to indicate situations in which the checklet does not have to be executed.
- momotor.options.domain.scheduler.tasks.get_scheduler_tasks_option(recipe, config, step_id)¶
Get the
tasks@scheduleroption for a single step from the step, recipe or config.- Parameters:
recipe (
RecipeBundle) – the recipe bundleconfig (
ConfigBundle|None) – (optional) the config bundlestep_id (
str) – the id of the step
- Return type:
- Returns:
the tasks option, parsed into a tuple of ints
- momotor.options.domain.scheduler.tasks.TASKS_OPTION = OptionDefinition(name='tasks', type='string', doc=' Enable multiple tasks for this step. If not provided, a single task is generated for this step.\n\n See :external+momotor-engine-options:ref:`scheduler tasks option` for the documentation of this option.\n ', required=False, multiple=False, all=False, location=('config', 'recipe', 'step'), domain='scheduler', default=<object object>, enable=True, deprecated=None, _cast=<class 'str'>)¶
The
tasks@scheduleroption defines the number of sub-tasks for a step.
- momotor.options.domain.scheduler.tools.get_scheduler_tools_option(recipe, config, results, *, task_id)¶
Evaluate the tool requirements by parsing the
tools@scheduleroption for a single step in the given bundles.This gets the value of the
tools@scheduleroption for the step, and subsequently gets the specific tool version requirements (if any) from the options in the tools domain.A step requiring tools must define the
tools@schedulerin the recipe. The tool version options are defined in the tools domain in the normal locations: config, recipe, step.Example of a step defining some tool requirements:
<recipe ...> ... <step ...> ... <options domain="scheduler"> <option name="tools" value="anaconda3" /> </options> <options domain="tools"> <option name="anaconda3" value="anaconda3/_/momotor anaconda3" /> </options> ... </step> ... </recipe>
This indicates to the scheduler that this step requires the
anaconda3tool. It also indicates to both the scheduler and to the checklet that will execute this step that theanaconda3/_/momotorversion is preferred, but if not available anyanaconda3will do.For the format of the tool version requirements, see Tool registry.
- Parameters:
recipe (RecipeBundle) – The recipe bundle.
config (ConfigBundle | None) – The config bundle.
results (ResultsBundle | None) – The results bundle.
task_id (StepTaskId) – The task id.
- Return type:
ToolRequirements
- Returns:
The tool requirements for the requested step and task.
- momotor.options.domain.scheduler.tools.TOOLS_OPTION = OptionDefinition(name='tools', type='string', doc=' .. role:: xml(code)\n :language: xml\n\n List of tools required for the step. Can only be provided by :xml:`<step>` nodes.\n\n Multiple tools can be provided by using multiple tools@scheduler options, or using a single\n tools@scheduler option with multiple tool names. Multiple tool names on a single option should\n be space or comma separated.\n\n The list of tools should only contain tool names. Any detailed version requirements should\n be defined with options in the :external+momotor-engine-options:ref:`tools domain <tools domain>`.\n\n See the :external+momotor-engine-options:ref:`tool registry documentation <tool registry>` on how\n this option is used to resolve a tool.\n ', required=False, multiple=True, all=False, location=('step',), domain='scheduler', default=<object object>, enable=True, deprecated=None, _cast=<class 'str'>)¶
The
tools@scheduleroption defines the tools required for a step.