Commit Graph

811 Commits (master)

Author SHA1 Message Date
Alex Willmer dd6d73db37 mitogen.parent: Eliminate use of platform module in first stage
This reduces the size of the initial SSH command by 204 bytes, & may fix errors
running Mitogen on  macOS. AFAICT platform was used but not imported.

Before
```
$ python ./preamble_size.py
SSH command size: 833
Bootstrap (mitogen.core) size: 17007 (16.61KiB)

                              Original          Minimized           Compressed
mitogen.parent            97565 95.3KiB  50427 49.2KiB 51.7%  12689 12.4KiB 13.0%
mitogen.fork               8436  8.2KiB   4130  4.0KiB 49.0%   1648  1.6KiB 19.5%
mitogen.ssh               10892 10.6KiB   6952  6.8KiB 63.8%   2113  2.1KiB 19.4%
mitogen.sudo              12089 11.8KiB   5924  5.8KiB 49.0%   2249  2.2KiB 18.6%
mitogen.select            12325 12.0KiB   2929  2.9KiB 23.8%    964  0.9KiB 7.8%
mitogen.service           41644 40.7KiB  22431 21.9KiB 53.9%   5886  5.7KiB 14.1%
mitogen.fakessh           15599 15.2KiB   8011  7.8KiB 51.4%   2624  2.6KiB 16.8%
mitogen.master            48732 47.6KiB  24569 24.0KiB 50.4%   6768  6.6KiB 13.9%
```

After
```
$ python preamble_size.py
SSH command size: 629
Bootstrap (mitogen.core) size: 17007 (16.61KiB)

                              Original          Minimized           Compressed
mitogen.parent            97543 95.3KiB  50357 49.2KiB 51.6%  12665 12.4KiB 13.0%
mitogen.fork               8436  8.2KiB   4130  4.0KiB 49.0%   1648  1.6KiB 19.5%
mitogen.ssh               10892 10.6KiB   6952  6.8KiB 63.8%   2113  2.1KiB 19.4%
mitogen.sudo              12089 11.8KiB   5924  5.8KiB 49.0%   2249  2.2KiB 18.6%
mitogen.select            12325 12.0KiB   2929  2.9KiB 23.8%    964  0.9KiB 7.8%
mitogen.service           41644 40.7KiB  22431 21.9KiB 53.9%   5886  5.7KiB 14.1%
mitogen.fakessh           15599 15.2KiB   8011  7.8KiB 51.4%   2624  2.6KiB 16.8%
mitogen.master            48732 47.6KiB  24569 24.0KiB 50.4%   6768  6.6KiB 13.9%
```
3 years ago
Alex Willmer c61c063b4f Support for Ansible 3 & 4
fixes #834

Co-authored-by: Claude Becker (@upekkha)
Co-authored-by: Dolph Mathews (@dolph)
3 years ago
Denis Zalevskiy 84c567e265
Add podman connection support
Shameless copy of buildah connection with modifications of invocation to
fit podman CLI.

Signed-off-by: Denis Zalevskiy <dez@aiven.io>
3 years ago
Denis Zalevskiy 10caa4a104
Fix typo in buildah context creation docs
Signed-off-by: Denis Zalevskiy <dez@aiven.io>
3 years ago
Alex Willmer c5c65ab0d2 ci: Switch Continuous Integration to Tox
Also
 - Simplifies adding support for additional Ansible versions
 - Unifies Python package versioning in CI and local test environments
 - Matches Python versions tested, with those declared in setup.py
 - Expands targets covered by automated Ansible tests to
    - centos6, centos8
    - debian9, debian11
    - ubuntu1604, ubuntu2004
3 years ago
Alex Willmer e76eefb8be Fix miscellaneous spelling/formatting 3 years ago
Alex Willmer da3772cbff Increment version to 0.3.1.dev0 3 years ago
Alex Willmer a990eb3d77 CI: Remove obsolete reverse shell historically used to debug CI
This reverse shell was historically used to debug CI jobs interactively.
It is not used anymore, and may be causing jobs to hang, then timeout.
There is no reason to keep it, and removing it simplifies CI jobs.

