Commit Graph

811 Commits (master)

Author SHA1 Message Date
David Wilson 2b229a6a70 docs: add thanks entry. 5 years ago
David Wilson 0bd0c7b9e7 issue #462: docs: update Changelog. 5 years ago
David Wilson 5ffaa693a6 docs: get rid of autobuild remnant 6 years ago
David Wilson 3f5774cfd5 core: document/tidy up poller.
Remove duplicate attribute creates in subclasses too.
6 years ago
David Wilson 7dd46bf44e doc: API typos. 6 years ago
David Wilson ffdd6d2881 docs: add 824c7931 to changelog. 6 years ago
David Wilson 497234e782 issue #456: core: raise error during defer() if Broker shutdown 6 years ago
David Wilson 8d7aefb1cf docs: fix example up so it's closer to real code 6 years ago
David Wilson cd01957995 issue #397, #454: pick out only shutil.rmtree() calls from atexit. 6 years ago
David Wilson 2959b7911e issue #453: update Changelog. 6 years ago
David Wilson 9680a84824 core: rename Router.self() to Router.myself(). 6 years ago
David Wilson e77460a395 docs: update Changelog. 6 years ago
David Wilson c6399789ea docs: add host_pinned strategy to Changelog. 6 years ago
David Wilson 09aa27a6a7 ansible: initial mitogen_host_pinned strategy. 6 years ago
David Wilson 863e1aedd6 docs: fix Changelog bug link 6 years ago
David Wilson 300cb41e2e core: detect stream corruption. Closes #438. 6 years ago
David Wilson 9868e4ea3a issue #439: update changelog. 6 years ago
David Wilson 94512f4ef8 issue #399, #437: update Changelog. 6 years ago
David Wilson 9074ddf69f docs: fix username 6 years ago
David Wilson b944a5485e docs: remove whitespace 6 years ago
David Wilson eb28a94a87 docs: avoid Sphinx weirdness by removing paragraph in list 6 years ago
David Wilson 73c7b5daeb docs: modernize 2 examples 6 years ago
David Wilson d5cb98fa87 issue #435, #362: update Changelog. 6 years ago
David Wilson fd5698c191 docs: 4kify images.
These commits were squashed to avoid repo size exploding.
6 years ago
David Wilson 4553039ed2 docs: update Changelog; closes #391. 6 years ago
David Wilson 1756cea65b issue #109: update Changelog. 6 years ago
David Wilson 578c2c3b46 issue #364: update ChangeLog. 6 years ago
David Wilson b60a6d0f3b Split dev_requirements.txt up according to test mode. 6 years ago
David Wilson 43306fff81 docs: drop sphinx-autobuild, avoids 10 deps (-16%)
sphinx-autobuild==0.6.0 (from -r docs/docs-requirements.txt (line 2))
livereload>=2.3.0 (from sphinx-autobuild==0.6.0->-r docs/docs-requirements.txt (line 2))
pathtools>=0.1.2 (from sphinx-autobuild==0.6.0->-r docs/docs-requirements.txt (line 2))
tornado>=3.2 (from sphinx-autobuild==0.6.0->-r docs/docs-requirements.txt (line 2))
argh>=0.24.1 (from sphinx-autobuild==0.6.0->-r docs/docs-requirements.txt (line 2))
watchdog>=0.7.1 (from sphinx-autobuild==0.6.0->-r docs/docs-requirements.txt (line 2))
port-for==0.3.1 (from sphinx-autobuild==0.6.0->-r docs/docs-requirements.txt (line 2))
backports.ssl_match_hostname (from tornado>=3.2->sphinx-autobuild==0.6.0->-r docs/docs-requirements.txt (line 2))
singledispatch (from tornado>=3.2->sphinx-autobuild==0.6.0->-r docs/docs-requirements.txt (line 2))
backports_abc>=0.4 (from tornado>=3.2->sphinx-autobuild==0.6.0->-r docs/docs-requirements.txt (line 2))
6 years ago
David Wilson 5233c47eba docs: Changelog typo 6 years ago
David Wilson 01c4f3fee1 core: rearrange stdio setup to cope with buffering; closes #422 6 years ago
David Wilson 905fbe7cbb issue #420: update Changelog. 6 years ago
David Wilson a7eca5b55e docs: update Changelog. 6 years ago
David Wilson 7a1dfa388a docs: update Changelog; closes #413. 6 years ago
David Wilson fea0fb41fc docs: update Changelog; closes #288 6 years ago
David Wilson 33011af9a5 issue #387: update Changelog. 6 years ago
David Wilson 176fe55bbd issue #416: update Changelog 6 years ago
David Wilson 4ac9cdce7c docs: update Changelog; closes #417. 6 years ago
David Wilson 01e65d7865 docs: update Changelog; closes #406. 6 years ago
David Wilson 14b389cb46 issue #406: don't leak FDs on failed child start. 6 years ago
David Wilson 4230a93557 issue #406: update Changelog. 6 years ago
David Wilson 6fdc45da1a docs: Changelog concision 6 years ago
David Wilson 5bdb745f07 docs: howitworks tweaks 6 years ago
David Wilson 8e4c164d93 issue #388: fix Sphinx markup 6 years ago
David Wilson 804bacdadb docs: move most remaining docstrings back into *.py; closes #388
The remaining ones are decorators which don't seem to have an autodoc
equivlent.
6 years ago
David Wilson 1f8c09e43f issue #333: update Changelog. 6 years ago
David Wilson f8f2f9d718 docs: update Changelog; closes #352. 6 years ago
David Wilson 677dbdb0e7 docs: update Changelog; closes #351. 6 years ago
David Wilson a098943e3c docs: update install steps to point directly at Known Issues. 6 years ago
David Wilson 1af2d9aef1 docs: move Known Issues to the top. 6 years ago
David Wilson 59d0f0df65 docs: split Known Issues out into a separate heading and update it 6 years ago
David Wilson 7fd4549ad1 issue #370: update Changelog. 6 years ago
David Wilson f3f36d6244 docs: add connection: "smart" to known issues. 6 years ago
David Wilson d9b2686259 docs: update Changelog 6 years ago
David Wilson 40d11b32b0 issue #400: update Changelog. 6 years ago
David Wilson a7ee23719a issue #388: move a ton of documentation back into the source 6 years ago
David Wilson c89675112b issue #410: update changelog 6 years ago
David Wilson fadb9181bc issue #410: support sudo --user and SELinux options, add stub test. 6 years ago
David Wilson 0d410aef51 docs: fix internals.rst headings. 6 years ago
David Wilson 0394dac2c7 docs: document RouteMonitor class. 6 years ago
David Wilson 7314b54afd issue #409: update Changelog. 6 years ago
David Wilson 54445470e2 issue #409: add missing path config variables to severa plugins
So every method can be redirected to a stub implementation.
6 years ago
David Wilson 48942a8a30 issue #409: updat Changelog. 6 years ago
David Wilson 026710cb28 issue #373: update Changelog. 6 years ago
David Wilson 1198164ce6 docs: Changelog typos. 6 years ago
David Wilson 766dce9a59 docs: update Changelog 6 years ago
David Wilson d81698c43a docs: update Changelog. 6 years ago
David Wilson 1eae594e32 ssh: fix check_host_keys="accept" and test; closes #411
Add real accept/enforce tests.
6 years ago
David Wilson cf50b572f6 docs: update ChangeLog. 6 years ago
David Wilson b527ff0b66 docs: update Changelog; closes #369. 6 years ago
David Wilson efed9da474 docs: update Changelog. 6 years ago
David Wilson 9ec360c26d core: split out & extend Broker.sync_call() 6 years ago
David Wilson 8891fda48a docs: getting_started typo 6 years ago
David Wilson f3e19d81da docs: reorder sections 6 years ago
David Wilson 96b88cc70f issue #76: docs: update Changelog. 6 years ago
David Wilson bd71a2760e docs: describe disconnect propagation; closes #76. 6 years ago
David Wilson 72da291b24 docs: fix up incomplete Temporary Files section. 6 years ago
David Wilson 48bc91550b docs: update changelog. 6 years ago
David Wilson 40d2cf7e25 docs: update changelog. 6 years ago
David Wilson a7b1831ddf core: move IS_DEAD doc into core.py. 6 years ago
David Wilson 48f9fc8930 docs: tweak thanks text 6 years ago
David Wilson f5e933e8a2 docs: add Alex's fix to changelog 6 years ago
dw f3ee4011cc
Merge pull request #386 from moreati/doc-cleanups
Documentation cleanups
6 years ago
Alex Willmer 90823231f9 docs: Add services page to a hidden table of contents
This fixes an error reported by tox -edocs

