zuul/tests
James E. Blair a86aaf1158 Start ssh persistent connections outside bwrap
So that we can use ssh persistent connections across playbook
invocations, start them with our initial ansible ping process
before any playbook invocations and outside bubblewrap.  This
will allow the process to remain running in the background without
being terminated as it would be if run under bubblewrap.

Explicitly set the control path directory (where ssh will store the
persistent sockets) so we can ensure it is mounted correctly by
bubblewrap for later playbook invocations.

The timeout remains 60s, so if a connection is not used in that
timeframe, it will be closed and will need to be re-opened.  In that
case, the process holding the persistent connection will be inside
of bubblewrap, and so it will no longer persist to other playbooks,
but should still work.  In other words, we will fall back on the
current behavior.

The 60s timeout will mean that Linux will hold a reference to the
unlinked jobdir for 60s after the completion of the job.  That
shouldn't cause any problems.

When hosts are added to the inventory by a job, they will not benefit
from this -- their connections will be dropped at the end of the
playbook.

We would like to be able to explicitly stop the persistent connections
upon completion of the job for faster and more reliable cleanup.  In
order to do that, we need the control path that Ansible generates
if we wanted to execute the "ssh -O stop" command directly, or we need
to ask Ansible to do it for us.  The path generation is not
straightforward and the implementation may change, so it would be more
reliable to ask Ansible to stop the connections.  There is a facility
for this in the meta module, however, it has a fatal bug in 2.3.  The
bug is corrected in 2.4, so once we use that, we can explicitly stop
connections, and at that time it would be reasonable to extend the
persist timeout as we won't be relying solely on it to avoid processes
piling up on the executor.

Change-Id: I0e3607a195bf20e0df8cc2be0e2f96334f74088a
2017-10-16 07:18:37 -07:00
..
fixtures Ignore parents on job variants 2017-10-15 18:06:37 -07:00
nodepool Cleanup zookeeper and fake nodepool in nodepool tests 2017-04-25 10:19:31 -07:00
unit Ignore parents on job variants 2017-10-15 18:06:37 -07:00
__init__.py Add non-voting jobs. 2012-08-23 23:20:09 +00:00
base.py Start ssh persistent connections outside bwrap 2017-10-16 07:18:37 -07:00
encrypt_secret.py Re-enable E305 pep8 errors 2017-05-19 09:38:36 -04:00
make_playbooks.py Use libyaml if possible 2017-04-04 11:49:05 -07:00
print_layout.py Do not add implied branch matchers in project-templates 2017-09-30 10:19:07 -07:00