Additionally it has been reported as flagged by security scanners, so
removing it makes Mitogen easier to package/adopt.

fixes #847
3 years ago
Philippe Kueck bdbc9fe827
changelog entry for #827 3 years ago
Steven Robertson 234dde5fc1 check Ansible version before loaders are loaded 3 years ago
Alex Willmer bce3bab3e8 Add the msvcrt moduleto the default module deny list
Commit https://github.com/python/cpython/commit/880d42a3b247 (first
released in Python 3.8a0) moved an import of msvcrt from an if <win32>
block, into a try/except block. So now the import is tried even on Linux
or MacOS.

https://docs.python.org/3/library/msvcrt.html is a Windows specific
builtin.
3 years ago
Alex Willmer 1e72ebaf8b tests: Update test coverage to Python 3.9
The Travis Linux distribution must be upgraded because the Trusty
(Ubuntu 14.04) image does not have Python 3.9. Xenial (Ubuntu 16.04) is
the earliest version that offers Python 3.9.

I have not chosen a later release, in order to aid restoration of Python
2.4 - 2.6 tests.
3 years ago
David Wilson fad6eb1b47 Bump copyright year and use generic author name (testing Travis) 3 years ago
Steven Robertson f489478127 code cleanup + adds 0.2.10 + 0.3.0 changelog 3 years ago
Steven Robertson 8d3da2dbd2
Merge branch 'master' into patch-1 3 years ago
Alex Willmer 79b4c0f815 tests: Fix AttributeError in callback plugins used by test suite
CALLBACK_VERSION et al are documented as required in
https://docs.ansible.com/ansible/2.10/dev_guide/developing_plugins.html#callback-plugins.
The need for document_fragment is noted in
cfa8075537/lib/ansible/plugins/callback/default.py (L28-L32)

Fixes #758

This addresses the following error, seen while running
`ansible_tests.py`.

```
TASK [Gathering Facts gather_timeout=10, gather_subset=['all']]
****************
task path:
/home/alex/src/mitogen/tests/ansible/regression/issue_109__target_has_old_ansible_installed.yml:4
[WARNING]: Failure using method (v2_runner_on_start) in callback plugin
(<ansible.plugins.callback.nice_stdout.CallbackModule object at
0x7f76b3dad090>): 'show_per_host_start'
Callback Exception:
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py",
line 372, in send_callback
    method(*new_args, **kwargs)
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/plugins/callback/default.py",
line 240, in v2_runner_on_start
    if self.get_option('show_per_host_start'):
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/plugins/callback/__init__.py",
line 91, in get_option
    return self._plugin_options[k]
Callback Exception:
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py",
line 372, in send_callback
    method(*new_args, **kwargs)
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/plugins/callback/default.py",
line 240, in v2_runner_on_start
    if self.get_option('show_per_host_start'):
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/plugins/callback/__init__.py",
line 91, in get_option
    return self._plugin_options[k]
[task 339882] 00:00:08.172036 D ansible_mitogen.affinity: CPU mask for
WorkerProcess: 0x000004
Callback Exception:
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py",
line 372, in send_callback
    method(*new_args, **kwargs)
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/plugins/callback/default.py",
line 240, in v2_runner_on_start
    if self.get_option('show_per_host_start'):
File
"/home/alex/src/mitogen/.tox/py27-ansible2.10/lib/python2.7/site-packages/ansible/plugins/callback/__init__.py",
line 91, in get_option
    return self._plugin_options[k]
```
4 years ago
Alex Willmer b0ce29dcfd ssh: Match newer ssh host key prompt that accepts the fingerprint
This fixes an ERROR in test_accept_enforce_host_keys() while running the
test suite.

