File: template.rst

package info (click to toggle)
debusine 0.14.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,056 kB
  • sloc: python: 193,072; sh: 848; javascript: 335; makefile: 116
file content (51 lines) | stat: -rw-r--r-- 1,751 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
.. _workflow-template:

WorkflowTemplate
================

The ``WorkflowTemplate`` model has (at least) the following fields:

* ``name``: a unique name given to the workflow within the workspace
* ``workspace``: a foreign key to the workspace containing the workflow
* ``task_name``: a name that refers back to the ``Workflow`` class to
  use to manage the execution of the workflow
* ``static_parameters``: JSON dict field representing the default values
  for workflows created from this template.
* ``runtime_parameters``: JSON field representing the range of
  configurable parameters for workflows created from this template.

``runtime_parameters`` values
-----------------------------

By default (``{}``) no parameters can be configured when starting a
workflow.

Parameters that should be configured can be listed in a JSON object,
with a list of permitted values, or the special value ``any``. For
example, this would allow any source artifact to be used for a build in
``sid``, ``forky``, or ``trixie``:

.. code-block:: yaml

   suite: ['sid', 'forky', 'trixie']
   source_artifact: 'any'

Only string parameters at the root level can have permitted values
specified. More complex objects can either be left out (not
configurable) or have their root level option listed as ``any`` (fully
configurable).

The special ``runtime_parameters`` value of ``'any'`` (a string, not a
dict) allows all parameters to be configured.

Workflow Creation
-----------------

The root ``WorkRequest`` of the workflow copies the following fields from
``WorkflowTemplate``:

* ``workspace``
* ``task_name``
* ``task_data``, combining the user-supplied data and the
  ``static_parameters``. The user-supplied data must comply with
  ``runtime_parameters``.