Skip to content

Commit cba26a6

Browse files
author
Al Chu11
committed
tutorials: add flux mini run tutorial
Problem: The flux mini submit tutorial was also supposed to have a flux mini run example, but was forgotten. Add flux mini run tutorial to flux mini submit.
1 parent 99e4ab5 commit cba26a6

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

tutorials/commands/flux-mini-submit.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.. _flux-mini-submit:
2+
.. _flux-mini-run:
23

34
==========================
45
How to Submit Jobs in Flux
@@ -40,6 +41,35 @@ the status of your running jobs with ``flux jobs``:
4041
ƒSUEFPDH fluxuser my_other_s R 1 1 1.842s
4142
ƒM5k8m7m fluxuser my_compute R 4 2 3.255s
4243
44+
-----------------------
45+
Interactively Run a Job
46+
-----------------------
47+
48+
If you wish to run a job interactively, e.g. see standard output as it runs, you can
49+
use the ``flux mini run`` command. It is identical to ``flux mini submit`` except it
50+
will handle stdio and it will block until the job has finished. For example:
51+
52+
.. code-block:: console
53+
54+
$ flux mini run bash -c "echo start; sleep 5; echo done"
55+
start
56+
done
57+
58+
In the above example, we run a small bash script that will output "start", sleep for 5 seconds,
59+
and then echo "done". Unlike ``flux mini submit``, you'll notice it does not output a jobid.
60+
If we check for the status of this job with ``flux jobs`` after it has run, you will not find the
61+
job listed because it is no longer running. Instead run ``flux jobs -a`` which will list all jobs,
62+
including completed jobs.
63+
64+
.. code-block:: console
65+
66+
$ flux jobs -a
67+
JOBID USER NAME ST NTASKS NNODES TIME INFO
68+
f2HnvmZy achu bash CD 1 1 5.119s catalyst159
69+
70+
71+
You will see that job is in the "CD" state or "Completed" state.
72+
4373
And that's it! If you have any questions, please
4474
`let us know <https://github.com/flux-framework/flux-docs/issues>`_.
4575

tutorials/commands/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Command Tutorials
66
Welcome to the Command Tutorials! These tutorials should help you to map specific Flux commands
77
with your use case, and then see detailed usage.
88

9-
- ``flux mini submit`` (:ref:`flux-mini-submit`): "Submit a job in a Flux instance"
9+
- ``flux mini submit/flux mini run`` (:ref:`flux-mini-submit`): "Submit a job in a Flux instance"
1010
- ``flux proxy`` (:ref:`ssh-across-clusters`): "Send commands to a Flux instance across clusters using ssh"
1111

1212
This section is currently 🚧️ under construction 🚧️, so please come back later to see more command tutorials!

0 commit comments

Comments
 (0)