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
* Added ssh-python parallel and single client implementations
* Updated readme, changelog and documentation
* Re-do join with timeout to be on all commands rather than EAGAIN on any - #207
* Moved tests into their own packages
Copy file name to clipboardExpand all lines: Changelog.rst
+38-1Lines changed: 38 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,46 @@
1
1
Change Log
2
2
============
3
3
4
+
1.12.0
5
+
++++++
6
+
7
+
Changes
8
+
--------
9
+
10
+
* Added `ssh-python` (`libssh <https://libssh.org>`_) based native client with `run_command` implementation.
11
+
* ``ParallelSSHClient.join`` with timeout no longer consumes output by default to allow reading of output after timeout.
12
+
13
+
Fixes
14
+
------
15
+
16
+
* ``ParallelSSHClient.join`` with timeout would raise ``Timeout`` before value given when client was busy with other commands.
17
+
18
+
.. note::
19
+
20
+
``ssh-python`` client at `pssh.clients.ssh.ParallelSSHClient` is available for testing. Please report any issues.
21
+
22
+
To use:
23
+
24
+
.. code-block:: python
25
+
26
+
from pssh.clients.ssh import ParallelSSHClient
27
+
28
+
This release adds (yet another) client, this one based on `ssh-python <https://github.com/ParallelSSH/ssh-python>`_ (`libssh <https://libssh.org>`_). Key features of this client are more supported authentication methods compared to `ssh2-python`.
29
+
30
+
Future releases will also enable certificate authentication for the ssh-python client.
31
+
32
+
Please migrate to one of the two native clients if have not already as paramiko is very quickly accumulating yet more bugs and the `2.0.0` release which removes it is imminent.
33
+
34
+
Users that require paramiko for any reason can pin their parallel-ssh versions to `parallel-ssh<2.0.0`.
35
+
36
+
4
37
1.11.2
5
38
++++++
6
39
7
40
Fixes
8
41
------
9
42
10
-
* `ParallelSSHClient.disconnect` would cause new client sessions to fail if `client.join` was not called prior - #200
43
+
* `ParallelSSHClient` going out of scope would cause new client sessions to fail if `client.join` was not called prior - #200
11
44
12
45
13
46
1.11.0
@@ -18,6 +51,8 @@ Changes
18
51
19
52
* Moved polling to gevent.select.poll to increase performance and better handle high number of sockets - #189
20
53
* ``HostOutput.exit_code`` is now a dynamic property returning either ``None`` when exit code not ready or the exit code as reported by channel. ``ParallelSSHClient.get_exit_codes`` is now a no-op and scheduled to be removed.
54
+
* Native client exit codes are now more explicit and return ``None`` if no exit code is ready. Would previously return ``0`` by default.
55
+
21
56
22
57
Packaging
23
58
---------
@@ -29,6 +64,7 @@ Fixes
29
64
30
65
* Native client would fail on opening sockets with large file descriptor values - #189
31
66
67
+
32
68
1.10.0
33
69
+++++++
34
70
@@ -39,6 +75,7 @@ Changes
39
75
* Updated native clients for new version of ``ssh2-python``.
@@ -71,26 +69,21 @@ Run ``uname`` on two remote hosts in parallel with ``sudo``.
71
69
Native client
72
70
**************
73
71
74
-
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.
72
+
Starting from version ``1.2.0``, the default client in ``parallel-ssh`` has changed to the native clint which offers much greater performance and reduced overhead than the current default client.
75
73
76
-
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.
74
+
The new default 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.
77
75
78
76
See `this post <https://parallel-ssh.org/post/parallel-ssh-libssh2>`_ for a performance comparison of the available clients.
79
77
80
-
To make use of this new client, ``ParallelSSHClient`` can be imported from ``pssh.clients.native`` instead. Their respective APIs are almost identical.
81
-
82
-
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``.
83
-
84
-
The paramiko based client will become an optional install via pip `extras`, available under ``pssh.clients.miko``.
78
+
The paramiko based client under ``pssh.clients.miko`` and the old ``pssh.pssh_client`` imports will be **removed** on the release of ``2.0.0``.
85
79
86
-
For example:
80
+
Default client:
87
81
88
82
.. code-block:: python
89
83
90
-
from pprint import pprint
91
-
from pssh.clients.native import ParallelSSHClient
84
+
from pssh.clients import ParallelSSHClient
92
85
93
-
hosts = ['myhost1', 'myhost2']
86
+
hosts = ['localhost', 'localhost']
94
87
client = ParallelSSHClient(hosts)
95
88
96
89
output = client.run_command('uname')
@@ -106,8 +99,8 @@ See `documentation <http://parallel-ssh.readthedocs.io/en/latest/ssh2.html>`_ fo
106
99
Native Code Client Features
107
100
****************************
108
101
109
-
* Highest performance and least overhead of any Python SSH libraries
110
-
* Thread safe - makes use of native threads for blocking calls like authentication
102
+
* Highest performance and least overhead of any Python SSH library
103
+
* Thread safe - makes use of native threads for CPU bound calls like authentication
111
104
* Natively non-blocking utilising ``libssh2`` via ``ssh2-python`` - **no monkey patching of the Python standard library**
112
105
* Significantly reduced overhead in CPU and memory usage
113
106
@@ -116,7 +109,7 @@ Native Code Client Features
116
109
Exit codes
117
110
***********
118
111
119
-
Once *either* standard output is iterated on *to completion*, or ``client.join(output)`` is called, exit codes become available in host output.
112
+
Once *either* standard output is iterated on *to completion*, or ``client.join(output, consume_output=True)`` is called, exit codes become available in host output.
120
113
121
114
Iteration ends *only when remote command has completed*, though it may be interrupted and resumed at any point.
122
115
@@ -126,44 +119,52 @@ Once all output has been gathered exit codes become available even without calli
The client's ``join`` function can be used to wait for all commands in output object to finish.
138
137
139
-
The client's ``join`` function can be used to wait for all commands in output object to finish:
138
+
After ``join`` returns, commands have finished and output can be read.
140
139
141
140
.. code-block:: python
142
141
143
142
client.join(output)
144
143
145
-
Similarly, output and exit codes are available after ``client.join`` is called:
144
+
for host_out in output:
145
+
for line in host_output.stdout:
146
+
print(line)
147
+
print(host_out.exit_code)
146
148
147
-
.. code-block:: python
149
+
Similarly, exit codes are available after ``client.join(output, consume_output=True)``.
148
150
149
-
frompprint import pprint
151
+
``consume_output`` flag must be set to get exit codes when not reading from ``stdout``. Future releases aim to remove the need for `consume_output` to be set.
150
152
151
-
output = client.run_command('exit 0')
153
+
.. code-block:: python
152
154
153
-
# Wait for commands to complete
154
-
client.join(output)
155
-
pprint(output.values()[0].exit_code)
155
+
output = client.run_command('uname')
156
156
157
-
# Output remains available in output generators
158
-
for host, host_output in output.items():
159
-
for line in host_output.stdout:
160
-
pprint(line)
157
+
# Wait for commands to complete and consume output so can get exit codes
158
+
client.join(output, consume_output=True)
159
+
160
+
for host_output in output:
161
+
print(host_out.exit_code)
161
162
162
163
:Output:
163
164
.. code-block:: python
164
165
165
166
0
166
-
<..stdout..>
167
+
0
167
168
168
169
169
170
There is also a built in host logger that can be enabled to log output from remote hosts. The helper function ``pssh.utils.enable_host_logger`` will enable host logging to stdout.
@@ -175,7 +176,8 @@ To log output without having to iterate over output generators, the ``consume_ou
@@ -259,7 +261,7 @@ As always, it is best to use a tool that is suited to the task at hand. ``parall
259
261
Paramiko
260
262
________
261
263
262
-
The default SSH client library in ``parallel-ssh`` ``1.x.x`` series.
264
+
The default SSH client library in ``parallel-ssh`` <=``1.6.x`` series.
263
265
264
266
Pure Python code, while having native extensions as dependencies, with poor performance and numerous bugs compared to both OpenSSH binaries and the ``libssh2`` based native clients in ``parallel-ssh`` ``1.2.x`` and above. Recent versions have regressed in performance and have `blocker issues <https://github.com/ParallelSSH/parallel-ssh/issues/83>`_.
0 commit comments