Skip to content

Commit c12339c

Browse files
authored
Merge pull request #313 from grondo/rv1-properties
rfc20: add optional execution.properties key to Rv1
2 parents b578011 + d3139d2 commit c12339c

File tree

4 files changed

+141
-2
lines changed

4 files changed

+141
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Table of Contents
4141
- [28/Flux Resource Acquisition Protocol Version 1](spec_28.rst)
4242
- [29/Hostlist Format](spec_29.rst)
4343
- [30/Job Urgency](spec_30.rst)
44+
- [31/Job Constraints Specification](spec_31.rst)
4445

4546
Build Instructions
4647
------------------

index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,4 @@ This specification describes the Flux job urgency parameter.
249249
spec_28
250250
spec_29
251251
spec_30
252+
spec_31

spec_20.rst

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,9 @@ Execution
128128
~~~~~~~~~
129129

130130
The value of the ``execution`` key SHALL contain at least the keys
131-
``R_lite``, and ``nodelist``, with optional keys ``starttime`` and
132-
``expiration``. Other keys are reserved for future extensions.
131+
``R_lite``, and ``nodelist``, with optional keys ``properties``,
132+
``starttime`` and ``expiration``. Other keys are reserved for future
133+
extensions.
133134

134135
``R_lite`` is a strict list of dictionaries each of which SHALL contain
135136
at least the following two keys:
@@ -162,6 +163,24 @@ contain a string in RFC 29 *Hostlist Format*, e.g. ``host[0-16]``.
162163

163164
The ``execution`` key MAY also contain any of the following optional keys:
164165

166+
**properties**
167+
The optional properties key SHALL be a dictionary where each key maps a
168+
single property name to a RFC 22 idset string. The idset string SHALL
169+
represent a set of execution target ranks. A given execution target
170+
rank MAY appear in multiple property mappings. Property names SHALL
171+
be valid UTF-8, and MUST NOT contain the following illegal characters:
172+
173+
::
174+
175+
! & ' " ^ ` | ( )
176+
177+
Additionally, the ``@`` character is reserved for scheduler specific
178+
property use. Any suffix that appears after the ``@`` character in a
179+
property name SHALL be a scheduler-specific string. For example,
180+
``amd-mi50@gpu``, ``amd-mi50`` SHALL be the property string, but a
181+
scheduler MAY use the ``gpu`` suffix to perform scheduling optimization
182+
for gpus of the corresponding ranks.
183+
165184
**starttime**
166185
The value of the ``starttime`` key, if present, SHALL
167186
encode the start time at which the resource set is valid. The

spec_31.rst

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
.. github display
2+
GitHub is NOT the preferred viewer for this file. Please visit
3+
https://flux-framework.rtfd.io/projects/flux-rfc/en/latest/spec_26.html
4+
5+
31/Job Constraints Specification
6+
================================
7+
8+
This specification describes an extensible format for the description of
9+
job constraints.
10+
11+
- Name: github.com/flux-framework/rfc/spec_26.rst
12+
- Editor: Mark A. Grondona <[email protected]>
13+
- State: raw
14+
15+
Language
16+
--------
17+
18+
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD",
19+
"SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to
20+
be interpreted as described in `RFC 2119 <https://tools.ietf.org/html/rfc2119>`__.
21+
22+
Related Standards
23+
-----------------
24+
25+
- :doc:`14/Canonical Job Specification <spec_14>`
26+
- :doc:`20/Resource Set Specification Version 1 <spec_20>`
27+
28+
Goals
29+
-----
30+
31+
- Define a format for the specification of general constraints in jobspec
32+
- Embed extensibility into the format to allow for growth of feature set
33+
34+
Background
35+
----------
36+
37+
It is common practice for resource management systems to allow job
38+
requests to contain constraints beyond the size and count of resources
39+
that are being requested. Most often, these constraints specify a set
40+
of allowable features or *properties* which the assigned resources must
41+
satisfy. However more complex constraint satisfaction problems are often
42+
supported to allow for advanced resource matching.
43+
44+
This RFC defines an extensible format for the specification of job
45+
constraints in JSON.
46+
47+
Representation
48+
--------------
49+
50+
Job constraints SHALL be represented as a JSON object, which loosely
51+
follows the `JsonLogic <https://jsonlogic.com/>`_ format of
52+
53+
.. code:: json
54+
55+
{ "operator": [ "values", ] }
56+
57+
where each ``value`` can also be a constraint object. This format has
58+
several advantages:
59+
60+
* The set of supported operators can be restricted for ease of implementation
61+
then later extended for additional functionality
62+
* The format allows nesting to support complex constraints
63+
* Simple cases can be expressed simply
64+
65+
In this version of the RFC, only the following constraint operators SHALL be
66+
supported
67+
68+
- ``properties``: The set of values SHALL designate a set of required
69+
properties on execution targets. As a special case, if a property value
70+
begins with the character ``^``, then the remaining part of the value
71+
SHALL indicate a property that MUST NOT be included in the allocated
72+
resource set.
73+
74+
Future extensions
75+
~~~~~~~~~~~~~~~~~
76+
77+
The following constraint operators MAY be supported. If a job is submitted
78+
using these constraint operators, and the operators are not supported by
79+
the instance, then the job SHALL be rejected with an appropriate error
80+
message:
81+
82+
- ``not``: Logical negation. Takes a single value and negates it. For
83+
example, to constrain a job to only those resources that do not have
84+
a set of attributes ``foo`` and ``bar``, the following expression could
85+
be used
86+
87+
.. code:: json
88+
89+
{ "not": [{ "properties": [ "foo", "bar" ]}] }
90+
91+
- ``or``: Simple logical ``or``. Evaluates true if any one of the ``value``
92+
arguments is true, e.g. to constrain jobs to resources that have either
93+
``foo`` *or* ``bar``:
94+
95+
.. code:: json
96+
97+
{ "or": [{ "properties": [ "foo" ]}, { "properties": [ "bar" ]}] }
98+
99+
100+
- ``and``: Simple logical ``and``.
101+
102+
Examples
103+
--------
104+
105+
Constrain resources such that all execution targets have property ``ssd``:
106+
107+
.. code:: json
108+
109+
{ "properties": [ "ssd" ] }
110+
111+
Constrain resources such that no execution targets with property ``slowgpu``
112+
are allocated:
113+
114+
.. code:: json
115+
116+
{ "properties": [ "^slowgpu" ] }
117+
118+

0 commit comments

Comments
 (0)