Warning, treated as error:
/home/alex/src/mitogen/docs/services.rst:document isn't included in any
toctree

without promoting the page to a top level TOC entry, since the page
appears to be work in progress.
6 years ago
Alex Willmer bf34b383eb docs: Disambiguate references to Context
This addresses an error found while running tox -edocs

Warning, treated as error:
mitogen/docs/api.rst:469:more than one target found for cross-reference
u'Context': mitogen.core.Context, mitogen.parent.Context
6 years ago
Alex Willmer 191a327d9d docs: Don't redefine links to scp and sftp
This addresses an error found while running tox -edocs

Warning, treated as error:
./docs/ansible.rst:6:Duplicate explicit target name: "scp(1)".
6 years ago
David Wilson 0fa5fe5559 parent: handle masters with blank sys.executable; closes #356. 6 years ago
David Wilson 4c81eba599 Merge commit 'refs/pull/377/head' of github.com:dw/mitogen into dmw
(Pull #377)

Changes:
- additional_parameters -> extra_args
- Merge with kubectl changes from dmw branch
- Update docs
- Remove unused username class member
- Avoid mutable kubectl_args class member
- Use six.iteritems
6 years ago
David Wilson 0abb6b0880 issue 366: update changelog. 6 years ago
David Wilson f6b201bdfc docs: updates for #376 and #371 6 years ago
David Wilson 9fadd22396 docs: update Changelog; closes #362. 6 years ago
David Wilson 5521945bd2 ansible: temporary files take 5. 6 years ago
David Wilson 43ad23946e docs: tidy up wording. 6 years ago
David Wilson 3660febeb2 docs: add inline subscribe form to installation instructions 6 years ago
David Wilson 638b196a45 ansible: fix put_file() for large temporary files.
Reverts 49736b3a, large file copies can't avoid the RTT.

The parent stack must be blocked while FileService progresses, as unlike
the small file path, it does not make a snapshot of the (possibly
temporary) file passed by the action plug-in. So we need to keep that
file alive while the service runs.

Add a new integration test and a new soak test to cover both.
6 years ago
David Wilson dfc67b89fd docs: some more cleanups
- add faulthandler/thread stacks to changelog.
- various api.rst cleanups.
- docs: explain chain_id in howitworks.
6 years ago
David Wilson 6cb0e422e9 docs: changelog typo. 6 years ago
David Wilson 65f03e03f5 tests: remote_tmp test fixes. 6 years ago
David Wilson cc4835ce99 docs: update changelog. 6 years ago
David Wilson f0f828033f docs: update changelog. 6 years ago
David Wilson ae446ad7c8 docs: fix changelog 6 years ago
David Wilson c9596568be docs: update changelog. 6 years ago
David Wilson 2c0244eea7 docs: more tweaks 6 years ago
David Wilson c8081e7ca1 docs: typo 6 years ago
David Wilson e241081cae ansible: stop sharing target temp_dir in runner.
This cannot work with delegate_to, since delegate_to permits multiple
concurrent tasks to be executing on the same target.
6 years ago
David Wilson 020482e554 dosc: update changelog 6 years ago
David Wilson 4d3873c784 core: call chains v3: abstract it into a new CallChain class. 6 years ago
David Wilson 1bf9b2c1a3 docs: update changelog. 6 years ago
David Wilson aa9400a3b9 docs: fix changelog 6 years ago
David Wilson a3957d6aaf parent: add Context.forget_chain(). 6 years ago
David Wilson 1247d1fce6 docs: update changelog. 6 years ago
David Wilson 42b1b3d286 core: support mitogen_chain dispatcher option. 6 years ago
David Wilson 07845d2f59 docs: update changelog. 6 years ago
David Wilson 57fb00cf6b docs: update changelog. 6 years ago
David Wilson 1b6dea24ba docs: update changelog. 6 years ago
David Wilson 6c8a667691 docs: update Changelog. 6 years ago
David Wilson 7d62a53264 issue #337: ssh: disabling PTYs round 2: make it automatic. 6 years ago
David Wilson 5004207705 issue #337: ssh: support disabling PTY allocation
`.ssh(batch_mode=True)`
6 years ago
David Wilson 8ab11f415f ansible: better support for diagnosing hangs
* Always enable the faulthandler module in the top-level process if it
  is available.
* Make MITOGEN_DUMP_THREAD_STACKS interval configurable, to better
  handle larger runs.
* Add docs subsection on diagnosing hangs.

Conflicts:
	ansible_mitogen/process.py
6 years ago
David Wilson 897bc07ea0 docs: update changelog. 6 years ago
David Wilson 42f07466d2 setns: always assume a user identity, default to root.
Without this, an invocation like:

    sudo ansible-playbook foo.yml

Where foo.yml uses setns, could inherit the HOME environment variable
from the external non-root user, which broke /usr/bin/mysql_upgrade and
plenty more.
6 years ago
David Wilson c32b8d9728 docs: fix up doas documentation. 6 years ago
David Wilson 4134218ef4 docs: update changelog. 6 years ago
David Wilson d36a320e7f docs: update contributors. 6 years ago
David Wilson fcc7429111 docs: changelog: split out enhancements 6 years ago
David Wilson 52cd7fddc1 docs: update changelog. 6 years ago
David Wilson 7458dfae85 ansible: avoid roundtrip for small file transfers.
Calls to connect.put_file() where the file is sufficiently small enough
to fit in a single RPC proceed without waiting for an RPC response. If
the write fails the target context will log an exception, and any
subsequent step depending on the written file will fail.

I verified every built-in action plugin for file transfer calls, and
they all depend on the transferred file in the following step, so this
should be safe.

Reduces template/copy actions to 2-RTT, loop-20-templates.yml runtime
reduced from 30 seconds to 10 seconds over a 250ms link compared to
v0.2.2, and from 123 seconds compared to vanilla with pipelining
enabled.
6 years ago
David Wilson 84521b714f docs: update changelog. 6 years ago
David Wilson 76c4cf57bd docs: update changelog 6 years ago
David Wilson bce4f59138 issue #345: disable IdentitiesOnly by default. 6 years ago
David Wilson e84de489eb issue #336: update changelog.
Closes #336.
6 years ago
David Wilson 06cae11e52 Add freze alabaster version to try fix layout issue. 6 years ago
David Wilson 2e3d04bbb8 issue #342: forward _create_control_path() to SSH plugin.
network_cli connection type loads the "ssh" (mitogen_ssh) plugin and
expects a private method to exist.
6 years ago
David Wilson bc682ce5a0 docs: update supported versions. 6 years ago
David Wilson 77b68f9b9d issue #321: docs fixes 6 years ago
David Wilson ac9b84d237 issue #321: 2.4+ compatibility fixes, disable test on Vanilla. 6 years ago
David Wilson f24f02ba06 issue #321: take remote_tmp and system_tmpdirs into account.
Can't simply ignore these settings as some users may have weird noexec
filesystems.
6 years ago
David Wilson a2686b1a2c issue #321: simplify temp directory handling. 6 years ago
David Wilson 27b64a484b docs: document mitogen.core.CHUNK_SIZE. 6 years ago
David Wilson ec8d759d46 docs: document one more. 6 years ago
David Wilson 442d88e3d7 docs: many more fixes/merges. 6 years ago
David Wilson a561fb79e5 docs: merge more docs back into mitogen/core.py. 6 years ago
David Wilson 06e2e846c5 parent: don't generate illegal default remote names.
getpass.getuser() output may contain slashes, which must be avoided as
they break virtualenv when present in argv[0].

Closes #344.
6 years ago
David Wilson 30ca569716 docs: Update Changelog. 6 years ago
David Wilson a6995a5288 issue #338: refactor env handling into class and fix tests. 6 years ago
David Wilson ad365dad56 issue #340: one more test, update Changelog. 6 years ago
David Wilson 8e35103185 docs: Update Changelog. 6 years ago
David Wilson 9365f254d2 Update ChangeLog. 6 years ago
David Wilson 053c594d65 ansible: prevent logs spamming user console on exit.
Closes #331.
6 years ago
David Wilson 81c8156965 Support LXD; closes #339. 6 years ago
David Wilson 898c06f1b9 docs: host demo on Vimeo. 6 years ago
David Wilson 232aaf5c95 Merge branch 'dmw' 6 years ago
David Wilson f4a66194e4 ansible: Py3.x fixes for Ansible PR #41749 workaround. 6 years ago
David Wilson 3b10920157 docs: delete compared.rst because somehow it's in search results. 6 years ago
David Wilson 196f76ff22 Remove staticmethod from docs.
Can re-add this later for 3.x, but it's pretty impossible in general for
2.x.

Closes #313.
6 years ago
David Wilson 9b2417e62d docs: add funny testimonial 6 years ago
David Wilson 45c2b04456 docs: add missing changelog entry. 6 years ago
David Wilson d64729e041 Bump version for release. 6 years ago
David Wilson 6813443d09 docs: minor tweaks. 6 years ago
David Wilson ebf721411c docs: add known issue 6 years ago
David Wilson 21eda90a67 docs: reorder changelog 6 years ago
David Wilson 998762ab4f docs: update changelog. 6 years ago
David Wilson 5d67ce7746 service: service pool threads should respect _profile_hook. 6 years ago
David Wilson 3c55571fe2 docs: update changelog 6 years ago
David Wilson 22bab87821 issue #319: avoid TCSAFLUSH flag on WSL.
Closes #319.
6 years ago
David Wilson 17c5bd26e1 Update changelog. 6 years ago
David Wilson 3138982ef4 docs: link mitogen-announce mailing list. 6 years ago
David Wilson a29a883dfc issue #311: docs: comment out Ansible 2.6 for now. 6 years ago
David Wilson 662b2d0668 docs: whups, add missing contributors entry 6 years ago
David Wilson 50670430ec docs: add thanks to release notes 6 years ago
David Wilson c5ea7c45a1 comments/docs: correct mitogen.master.Context -> mitogen.parent.Context. 6 years ago
David Wilson 2c74eac19a issue #291: more Ansible-compatible script invocation
When running any kind of script, rewrite the hashbang like Ansible does,
but subsequently ignore it and explicitly use a fragment of shell from
the ansible_*_interpreter variable to call the interpreter, just like
Ansible does.

This fixes hashbangs containing '/usr/bin/env A=1 bash' on Linux, where
putting that into a hashbang line results in an infinite loop.
6 years ago
David Wilson 11c73baa9c docs: update Changelog. 6 years ago
David Wilson 6b79db2ecd docs: document local connection process model difference. 6 years ago
David Wilson b5e7e97c62 issue #291: update changelog. 6 years ago
David Wilson f977be2868 issue #291: permit supplying a full Python argv. 6 years ago
Daniel Quackenbush 3297552f65 Updated readme with build status, updated docs 6 years ago
David Wilson 15d68b3c32 issue #309: fix environment cleanup regression.
Closes #309.
6 years ago
David Wilson 09d077ebd7 docs: update release notes 6 years ago
David Wilson a5fae0d084 docs: add jgadling to Contributors 6 years ago
David Wilson 70d732d35b docs: add "no route" to known issues. 6 years ago
David Wilson 8609fa5f44 docs: link to PyPI release, not GitHub archive URL.
Now download counts are visible via PSF BigQuery.
6 years ago
David Wilson 184104ce92 issue #303: add doas to the docs 6 years ago
David Wilson f20274ea18 docs: fix lock icon. 6 years ago
David Wilson e609d1b1fb docs: glaring ancient typo. 6 years ago
David Wilson f2ee5ade7e Update Changelog. 6 years ago
David Wilson 9a453d4753 Bump version for release. 6 years ago
David Wilson a61212ffb7 docs: one more known issue. 6 years ago
David Wilson 63c7a3013d docs: ansible: add workaround for 'raw' support. 6 years ago
David Wilson 68cf84762f docs: mention synchronize/delegation issue. 6 years ago
David Wilson ab0107440a docs: typo 6 years ago
David Wilson 7cd89f0290 docs: add 'will it work' intuition. 6 years ago
David Wilson 2b507c7b15 docs: fix text. 6 years ago
David Wilson f5b9f5ff59 docs: add 'raw' to 0.2 in-scope 6 years ago
David Wilson 8c2231cefb docs: link changelog into Ansible install procedure 6 years ago
David Wilson 3ea1b74dad docs: promote contributors & changelog links at least for 2018 6 years ago
David Wilson 9e3d9752cb docs: add warning label to services.rst. 6 years ago
David Wilson 43b55bd8fd docs: remove another warning label. 6 years ago
David Wilson b7001f6e0b docs: remove prerelease caution. 6 years ago
David Wilson 894926cf61 docs: add initial release notes. 6 years ago
David Wilson d493a3d7ca Merge branch 'python3'
Hooray \o/

Remaining issues:

- Two unit test races that appear related to our broken zombie process
  reaping, doesn't impact Ansible.

Closes #16.
6 years ago
David Wilson 0461738ca6 docs: small reference fixes. 6 years ago
David Wilson a74903d59a docs: update compatibility notice on main page. 6 years ago
David Wilson 18c9cd2365 docs: update supported Python version list. 6 years ago
David Wilson e24eddb1ce core: move Latch docs back inline. 6 years ago
David Wilson 0422a8c263 parent: python_path setting depends on local or remote
For local, we want to default to the same Python version as the current
process. For remote, we want whatever is on offer.
6 years ago
David Wilson 0eb77b5f7c utils: always enable microsecond logging.
It's too useful, and the logs are fairly out of control already, may as
well just capture everything in the first pass.
6 years ago
David Wilson 410016ff47 Initial Python 3.x port work.
* ansible: use unicode_literals everywhere since it only needs to be
  compatible back to 2.6.
* compat/collections.py: delete this entirely and rip out the parts of
  functools that require it.
* Introduce serializable Kwargs dict subclass that translates keys to
  Unicode on instantiation.
* enable_debug_logging() must set _v/_vv globals.
* cStringIO does not exist in 3.x.
* Treat IOLogger and LogForwarder input as latin-1.
* Avoid ResourceWarnings in first stage by explicitly closing fps.
* Fix preamble_size.py syntax errors.
6 years ago
David Wilson 0aba88dd8b docs: promote contributors.rst 6 years ago
David Wilson e26f3d7907 docs: update & link in contributors page. 6 years ago
David Wilson 6632f682da docs: change install docs to point at stable branch. 6 years ago
David Wilson d6126a9516 issue #275: parent/ssh: centralize EC0_MARKER and change it for ssh.py.
Must maintain a minimum buffer length prior to deciding whether we have
an interesting token, and 'EC0' is too short for that.
6 years ago
David Wilson 04b65020ac issue #278: ansible: support mitogen_ssh_debug_level variable. 6 years ago
David Wilson b58603c7a4 issue #278: ssh: support ssh_debug_level option and log TTY output.
Now debug logs may be captured all the way through the connection.
6 years ago
David Wilson 3994f1b30a ansible: implment async job time limit. 6 years ago
David Wilson d2accbce53 docs: remove more Ansible limitations 6 years ago
David Wilson 9e78c20eba core/parent: add Context.call_no_reply(). 6 years ago
David Wilson a3b747af1b issue #186: add PushFileService
This is like FileService but blocks until the file is pushed by a parent
context, with deduplicating behaviour at each level in the hierarchy. It
does not stream large files, so it is only suitable for small files like
Python modules.

Additionally add SerializedInvoker for use with PushFileService, which
ensures all method calls to a single service occur in sequence.
6 years ago
David Wilson daa9cfd0a8 ansible: MITOGEN_DUMP_THREAD_STACKS for mux process too 6 years ago
David Wilson 7162c13e05 docs: add more notes for getting_started.rst 6 years ago
David Wilson aba6cb302a docs: add example sudoers rule
hat tip @seuf :)
6 years ago
David Wilson 3b0addcfb0 service: v2. Closes #213 6 years ago
David Wilson d2714752ee docs: tidy ups 6 years ago
David Wilson 61365236ad docs/select: fix up more references, fix headings. 6 years ago
David Wilson 4bf3d01104 select: add missing get(block=..) parameter. 6 years ago
David Wilson b0ce6eecd7 fork: support on_start= argument. 6 years ago
David Wilson 863a95e860 docs: update contributors 6 years ago
David Wilson 70376d861a issue #217: docs: remove limitation 6 years ago
David Wilson 4cd9e09130 issue #249: docs: remove limitation 6 years ago
David Wilson bc7be1879d issue #249: initial poller implementation (BSD only) 6 years ago
David Wilson b7ab473343 issue #186: split handle list up so it makes sense 6 years ago
David Wilson d1a22cb5d4 issue #186: parent: implement FORWARD_MODULE.
To support detach, we must be able to preload the target with every
module it will need prior to detachment. This implements the
intermediary part of the process (i.e. the Ansible fork parent) --
receiving LOAD_MODULE/FORWARD_MODULE pairs and ensuring they reach the
child.
6 years ago
David Wilson 8a089e975d docs: Document Router.unidirectional. 6 years ago
David Wilson 48535cc661 docs: more accurate bullet. 6 years ago
David Wilson d148e3db4e docs: move installation section above demo 6 years ago
David Wilson 9b761a2baf docs: initial contributors page 6 years ago
David Wilson cecef992b0 issue #218: core: add Secret and Blob types. 6 years ago
David Wilson 43e9e51ed6 docs: link signals into internals.rst. 6 years ago
David Wilson 3058efc80f docs: more updates.
- accurate description of Ansible timeouts
- rough detach() sketch
6 years ago
David Wilson 7f1060f54a issue #186: initial version of subtree detachment. 6 years ago
David Wilson 8fc1eac6ae utils: combine MITOGEN_LOG_LEVEL and MITOGEN_LOG_IO.
Saves lots of readline fiddling.
6 years ago
David Wilson f5238fe791 docs: update copyright 6 years ago
David Wilson d3fe24a4f6 docs: update connection delegation example 6 years ago
David Wilson 2ee727f5c0 docs: typos and clarifications 6 years ago
David Wilson 4d1c6d2101 issue #127: ssh: reasonable solution to host key checking.
Ideally it would be possible to specify a callback function, but this is
not possible for proxied connections. So simply provide the 3 most
useful modes, defaulting to the most secure.