Fixes #756
4 years ago
Steven Robertson 7d4a57d16a
Merge branch 'master' into patch-1 4 years ago
Nicolas Mattia 4d48f140a8 Fix typo in Ansible documentation 4 years ago
Luiz Ribeiro 0e47280e43
Fix mitogen_ssh_keepalive_interval documentation 4 years ago
Scott Buchanan fa7c0191ee
correct latest ansible version supported 4 years ago
Steven Robertson 2d7e019dd2
Update docs/ansible_detailed.rst
Co-Authored-By: Jacob Floyd <cognifloyd@gmail.com>
4 years ago
Steven Robertson 1dddfadf32 removing note saying ansible 2.8 interpreter discovery doesn't work 4 years ago
Steven Robertson e8f3154cab Merge branch 'master' into complexAnsiblePythonInterpreterArg 5 years ago
David Wilson d6329f3446 Merge devel/290 @ 79b979ec8544ef5d8620c64068d4a42fabf50415 5 years ago
Steven Robertson bca9d9bf67 added info to ansible_detailed.rst explaining new ansible_python_interpreter functionality 5 years ago
David Wilson e3c514d906 issue #633: update Changelog. 5 years ago
David Wilson ed33236c71 docs: , -> : 5 years ago
David Wilson 9b79986859 docs: use new manpage alias in one more place 5 years ago
David Wilson 7a391022ef docs: update Changelog for 0.2.8. 5 years ago
David Wilson 4bd0a234ce docs: lots more changelog concision 5 years ago
David Wilson 8a11dea075 docs: changelog concision 5 years ago
David Wilson efe91092dc docs: more changelog tweaks 5 years ago
David Wilson 52c070efc0 docs: reorder chapters 5 years ago
David Wilson 8844d5f5cc docs: versionless <title> 5 years ago
David Wilson 9b6792829d docs: update supported Ansible version, mention unsupported features 5 years ago
David Wilson 80bc5c7d8b docs: changelog fixes/tweaks 5 years ago
David Wilson a56930e913 issue #590: update Changelog. 5 years ago
David Wilson 4caca80962 issue #627: reduce the default pool size in a child to 2.
Ansible has no blocking services running, or really any service that
would have an outsized benefit from multiple IO waiters. Probably we
only need 1, but let's start with 2 just in case.
5 years ago
David Wilson 26a9fed396 docs: some more hyperlink joy 5 years ago
David Wilson d75c9cffc3 docs: add domainrefs plugin to make link aliases everywhere \o/
PATENT PENDING
5 years ago
David Wilson 6b180a4091 docs: link IS_DEAD in changelog 5 years ago
David Wilson 01a1914a1f docs: tweaks to better explain changelog race 5 years ago
David Wilson bcca47df3c issue #533: update routing to account for DEL_ROUTE propagation race 5 years ago
David Wilson 207f57537a issue #615: update Changelog. 5 years ago
David Wilson 3c8c11b360 issue #615: update Changelog. 5 years ago
David Wilson db8f0db5e7 docs: lots more changelog 5 years ago
David Wilson 341c453eaa issue #595: add buildah to docs and changelog. 5 years ago
David Wilson e0d9b8d1e1 docs: a few more internals.rst additions 5 years ago
David Wilson 49796e0c39 docs: update changelog 5 years ago
David Wilson 8dfb3966df issue #558, #582: preserve remote tmpdir if caller did not supply one
The undocumented 'tmp' parameter controls whether _execute_module()
would delete anything on 2.3, so mimic that. This means
_execute_remove_stat() calls will not blow away the temp directory,
which broke the unarchive plugin.
5 years ago
David Wilson e12f391106 docs: mention another __main__ safeguard 5 years ago
David Wilson 1d41adb346 docs: tweaks 5 years ago
David Wilson 9cb187c2c4 formatting error 5 years ago
David Wilson 9b9fe57ea8 docs: make Sphinx install soft fail on Python 2. 5 years ago
David Wilson c89f6cbab6 issue #598: update Changelog. 5 years ago
David Wilson 240dc84d94 issue #605: update Changelog. 5 years ago
David Wilson 4fa760cd21 issue #613: add tests for all the weird shutdown methods 5 years ago
David Wilson 57012e0f72 Add mitogen.core.now() and use it everywhere; closes #614. 5 years ago
David Wilson 379dca90b9 docs: move decorator docs into core.py and use autodecorator 5 years ago
David Wilson a91a8bf19c docs: upgrade Sphinx to 2.1.2, require Python 3 to build docs. 5 years ago
David Wilson 93e8d5dfcc docs: fix Sphinx warnings, add LogHandler, more docstrings 5 years ago
David Wilson 1d943388b7 docs: tidy up some Changelog text 5 years ago
David Wilson c464bb5346 issue #615: update Changelog. 5 years ago
David Wilson e352b9e5fd docs: update Changelog. 5 years ago
David Wilson 6fa69955c4 issue #586: update Changelog. 5 years ago
David Wilson f0138072f1 docs: update Changelog. 5 years ago
David Wilson 5ae6f92177 issue #612: update Changelog. 5 years ago
David Wilson 5970b041e0 docs: merge signals.rst into internals.rst 5 years ago
David Wilson 41d180495a issue #547: update Changelog. 5 years ago
David Wilson 50b2d590fd docs: update Changelog. 5 years ago
David Wilson b33b29af33 core: remove dead Router.on_shutdown() and Router "shutdown" signal
Its functionality was duplicated by _on_broker_exit() somewhere along
the way, and nothing has referred to it in a long time. I have no idea
how this happened.

