Skip to content

Commit ade1abc

Browse files
authored
Merge pull request #291 from jameshcorbett/rabbit-presets
rabbit: add docs on preset #DW strings
2 parents 746ce80 + 1e8d92f commit ade1abc

File tree

1 file changed

+50
-3
lines changed

1 file changed

+50
-3
lines changed

tutorials/lab/rabbit.rst

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,53 @@ creating jobspecs directly.)
1818
On the command line, set the ``.attributes.system.dw`` field by passing flags
1919
like ``-S dw="my_string"`` or ``--setattr=dw="my_string"``.
2020

21+
The simplest way to use rabbits is to use preset DW strings that
22+
administrators may have configured on a system. For more flexibility,
23+
it may be desirable to write custom DW strings.
24+
25+
26+
Preset DW Directives
27+
--------------------
28+
29+
Running
30+
31+
.. code-block:: bash
32+
33+
flux config get rabbit.presets | jq .
34+
35+
will display a mapping of the presets that have been configured on the
36+
current system. The keys of the mapping are the strings that you can
37+
pass to ``-S dw=...``, the values of the mapping are the actual DW directives
38+
the strings correspond to.
39+
40+
41+
Preset Example
42+
~~~~~~~~~~~~~~
43+
44+
Suppose ``flux config get rabbit.presets | jq .`` returns the following:
45+
46+
.. code-block:: json
47+
48+
{
49+
"xfs_small": "#DW jobdw type=xfs capacity=256GiB name=xfssmall",
50+
"xfs_large": "#DW jobdw type=xfs capacity=1TiB name=xfslarge",
51+
"lustre_large": "#DW jobdw type=lustre capacity=10TiB name=lustrelarge",
52+
}
53+
54+
Then you should be able to add the flag ``-S dw=lustre_large`` to
55+
``flux run/batch/alloc/submit`` and have 10 Terabytes of lustre storage
56+
accessible to your job at a path given by the ``$DW_JOB_lustrelarge``
57+
environment variable. Similarly, ``-S dw=xfs_small`` and ``-S dw=xfs_large``
58+
would give your job 256 gigabytes and 1 terabyte of XFS storage at
59+
``$DW_JOB_xfssmall`` and ``$DW_JOB_xfslarge``, respectively.
60+
61+
62+
Custom DW Directives
63+
--------------------
64+
65+
Writing custom DW directives instead of using preset strings allows for much
66+
greater flexibility.
67+
2168
DW directives are strings that start with ``#DW``. Directives
2269
that begin with ``#DW jobdw`` are for requesting storage that
2370
lasts the lifetime of the associated flux job. Directives that
@@ -30,8 +77,8 @@ Full documentation of the DW directives and their arguments is available
3077
The usage with Flux is most easily understood by example.
3178

3279

33-
Examples of jobdw directives
34-
----------------------------
80+
Examples of custom jobdw directives
81+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3582

3683
Requesting a 10 gigabyte XFS file system per compute node on the
3784
command line:
@@ -59,7 +106,7 @@ Requesting both XFS and lustre file systems in a batch script:
59106
60107
61108
Data Movement Examples
62-
----------------------
109+
~~~~~~~~~~~~~~~~~~~~~~
63110

64111
.. warning::
65112

0 commit comments

Comments
 (0)