Closes #127. Closes #134.
6 years ago
David Wilson 78c401ba4d ansible: support su become method. 6 years ago
David Wilson 3322eaef45 Basic "su" method. 6 years ago
David Wilson 187e3a3fc1 ansible: support 2.3 too. 6 years ago
David Wilson f5d22a3ca1 core: support deleting handlers, make Receiver.close() unregister 6 years ago
David Wilson 58eb9828b0 docs: remove limitation. 6 years ago
David Wilson ff7fb00569 parent: return latch to wait() caller to allow graceful timeout 6 years ago
David Wilson b0309b539c ansible: disable interpreter recycling for connections.
Must explicitly specify enable_lru=True in ContextService.get() to
trigger recycling.
6 years ago
David Wilson ec22fee7a7 docs: more ansible updates 6 years ago
David Wilson 79fd35092b docs: more links 6 years ago
David Wilson 65e6a44fe7 docs: add links. 6 years ago
David Wilson 29f6c46e97 docs: add file transfer safety section. 6 years ago
David Wilson bba2a42e44 ansible: add mitogen_sudo method, split out connection subclasses.
Slowly moving towards real implementations in those files.
6 years ago
David Wilson 7c5bbc5168 setns: support changing user.
To match existing third party plugin.
6 years ago
David Wilson 58d8f60f57 docs: better connection type docs 6 years ago
David Wilson e8b4c4e683 issue #223: implement setns connection type
machinectl does not support any sensible form of pipe to the child
process, so it is necessary to bypass it when talking to a systemd
container (see systemd/systemd#8850).

This can also form the basis for issue #223, where the post-fork
namespace switching dance required to connect to the Pythonless
container will be the same.
6 years ago
David Wilson 79c2d6c289 docs: links to Ansible docs 6 years ago
David Wilson 098995539d ansible: implement FreeBSD jail support. 6 years ago
David Wilson 3196b6e7f7 Add FreeBSD jail support. 6 years ago
David Wilson d8e71799e7 docs: typo 6 years ago
David Wilson b1563cd8c1 ansible: hijack lxd connections too. 6 years ago
David Wilson 131bc768c7 ansible: implement LXC support. 6 years ago
David Wilson b3d352c601 Add lxc container support. 6 years ago
David Wilson 1fc7df5be5 Move canonical library version to __init__.py. 6 years ago
David Wilson 6fb3a76e68 master: annotate LogForwarder messages.
mitogen/master.py:
    Annotate forwarded log entries with their original source, logger
    name, and message.

ansible:
    mark stderr in red with -vvv

    Tempting to make this appaer 100% of the time, but some crappy
    bashrcs may cause lots of junk to be printed.
6 years ago
David Wilson 9d0949eb99 docker: fixes & add username parameter. 6 years ago
David Wilson 823dea4bd0 docs: link ChangeLog. 6 years ago
David Wilson 02ce332b26 docs: show become_user example for connection delegation. 6 years ago
David Wilson 39f5aa76ae docs: add initial ChangeLog. 6 years ago
David Wilson 3ce6b36932 docs: major Ansible page update. 6 years ago
David Wilson d2345d11e9 docs: remove warning labels. 6 years ago
David Wilson 5913be64d7 docs: remove last remaining major risk :D 6 years ago
David Wilson 4c5e13bf87 core: add Stream.pending_bytes() accessor. 6 years ago
David Wilson 7c88e4d013 Move _DEAD into header, autogenerate dead messages
This change blocks off 2 common scenarios where a race condition is
upgraded to a hang, when the library could internally do better.

* Since we don't know whether the receiver of a `reply_to` is expecting
  a raw or pickled message, and since in the case of a raw reply, there
  is no way to signal "dead" to the receiver, override the reply_to
  field to explicitly mark a message as dead using a special handle.

  This replaces the serialized _DEAD sentinel value with a slightly
  neater interface, in the form of the reserved IS_DEAD handle, and
  enables an important subsequent change: when a context cannot route a
  message, it can send a generic 'dead' reply back towards the message
  source, ensuring any sleeping thread is woken with ChannelError.

  The use of this field could potentially be extended later on if
  additional flags are needed, but for now this seems to suffice.

* Teach Router._invoke() to reply with a dead message when it receives a
  message for an invalid local handle.

* Teach Router._async_route() to reply with a dead message when it
  receives an unroutable message.
6 years ago
David Wilson e43c6c531b Mostly implement hybrid TTY/socket mode for sudo and SSH.
Presently there is still no mechanism to add :attr:`tty_stream` to the
multiplexer after connection is successful, but for now it's not
expected that anything will be logged to it anyway.

Closes #148.
6 years ago
David Wilson 6aad45748b docs: typo 6 years ago
David Wilson 9f94fb78c8 issue #159: make LRU size configurable. 6 years ago
David Wilson a96969ee29 docs: concision 6 years ago
David Wilson cc980569a3 issue #159: initial context LRU implementation
Now Connection.close() *must* be called in the worker, to ensure the
reference count for a context drops correctly.

Remove 'discriminator' for now, I'm not using it for testing any more
and it complicated this code.

This code is a car crash, it needs rewritten again. Ideally some/most of
this behaviour could live on services.DeduplicatingService somehow, but
I couldn't come up with a sensible design.
6 years ago
David Wilson 38c0ad1eea core: don't deregister Router handles until Broker exit.
Lots of "invalid handle: ..., 102" messages started appearing during
exit recently because ordering changed slightly, and local handles were
sent _DEAD even though the broker loop was still progressing through
shutdown.

The "shutdown" event is too early to close handles: it is the start of
the grace period where streams and downstream contexts can finish up any
work and deliver buffered data, including FORWARD_LOG messages that
haven't arrived yet.

So instead,

- move the _DEAD logic to the "exit" event,
- get rid of Context.on_shutdown() entirely, it's been unused for over
  a month,
- get rid of the "crash" event, since it always fires prior to "exit",
  and its only use was to send _DEAD to local handles, which now happens
  during exit anyway.
6 years ago
David Wilson 0e839fe63c docs: override insane list of fallback fonts
WHY ARE THE DOCS RENDERING IN ITALIC HOW LONG HAS IT BEEN LIKE THIS
ARGAHGR
6 years ago
David Wilson e9f94e1bbb docs: tidy up big list of bullets. 6 years ago
David Wilson 43ecbe350c docs: rearrange more ansible risks 6 years ago
David Wilson 19a418cc6f docs: document mitogen_task_isolation. 6 years ago
David Wilson ba74f8f743 docs: remove Ansible risk 6 years ago
David Wilson 3613162bc0 ansible: enable forking when requested and for async jobs.
Closes #105.
References #155.

mitogen/service.py:
    Refactor services to support individually exposed methods with
    different security policies for each method.

    - @mitogen.service.expose() to expose a method and set its policy
    - @mitogen.service.arg_spec() to validate input.
    - Require basic service message format to be a tuple of
      `(method, kwargs)`, where kwargs is always a dict.
    - Update DeduplicatingService to match the new scheme.

ansible_mitogen/connection.py:
    - Rename 'method' to 'method_name' to disambiguate it from the
      service.call()'s method= argument.

ansible_mitogen/planner.py:
    - Generate an ID for every job, sync or not, and fetch job results
      from JobResultService rather than via the initiating function
      call's return value.
    - Planner subclasses now get to select whether their Runner should
      run in a forked process. The base implementation requests this if
      the 'mitogen_isolation_mode=fork' task variable is present.

ansible_mitogen/runner.py:
    Teach runners to deliver their result via JobResultService executing
    in their indirect parent mux process.

ansible_mitogen/plugins/actions/mitogen_async_status.py:
    Split the implementation up into methods, and more compatibly
    emulate Ansible's existing output.

ansible_mitogen/process.py:
    Mux processes now host JobResultService.

ansible_mitogen/services.py:
    Update existing services to the new mitogen.service scheme, and
    implement JobResultService:

    * listen() method for synchronous jobs. planner.invoke() registers a
      Sender with the service prior to invoking the job, then sleeps
      waiting for the service to write the job result to the
      corresponding Receiver.

    * Non-blocking get() method for implementing mitogen_async_status
      action.

    * Child-accessible push() method for delivering task results.

ansible_mitogen/target.py:
    New helpers for spawning a virginal subprocess on startup, from
    which asynchronous and mitogen_task_isolation=fork jobs are forked.
    Necessary to avoid a task inheriting potentially
    polluted/monkey-patched parent environment, since remaining jobs
    continue to run in the original child process.

docs/ansible.rst:
    Add/merge/remove some behaviours/risks.

tests/ansible/integration:
    New tests for forking/async.
6 years ago
David Wilson a643f13ebe issue #106: docs: tidyup. 6 years ago
David Wilson 432ebbca89 issue #106: docs: initial docs for how modules execute. 6 years ago
David Wilson b595314619 docs: fix intensely annoying _prefix, 2 years later. 6 years ago
David Wilson 6aeb4e9f05 issue #164: precisely emulate Ansible's stdio behaviour.
* Use identical logic to select when stdout/stderr are merged, so
  'stdout', 'stdout_lines', 'stderr', 'stderr_lines' contain the same
  output before/after the extension.

* When stdout/stderr are merged, synthesize carriage returns just like
  the TTY layer.

* Mimic the SSH connection multiplexing message on stderr. Not really
  for user code, but so compare_output_test.sh needs fewer fixups.
6 years ago
David Wilson e0381606af Ensure remote_tmp is respected everywhere.
Logic is still somewhat different from Ansible: we don't have to care
about sudo/non-sudo cases, etc.
6 years ago
David Wilson 38311336e1 docs: link to Ansible video demo 6 years ago
David Wilson 380ef7376d ansible: Add support for free strategy. 6 years ago
David Wilson 8425b196e7 docs: merge duplicate risks 6 years ago
David Wilson 6dcefd631a issue #106: docs: remove built-in only limitation :> 6 years ago
David Wilson 6958b8ff09 docs: More getting started. 6 years ago
David Wilson 8674ec42dd docs: add new risk 6 years ago
David Wilson bbb0f1bbd8 issue #155: fix double-fork behaviour and test it this time. 6 years ago
David Wilson 6670cba41c Introduce handler policy functions; closes #138.
Now you can specify a function to add_handler() that authenticates the
message header, with has_parent_authority() and is_immediate_child()
built in.
6 years ago
David Wilson 80a97fbc9b core: Rename Sender.put() to Sender.send().
Been annoying me for months.
6 years ago
David Wilson b48d63f33b docs: add to_sender() and update serialization notes 6 years ago
David Wilson 8676c40674 core: make _start_transmit / _stop_transmit async-only
For now at least, these APIs are always used in an asynchronous context,
so stop using the defer mechanism.
6 years ago
David Wilson c33bc22f21 docs: fix reading time tracking :( 6 years ago
David Wilson 4903052f42 fork: reseed Python/SSL PRNGs
Mac's SSL seems to have a pthread_atfork handler or similar that does
this for us, no clue if Linux is the same.
6 years ago
David Wilson 7f4368db87 docs: pad out signal handlers note 6 years ago
David Wilson d68833757b docs: slightly bikeshed last testimonial 6 years ago
dw d23a6174a2
Merge pull request #167 from danielcompton/patch-1
Add testimonial from Clojars
6 years ago
David Wilson 0dbb63ae3d docs: typo 6 years ago
David Wilson b254373cd7 docs: add local task serialization risk 6 years ago
Daniel Compton 871b853b59
Add testimonial from Clojars 6 years ago
David Wilson 2813d1a968 docs: update 6 years ago
David Wilson 5579ac936b issue #155: docs: more fork() liability warnings 6 years ago
David Wilson f457f54758 docs: fix formatting 6 years ago
David Wilson d370290687 docs: one more warning 6 years ago
David Wilson 03e08e25fd docs: put huge liability notice in fork() docs. 6 years ago
David Wilson 48351a1889 issue #155: parent: support Context.shutdown(), reap children on exit.
This permits graceful shutdown of individual contexts, without tearing
down everything.

Update mitogen.parent.Stream to also wait for the child to exit, to
prevent the buildup of zombie processes. This introduces a blocking wait
for process exit on the Broker thread, let's see if we can get away with
it. Chances are reasonable that it'll cause needless hangs on heavily
loaded machines.
6 years ago
David Wilson 6a74edce6b issue #155: parent: move master.Context into parent.
The Context and Router APIs for constructing children and making
function calls should be available in every parent context, as user code
wants to have access to the same API.
6 years ago
David Wilson 447353ecb8 docs: ansible.rst: note multi-host perf isn't great right now 6 years ago
David Wilson 20780820a6 docs: typo 6 years ago
David Wilson 75b9e1d71e issue #155: docs: document behaviour of forked children 6 years ago
David Wilson 110fdf24cd docs: add mitogen.fork.Stream to internals.rst 6 years ago
David Wilson 1a8ac9f4d1 issue #155: introduce mitogen.fork / Router.fork() 6 years ago
David Wilson 27175e3126 docs: tidy up signals.rst a little. 6 years ago
David Wilson 732a610246 docs: add beginnings of section on func decorators 6 years ago
David Wilson 2abe87472c issue #162: docs: begin documenting mitogen.service 6 years ago
David Wilson 54ff1c90fa issue #155: add DEL_ROUTE, propagate ADD_ROUTE upwards
* IDs are allocated by the parent responsible for contructing a new
  child, using ALLOCATE_ID to the master as necessary to allocate new ID
  ranges.

* ADD_ROUTE is sent up the tree rather than down. This permits
  construction of the new context to complete concurrent to parent
  contexts learning about its existence. Since all streams are strictly
  ordered, it's not possible for any parent to observe messages from the
  new context prior to arrival of an ADD_ROUTE from the parent notifying
  of its existence.

  If the new context, for example, implements an Ansible async task, its
  parent can start executing that without waiting for any synchronous
  confirmation from any parent or the master.

* Since routes propagate up, it's no longer possible for a plain
  non-parent child to ever receive ADD_ROUTE, so that code can be moved
  out of core.py and into parent.py (-0.2kb compressed).

* Add a .routes attribute to parent.Stream, and respond to disconnection
  signal on the stream by propagating DEL_ROUTE for any ADD_ROUTE ever
  received from that stream.

* Centralize route management in a new parent.RouteMonitor class
6 years ago
David Wilson aeeeb45ccb docs: farewell, glorious iframe! 6 years ago
David Wilson 1ed86774b5 issue #156: document select exception 6 years ago
David Wilson 20f5d89dfa issue #156: fix several more races
* Don't need to sleep if queue>sleepers, can just pop the right queue
  element and return it.

* If queue>sleeping and waking==sleeping, no mechanism existed to ensure
  a thread newly added to sleeping would ever be woken. Above change
  fixes that.

* Cannot trust select() return value, scheduler might sleep us
  indefinitely while put() writes a byte.

* Sleeping threads didn't pop FIFO, they popped in whatever order
  scheduler woke them up. Must recover index and use it to pick the pop
  index.
6 years ago
David Wilson 526b0a514b issue #156: prevent Latch.close() triggering spurious wakeups 6 years ago
David Wilson 18e2977baf docs: annoying phrasing 6 years ago
David Wilson 2c22c41819 issue #156: don't decrement `waking` if we timed out rather than being woken. 6 years ago
David Wilson 07a8994ff5 issue #156: waking thread result dictionary with an integer. 6 years ago
David Wilson b5398bd17f issue #156: docs typo 6 years ago
David Wilson 512ff77a46 issue #156: prevent non-sleeping threads from starving sleeping threads.
See new docs
6 years ago
David Wilson 148ce1d703 issue #155: increase context ID width to 32 bits
Needed to make large range allocations (1000 per ALLOCATE_ID roundtrip)
feasible.
6 years ago
David Wilson 071d9fbfb3 docs: tidy ansible docs. 6 years ago
David Wilson f241eac5ce parent: allow Python to determine its install prefix from argv[0]
Fixes support for virtualenv. Closes #152.
6 years ago
David Wilson dec3af375a issue #144: ansible: increase default pool size to 16. 6 years ago
David Wilson 4f361be7e7 issue #144: teach Select() to close its latch
Causes all threads sleeping on the select to wake.
6 years ago
David Wilson 8aada2646c core: support throwing LatchError in every sleeping thread
This is to allow Select() to be used as a generic queueing primitive
that supports graceful shutdown.
6 years ago
David Wilson 7a74bb0a39 docs: update ansible risks/differences. 6 years ago
David Wilson bcc15987fc docs: extra ansible paragraph. 6 years ago
David Wilson 7a394dc73e ansible: allow establishment of duplicate SSH connections 6 years ago
David Wilson 4691ce0b95 issue #150: ansible: add basic Docker support. 6 years ago
David Wilson 67ff762ba5 issue #139: docs: remove note about bad buffering 6 years ago