Merge its docstring into _on_broker_exit() and delete it, remove the
Router "shutdown" signal after confirming it has no users, and move all
the Router-originated error messages together in a block at the top of
the class.

Already covered by router_test.AddHandlerTest.test_dead_message_sent_at_shutdown
5 years ago
David Wilson f4cee16526 parent: zombie reaping v3
Improvements:

- Refactored off Process, separately testable without a connection
- Don't delay Broker shutdown indefinitely for detached children
5 years ago
David Wilson dd1fed0a5f docs: update changelog 5 years ago
David Wilson e8b1bf5909 issue #410: automatically work around SELinux braindamage. 5 years ago
David Wilson 87443da828 docs: remove fakessh from home page, it's been broken forever 5 years ago
David Wilson 0d636af532 docs: add changelog thanks 5 years ago
David Wilson be330194d5 docs: udpate Changelog. 5 years ago
David Wilson b7cdd39044 docs: tweak Changelog wording 5 years ago
David Wilson a79d2bd50b docs: another round of docstring cleanups. 5 years ago
David Wilson feb1654305 docs: many more internals.rst tidyups 5 years ago
David Wilson f0782ccd42 [stream-refactor] get caught up on internals.rst updates 5 years ago
David Wilson aa06b960f5 parent: define Connection behaviour during Broker.shutdown()
- Connection attempt fails reliably, and it fails with CancelledError
- Add new mitogen.core.unlisten()
- Add test.
5 years ago
David Wilson 7629ff9e6d issue #602: update Changelog 5 years ago
David Wilson cf2b8f1c24 docs: update Changelog. 5 years ago
David Wilson e87e41e69e docs: finished Changelog locking note 5 years ago
Stefane Fermigier aa15975ad4 Fix for sample in doc
`log_to_file()` expects a filename.
5 years ago
David Wilson 9bb3dac450 docs: break out install_app.py and fix API use. 5 years ago
David Wilson d0aee1ef3c issue #549: docs: update Changelog 5 years ago
David Wilson edeaa3c6ee docs: remove old list link. 5 years ago
David Wilson c4bcfa4c49 docs: migrate email list 5 years ago
David Wilson 7accc092de docs: changelog tweaks 5 years ago
David Wilson 9e1faa7927 docs: changelog concision / additions 5 years ago
David Wilson c0357d394f add 363 to changelog 5 years ago
David Wilson 8f25114d1a docs: update Changelog 5 years ago
David Wilson de65790a74 docs: note fd usage has halved 5 years ago
David Wilson ded00d25c9 docs: more stream-refactor work 5 years ago
David Wilson 4cd32cbcba docs: update Changelog for stream-refactor. 5 years ago
David Wilson d35bca3f15 docs: Add lineinfile bug to changelog. 5 years ago
David Wilson db9066fbfb [stream-refactor] mark setns module as requiring Python >2.4 5 years ago