Skip to content

Commit

Permalink
tutorials: add flux mini run tutorial
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Al Chu11 authored and mergify[bot] committed Feb 13, 2023
1 parent a260890 commit c361e3c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
30 changes: 30 additions & 0 deletions tutorials/commands/flux-mini-submit.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.. _flux-mini-submit:
.. _flux-mini-run:

==========================
How to Submit Jobs in Flux
Expand Down Expand Up @@ -40,6 +41,35 @@ the status of your running jobs with ``flux jobs``:
ƒSUEFPDH fluxuser my_other_s R 1 1 1.842s
ƒM5k8m7m fluxuser my_compute R 4 2 3.255s
-----------------------
Interactively Run a Job
-----------------------

If you wish to run a job interactively, e.g. see standard output as it runs, you can
use the ``flux mini run`` command. It is identical to ``flux mini submit`` except it
will handle stdio and it will block until the job has finished. For example:

.. code-block:: console
$ flux mini run bash -c "echo start; sleep 5; echo done"
start
done
In the above example, we run a small bash script that will output "start", sleep for 5 seconds,
and then echo "done". Unlike ``flux mini submit``, you'll notice it does not output a jobid.
If we check for the status of this job with ``flux jobs`` after it has run, you will not find the
job listed because it is no longer running. Instead run ``flux jobs -a`` which will list all jobs,
including completed jobs.

.. code-block:: console
$ flux jobs -a
JOBID USER NAME ST NTASKS NNODES TIME INFO
f2HnvmZy achu bash CD 1 1 5.119s catalyst159
You will see that job is in the "CD" state or "Completed" state.

And that's it! If you have any questions, please
`let us know <https://github.com/flux-framework/flux-docs/issues>`_.

Expand Down
2 changes: 1 addition & 1 deletion tutorials/commands/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Command Tutorials
Welcome to the Command Tutorials! These tutorials should help you to map specific Flux commands
with your use case, and then see detailed usage.

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

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

0 comments on commit c361e3c

Please sign in to comment.