You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -63,19 +63,21 @@ Run ``uname`` on two remote hosts in parallel with ``sudo``.
63
63
Linux
64
64
Linux
65
65
66
-
*******************
67
-
Native code client
68
-
*******************
66
+
**************
67
+
Native client
68
+
**************
69
69
70
-
As of version ``1.2.0``, a new client is supported in ``ParallelSSH`` which offers much greater performance and reduced overhead than the current default client library. Binary wheel packages with ``libssh2`` included are provided for Linux, OSX and Windows platforms and all supported Python versions.
70
+
Starting from version ``1.2.0``, a new client is supported in ``parallel-ssh`` which offers much greater performance and reduced overhead than the current default client.
71
71
72
-
The new client is based on ``libssh2`` via the ``ssh2-python`` extension library and supports non-blocking mode natively. In addition, SFTP push/pull operations in the new client have also been implemented in native code, allowing for much greater performance and significantly reduced overhead.
72
+
The new client is based on ``libssh2`` via the ``ssh2-python`` extension library and supports non-blocking mode natively. Binary wheel packages with ``libssh2`` included are provided for Linux, OSX and Windows platforms and all supported Python versions.
73
73
74
74
See `this post <https://parallel-ssh.org/post/parallel-ssh-libssh2>`_ for a performance comparison of the available clients.
75
75
76
76
To make use of this new client, ``ParallelSSHClient`` can be imported from ``pssh.pssh2_client`` instead. Their respective APIs are almost identical.
77
77
78
-
Note that the new client will become the default and will replace the current ``pssh.pssh_client`` in a new major version of the library - ``2.x.x`` - once remaining features have been implemented. The current client will remain available as an option under a new name.
78
+
The new client will become the default and will replace the current ``pssh.pssh_client`` in a new major version of the library - ``2.0.0`` - once remaining features have been implemented. The native client should be considered as *beta* status until the ``2.0.0`` release when it is made the default.
79
+
80
+
The current default client will remain available as an option under a new name.
79
81
80
82
For example:
81
83
@@ -101,9 +103,8 @@ Native Code Client Features
101
103
****************************
102
104
103
105
* Highest performance and least overhead of any Python SSH libraries
104
-
* Thread safe - utilises both native threads for blocking calls like authentication and non-blocking I/O
106
+
* Thread safe - makes use of native threads for blocking calls like authentication
105
107
* Natively non-blocking utilising ``libssh2`` via ``ssh2-python`` - **no monkey patching of the Python standard library**
106
-
* Native binary-like SFTP speeds thanks to SFTP and local file read/write native code implementations
107
108
* Significantly reduced overhead in CPU and memory usage
Copy file name to clipboardExpand all lines: doc/advanced.rst
+32-6Lines changed: 32 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ will disable this behaviour.
20
20
Programmatic Private Keys
21
21
--------------------------
22
22
23
-
By default, ``ParallelSSH`` will use all keys in an available SSH agent and identity keys under the user's SSH directory - ``id_rsa``and ``id_dsa`` in ``~/.ssh``.
23
+
By default, ``parallel-ssh`` will use all keys in an available SSH agent and identity keys under the user's SSH directory - ``id_rsa``, ``id_dsa`` and ``identity`` in ``~/.ssh``.
24
24
25
25
A private key can also be provided programmatically.
26
26
@@ -55,7 +55,7 @@ Use of an available SSH agent can also be disabled.
55
55
56
56
If the number of hosts is large enough, available connections to the system SSH agent may be exhausted which will stop the client from working on a subset of hosts.
57
57
58
-
This is a limitation of the underlying SSH client used by ``ParallelSSH``.
58
+
This is a limitation of the underlying SSH client used by ``parallel-ssh``.
59
59
60
60
Programmatic SSH Agent
61
61
-----------------------
@@ -85,6 +85,32 @@ It is also possible to programmatically provide an SSH agent for the client to u
85
85
:py:class:`pssh.agent.SSHAgent`
86
86
87
87
88
+
Native clients
89
+
*****************
90
+
91
+
Starting from version ``1.2.0``, a new client is supported in ``parallel-ssh`` which offers much greater performance and reduced overhead than the current default client.
92
+
93
+
The new client is based on ``libssh2`` via the ``ssh2-python`` extension library and supports non-blocking mode natively. Binary wheel packages with ``libssh2`` included are provided for Linux, OSX and Windows platforms and all supported Python versions.
94
+
95
+
See `this post <https://parallel-ssh.org/post/parallel-ssh-libssh2>`_ for a performance comparison of the available clients.
96
+
97
+
To make use of this new client, ``ParallelSSHClient`` can be imported from ``pssh.pssh2_client`` instead. Their respective APIs are almost identical.
98
+
99
+
.. code-block:: python
100
+
101
+
from pssh.pssh2_client import ParallelSSHClient
102
+
103
+
hosts = ['my_host', 'my_other_host']
104
+
client = ParallelSSHClient(hosts)
105
+
client.run_command(<..>)
106
+
107
+
108
+
.. seealso::
109
+
110
+
`Feature comparison <ssh2.html>`_ for how the client features compare.
111
+
112
+
API documentation for `parallel <pssh2_client.html>`_ and `single <ssh2_client.html>`_ native clients.
113
+
88
114
Tunneling
89
115
**********
90
116
@@ -119,7 +145,7 @@ In the above example, connections to the target hosts are made via ``my_proxy_us
119
145
120
146
Proxy host connections are asynchronous and use the SSH protocol's native TCP tunneling - aka local port forward. No external commands or processes are used for the proxy connection, unlike the `ProxyCommand` directive in OpenSSH and other utilities.
121
147
122
-
While connections initiated by ``ParallelSSH`` are asynchronous, connections from proxy host -> target hosts may not be, depending on SSH server implementation. If only one proxy host is used to connect to a large number of target hosts and proxy SSH server connections are *not* asynchronous, this may adversely impact performance on the proxy host.
148
+
While connections initiated by ``parallel-ssh`` are asynchronous, connections from proxy host -> target hosts may not be, depending on SSH server implementation. If only one proxy host is used to connect to a large number of target hosts and proxy SSH server connections are *not* asynchronous, this may adversely impact performance on the proxy host.
123
149
124
150
Per-Host Configuration
125
151
***********************
@@ -205,7 +231,7 @@ See :py:func:`run_command API documentation <pssh.pssh_client.ParallelSSHClient.
205
231
Run with sudo
206
232
---------------
207
233
208
-
``ParallelSSH`` can be instructed to run its commands under ``sudo``:
234
+
``parallel-ssh`` can be instructed to run its commands under ``sudo``:
209
235
210
236
.. code-block:: python
211
237
@@ -248,7 +274,7 @@ Contents of ``stdout`` will be `UTF-16` encoded.
248
274
Disabling use of pseudo terminal emulation
249
275
--------------------------------------------
250
276
251
-
By default, ``ParallelSSH`` uses the user's configured shell to run commands with. As a shell is used by default, a pseudo terminal (`PTY`) is also requested by default.
277
+
By default, ``parallel-ssh`` uses the user's configured shell to run commands with. As a shell is used by default, a pseudo terminal (`PTY`) is also requested by default.
252
278
253
279
For cases where use of a `PTY`isnot wanted, such as having separate stdout and stderr outputs, the remote command is a daemon that needs to fork and detach itself or when use of a shell is explicitly disabled, use of PTY can also be disabled.
254
280
@@ -425,7 +451,7 @@ Hosts list can be modified in place. A call to ``run_command`` will create new c
425
451
Additional options for underlying SSH libraries
426
452
************************************************
427
453
428
-
Not allSSH library configuration options are used directly by ``Parallel-SSH``.
454
+
Not allSSH library configuration options are used directly by ``parallel-ssh``.
429
455
430
456
Additional options can be passed on to the underlying SSH libraries used via an optional keyword argument.
``parallel-ssh`` is a non-blocking parallel SSH client library.
24
22
25
-
``parallel-ssh`` is a parallel SSH client library.
26
-
27
-
It uses asynchronous non-blocking SSH connections and is, to date, the only publicly available non-blocking SSH client library for Python, as well as the only non-blocking *parallel* SSH client library available for Python.
23
+
It uses non-blocking asynchronous SSH sessions and is, to date, the only publicly available non-blocking SSH client library for Python, as well as the only non-blocking *parallel* SSH client library available for Python.
28
24
29
25
.. toctree::
30
26
:maxdepth:2
@@ -34,6 +30,7 @@ It uses asynchronous non-blocking SSH connections and is, to date, the only publ
Copy file name to clipboardExpand all lines: doc/introduction.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
Design And Goals
3
3
*****************
4
4
5
-
``Parallel-SSH``'s design goals and motivation are to provide a *library* for running *asynchronous* SSH commands in parallel with little to no load induced on the system by doing so with the intended usage being completely programmatic and non-interactive.
5
+
``parallel-ssh``'s design goals and motivation are to provide a *library* for running *asynchronous* SSH commands in parallel with little to no load induced on the system by doing so with the intended usage being completely programmatic and non-interactive.
6
6
7
7
To meet these goals, API driven solutions are preferred first and foremost. This frees up the developer to drive the library via any method desired, be that environment variables, CI driven tasks, command line tools, existing OpenSSH or new configuration files, from within an application et al.
Copy file name to clipboardExpand all lines: doc/quickstart.rst
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,20 @@
2
2
Quickstart
3
3
***********
4
4
5
-
First, make sure that ``parallel-ssh`` is `installed <installation>`_.
5
+
First, make sure that ``parallel-ssh`` is `installed <installation.html>`_.
6
6
7
7
.. note::
8
8
9
-
ParallelSSH uses gevent's monkey patching to enable asynchronous use of the Python standard library's network I/O.
9
+
``parallel-ssh`` uses gevent's monkey patching to enable asynchronous use of the Python standard library's network I/O.
10
10
11
11
Make sure that ParallelSSH imports come **before** any other imports in your code. Otherwise, patching may not be done before the standard library is loaded which will then cause ParallelSSH to block.
12
12
13
13
If you are seeing messages like ``This operation would block forever``, this is the cause.
14
14
15
+
Monkey patching is only done for the clients under ``pssh.pssh_client`` and ``pssh.ssh_client`` for parallel and single host clients respectively.
16
+
17
+
New native library based clients under ``pssh.pssh2_client`` and ``pssh.ssh2_client`` **do not perform monkey patching** and are an option if monkey patching is not suitable. These clients are currently in beta and will become the default in a future major release - ``2.0.0``.
18
+
15
19
Run a command on hosts in parallel
16
20
------------------------------------
17
21
@@ -207,4 +211,4 @@ With this flag, the ``exception`` attribute will contain the exception on any fa
207
211
208
212
.. seealso::
209
213
210
-
Possible exceptions can be found in :mod:`pssh.exceptions` module.
214
+
Exceptions raised by the library can be found in :mod:`pssh.exceptions` module.
0 commit comments