cmd-queue 0.1.13__py3-none-any.whl → 0.1.14__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cmd-queue might be problematic. Click here for more details.
- cmd_queue/__init__.py +12 -4
- cmd_queue/__main__.py +33 -20
- {cmd_queue-0.1.13.dist-info → cmd_queue-0.1.14.dist-info}/METADATA +28 -30
- {cmd_queue-0.1.13.dist-info → cmd_queue-0.1.14.dist-info}/RECORD +8 -8
- {cmd_queue-0.1.13.dist-info → cmd_queue-0.1.14.dist-info}/LICENSE +0 -0
- {cmd_queue-0.1.13.dist-info → cmd_queue-0.1.14.dist-info}/WHEEL +0 -0
- {cmd_queue-0.1.13.dist-info → cmd_queue-0.1.14.dist-info}/entry_points.txt +0 -0
- {cmd_queue-0.1.13.dist-info → cmd_queue-0.1.14.dist-info}/top_level.txt +0 -0
cmd_queue/__init__.py
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
r"""
|
|
2
|
-
|
|
2
|
+
The cmd_queue module is a tool that lets users define a DAG of bash commands.
|
|
3
|
+
This DAG can be executed in a lightweight tmux backend, or a heavyweight slurm
|
|
4
|
+
backend, or in simple serial mode that runs in the foreground thread. Rich
|
|
5
|
+
provides monitoring / live control. For more information see the gitlab
|
|
6
|
+
`README <https://gitlab.kitware.com/computer-vision/cmd_queue>`_.
|
|
7
|
+
There is also a
|
|
8
|
+
`Google slides presentation <https://docs.google.com/presentation/d/1BjJkjMx6bxu1uek-hAGpwj760u9rraVn7st8J5OsZME>`_
|
|
9
|
+
that gives a high level overview.
|
|
10
|
+
|
|
11
|
+
The following examples show how to use the cmd_queue API in Python. For
|
|
12
|
+
examples of the Bash API see: :mod:`cmd_queue.__main__`.
|
|
3
13
|
|
|
4
|
-
Serves as a frontend for several DAG backends, including our own custom tmux
|
|
5
|
-
queue. We also support slurm and will soon support airflow.
|
|
6
14
|
|
|
7
15
|
Example:
|
|
8
16
|
>>> # The available backends classmethod lets you know which backends
|
|
@@ -295,7 +303,7 @@ Example:
|
|
|
295
303
|
__mkinit__ = """
|
|
296
304
|
mkinit -m cmd_queue
|
|
297
305
|
"""
|
|
298
|
-
__version__ = '0.1.
|
|
306
|
+
__version__ = '0.1.14'
|
|
299
307
|
|
|
300
308
|
|
|
301
309
|
__submodules__ = {
|
cmd_queue/__main__.py
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
# PYTHON_ARGCOMPLETE_OK
|
|
3
|
+
"""
|
|
4
|
+
This is the main script for the cmd_queue CLI. The :class:`CmdQueueConfig`
|
|
5
|
+
defines the available options and its docstring provides a quick tutorial.
|
|
6
|
+
For help run:
|
|
7
|
+
|
|
8
|
+
.. code:: bash
|
|
9
|
+
|
|
10
|
+
cmd_queue --help
|
|
11
|
+
|
|
12
|
+
"""
|
|
3
13
|
import scriptconfig as scfg
|
|
4
14
|
import ubelt as ub
|
|
5
15
|
|
|
@@ -12,13 +22,12 @@ class CmdQueueConfig(scfg.DataConfig):
|
|
|
12
22
|
Most behaviors are related to creating and submitting custom queues.
|
|
13
23
|
|
|
14
24
|
The ``cleanup`` action is for helping to manage the tmux backend, maingly
|
|
15
|
-
killing session names that start with "cmdq_"
|
|
25
|
+
killing session names that start with ``"cmdq_"``.
|
|
16
26
|
|
|
17
|
-
|
|
27
|
+
Step 1: Initialize a new queue
|
|
28
|
+
###############################
|
|
18
29
|
|
|
19
|
-
|
|
20
|
-
# Step 1: Initialize a new queue
|
|
21
|
-
#################################
|
|
30
|
+
.. code:: bash
|
|
22
31
|
|
|
23
32
|
cmd_queue new "my_cli_queue"
|
|
24
33
|
|
|
@@ -32,9 +41,10 @@ class CmdQueueConfig(scfg.DataConfig):
|
|
|
32
41
|
# e.g. for pyenv
|
|
33
42
|
cmd_queue new "my_cli_queue" --header="pyenv shell 3.11.0 && source $PYENV_ROOT/versions/3.11.0/envs/pyenv3.11.0/bin/activate"
|
|
34
43
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
Step 2: Initialize a new queue
|
|
45
|
+
###############################
|
|
46
|
+
|
|
47
|
+
.. code:: bash
|
|
38
48
|
|
|
39
49
|
cmd_queue submit "my_cli_queue" -- echo hello world
|
|
40
50
|
cmd_queue submit "my_cli_queue" -- echo "hello world"
|
|
@@ -45,14 +55,17 @@ class CmdQueueConfig(scfg.DataConfig):
|
|
|
45
55
|
cmd_queue submit "my_cli_queue" -- 'cowsay MOOOOOO && sleep 3'
|
|
46
56
|
cmd_queue submit "my_cli_queue" -- 'cowsay MOOOOOOOO && sleep 4'
|
|
47
57
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
58
|
+
Step 3: Inspect your commands before you run
|
|
59
|
+
#############################################
|
|
60
|
+
|
|
61
|
+
.. code:: bash
|
|
62
|
+
|
|
51
63
|
cmd_queue show "my_cli_queue"
|
|
52
64
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
Step 4: Run your commands
|
|
66
|
+
##########################
|
|
67
|
+
|
|
68
|
+
.. code:: bash
|
|
56
69
|
|
|
57
70
|
# Run using the serial backend
|
|
58
71
|
cmd_queue run "my_cli_queue" --backend=serial
|
|
@@ -60,9 +73,10 @@ class CmdQueueConfig(scfg.DataConfig):
|
|
|
60
73
|
# Run using the tmux backend
|
|
61
74
|
cmd_queue run "my_cli_queue" --backend=tmux --workers=2
|
|
62
75
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
76
|
+
Extra: other features
|
|
77
|
+
#####################
|
|
78
|
+
|
|
79
|
+
.. code:: bash
|
|
66
80
|
|
|
67
81
|
# List all the known queues you've created
|
|
68
82
|
cmd_queue list
|
|
@@ -99,7 +113,7 @@ class CmdQueueConfig(scfg.DataConfig):
|
|
|
99
113
|
'''
|
|
100
114
|
))
|
|
101
115
|
|
|
102
|
-
def
|
|
116
|
+
def __post_init__(config):
|
|
103
117
|
if config['dpath'] == 'auto':
|
|
104
118
|
config['dpath'] = str(ub.Path.appdir('cmd_queue/cli'))
|
|
105
119
|
|
|
@@ -109,8 +123,7 @@ def main(cmdline=1, **kwargs):
|
|
|
109
123
|
Example:
|
|
110
124
|
>>> # xdoctest: +SKIP
|
|
111
125
|
>>> cmdline = 0
|
|
112
|
-
>>> kwargs = dict(
|
|
113
|
-
>>> )
|
|
126
|
+
>>> kwargs = dict()
|
|
114
127
|
>>> main(cmdline=cmdline, **kwargs)
|
|
115
128
|
"""
|
|
116
129
|
import json
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cmd-queue
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.14
|
|
4
4
|
Summary: The cmd_queue module for a DAG of bash commands
|
|
5
5
|
Home-page: https://gitlab.kitware.com/computer-vision/cmd_queue
|
|
6
6
|
Author: Kitware Inc., Jon Crall
|
|
@@ -49,7 +49,7 @@ Requires-Dist: xdoctest ; extra == 'all'
|
|
|
49
49
|
Provides-Extra: all-strict
|
|
50
50
|
Requires-Dist: ubelt (==1.2.3) ; extra == 'all-strict'
|
|
51
51
|
Requires-Dist: rich (==12.5.1) ; extra == 'all-strict'
|
|
52
|
-
Requires-Dist: scriptconfig (==0.7.
|
|
52
|
+
Requires-Dist: scriptconfig (==0.7.8) ; extra == 'all-strict'
|
|
53
53
|
Requires-Dist: psutil (==5.9.1) ; extra == 'all-strict'
|
|
54
54
|
Requires-Dist: ruamel.yaml (==0.17.21) ; extra == 'all-strict'
|
|
55
55
|
Requires-Dist: xdoctest (==1.0.1) ; extra == 'all-strict'
|
|
@@ -106,7 +106,7 @@ Requires-Dist: textual ; (python_version >= "3.7") and extra == 'optional'
|
|
|
106
106
|
Provides-Extra: runtime-strict
|
|
107
107
|
Requires-Dist: ubelt (==1.2.3) ; extra == 'runtime-strict'
|
|
108
108
|
Requires-Dist: rich (==12.5.1) ; extra == 'runtime-strict'
|
|
109
|
-
Requires-Dist: scriptconfig (==0.7.
|
|
109
|
+
Requires-Dist: scriptconfig (==0.7.8) ; extra == 'runtime-strict'
|
|
110
110
|
Requires-Dist: psutil (==5.9.1) ; extra == 'runtime-strict'
|
|
111
111
|
Requires-Dist: ruamel.yaml (==0.17.21) ; extra == 'runtime-strict'
|
|
112
112
|
Requires-Dist: numpy (==1.19.3) ; (python_version < "3.10" and python_version >= "3.6.0") and extra == 'runtime-strict'
|
|
@@ -152,12 +152,10 @@ Command Queue - cmd_queue
|
|
|
152
152
|
|Pypi| |Downloads| |ReadTheDocs|
|
|
153
153
|
|
|
154
154
|
|
|
155
|
-
.. The ``cmd_queue`` module.
|
|
156
|
-
|
|
157
155
|
+------------------+-------------------------------------------------------------------------------------+
|
|
158
156
|
| Read the docs | https://cmd_queue.readthedocs.io |
|
|
159
157
|
+------------------+-------------------------------------------------------------------------------------+
|
|
160
|
-
|
|
|
158
|
+
| Gitlab | https://gitlab.kitware.com/computer-vision/cmd_queue |
|
|
161
159
|
+------------------+-------------------------------------------------------------------------------------+
|
|
162
160
|
| Pypi | https://pypi.org/project/cmd_queue |
|
|
163
161
|
+------------------+-------------------------------------------------------------------------------------+
|
|
@@ -203,6 +201,28 @@ Features
|
|
|
203
201
|
* Rich monitoring / live-control
|
|
204
202
|
|
|
205
203
|
|
|
204
|
+
Installation
|
|
205
|
+
============
|
|
206
|
+
|
|
207
|
+
The cmd_queue package is available on pypi.
|
|
208
|
+
|
|
209
|
+
.. code:: bash
|
|
210
|
+
|
|
211
|
+
pip install cmd_queue
|
|
212
|
+
|
|
213
|
+
The serial queue backend will always work. To gain access other backends you
|
|
214
|
+
must install their associated dependencies. The tmux backend is the easiest and
|
|
215
|
+
simply requires that tmux is installed (e.g. ``sudo apt install tmux`` on
|
|
216
|
+
Debian systems).
|
|
217
|
+
|
|
218
|
+
Other backends require more complex setups. The slurm backend will require that
|
|
219
|
+
`slurm is installed <https://slurm.schedmd.com/quickstart_admin.html>`_ and the
|
|
220
|
+
daemon is running. The slurm backend is functional and tested, but improvements
|
|
221
|
+
can still be made (help wanted). The airflow backend similarly requires a
|
|
222
|
+
configured airflow server, but is not fully functional or tested (contributions
|
|
223
|
+
to make airflow work / easier are wanted!).
|
|
224
|
+
|
|
225
|
+
|
|
206
226
|
Tmux Queue Demo
|
|
207
227
|
===============
|
|
208
228
|
|
|
@@ -252,8 +272,8 @@ command templating is correct before the queue is executed with ``run``.
|
|
|
252
272
|
:align: left
|
|
253
273
|
|
|
254
274
|
|
|
255
|
-
The ``print_graph`` command will render the DAG to be executed using
|
|
256
|
-
text <https://
|
|
275
|
+
The ``print_graph`` command will render the DAG to be executed using
|
|
276
|
+
`network text <https://networkx.org/documentation/stable/reference/readwrite/generated/networkx.readwrite.text.write_network_text.html#networkx.readwrite.text.write_network_text>`_.
|
|
257
277
|
And finally ``run`` is called with ``block=True``, which starts executing the
|
|
258
278
|
DAG and displays progress and job status in rich or textual monitor.
|
|
259
279
|
|
|
@@ -549,28 +569,6 @@ This prints the very simple slurm submission script:
|
|
|
549
569
|
|
|
550
570
|
|
|
551
571
|
|
|
552
|
-
Installation
|
|
553
|
-
============
|
|
554
|
-
|
|
555
|
-
The cmd_queue package is available on pypi.
|
|
556
|
-
|
|
557
|
-
.. code:: bash
|
|
558
|
-
|
|
559
|
-
pip install cmd_queue
|
|
560
|
-
|
|
561
|
-
The serial queue backend will always work. To gain access other backends you
|
|
562
|
-
must install their associated dependencies. The tmux backend is the easiest and
|
|
563
|
-
simply requires that tmux is installed (e.g. ``sudo apt install tmux`` on
|
|
564
|
-
Debian systems).
|
|
565
|
-
|
|
566
|
-
Other backends require more complex setups. The slurm backend will require that
|
|
567
|
-
slurm is installed and the daemon is running. The slurm backend is functional
|
|
568
|
-
and tested, but improvements can still be made (help wanted). The airflow
|
|
569
|
-
backend similarly requires a configured airflow server, but is not fully
|
|
570
|
-
functional or tested (contributions to make airflow work / easier are wanted!).
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
572
|
.. |Pypi| image:: https://img.shields.io/pypi/v/cmd_queue.svg
|
|
575
573
|
:target: https://pypi.python.org/pypi/cmd_queue
|
|
576
574
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
cmd_queue/__init__.py,sha256=
|
|
2
|
-
cmd_queue/__main__.py,sha256=
|
|
1
|
+
cmd_queue/__init__.py,sha256=f2dntM8omHeqviSQ7lmSbsKk-rSam1fHwROXoZC8oNI,14870
|
|
2
|
+
cmd_queue/__main__.py,sha256=zgHtvXbQcpw3R2BXa5EF0BREeBdWJ4INPfSd0kYJ7WU,7192
|
|
3
3
|
cmd_queue/airflow_queue.py,sha256=zJ86GckW5yXVcy9gCK7dmRlezs7H5ABpUWK7FeVtJSk,10414
|
|
4
4
|
cmd_queue/base_queue.py,sha256=HQQAqioNn97UCh2qTSumww2zewdip6KEaSkg-FDcucg,13824
|
|
5
5
|
cmd_queue/cli_boilerplate.py,sha256=kGeStl6F5uY_sGQoYiYgHfpLN9Di9YymPJdEkS_9Kpc,8430
|
|
@@ -16,9 +16,9 @@ cmd_queue/util/util_networkx.py,sha256=5CV8MCAokAnHneC-_Sg2sQ4MOxkj3KYpRNn_t8kya
|
|
|
16
16
|
cmd_queue/util/util_tags.py,sha256=Hlxpel759AduUy3Wdq3fCe-XKjxqBUFCLOr3Mw2bzsw,719
|
|
17
17
|
cmd_queue/util/util_tmux.py,sha256=vC4xeYZCV8uVAp363zD24ROyKqUAdCynIULNJ8UgLQE,1078
|
|
18
18
|
cmd_queue/util/util_yaml.py,sha256=uWyENCbjBt-tx7LtkI_JHWnBSe3jbx8d4H7JT1giH0k,9281
|
|
19
|
-
cmd_queue-0.1.
|
|
20
|
-
cmd_queue-0.1.
|
|
21
|
-
cmd_queue-0.1.
|
|
22
|
-
cmd_queue-0.1.
|
|
23
|
-
cmd_queue-0.1.
|
|
24
|
-
cmd_queue-0.1.
|
|
19
|
+
cmd_queue-0.1.14.dist-info/LICENSE,sha256=o6jcFk_bwjiPUz6vHK0Ju7RwbFp9eXMwAS2BDnwER-4,11343
|
|
20
|
+
cmd_queue-0.1.14.dist-info/METADATA,sha256=v8Ji1ff1gQkXkRrahEB5C185oy9Q7aURFXTkhzq3gQw,29128
|
|
21
|
+
cmd_queue-0.1.14.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
22
|
+
cmd_queue-0.1.14.dist-info/entry_points.txt,sha256=HDxa1dTf0Dne-a-QeDu7cWZVYRyEtCvqaau0GCCMEyw,54
|
|
23
|
+
cmd_queue-0.1.14.dist-info/top_level.txt,sha256=C2JVEsOZsjnMx3jIAWhIQGWAXjGs-hyBzzjkOIm7qW8,10
|
|
24
|
+
cmd_queue-0.1.14.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|