Merge branch 'master' into prepare-0.3.1
commit
61ccf055ad
@ -1,95 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
import ci_lib
|
||||
|
||||
batches = []
|
||||
|
||||
if 0 and os.uname()[0] == 'Linux':
|
||||
batches += [
|
||||
[
|
||||
"sudo chown `whoami`: ~",
|
||||
"chmod u=rwx,g=rx,o= ~",
|
||||
|
||||
"sudo mkdir /var/run/sshd",
|
||||
"sudo /etc/init.d/ssh start",
|
||||
|
||||
"mkdir -p ~/.ssh",
|
||||
"chmod u=rwx,go= ~/.ssh",
|
||||
|
||||
"ssh-keyscan -H localhost >> ~/.ssh/known_hosts",
|
||||
"chmod u=rw,go= ~/.ssh/known_hosts",
|
||||
|
||||
"cat tests/data/docker/mitogen__has_sudo_pubkey.key > ~/.ssh/id_rsa",
|
||||
"chmod u=rw,go= ~/.ssh/id_rsa",
|
||||
|
||||
"cat tests/data/docker/mitogen__has_sudo_pubkey.key.pub > ~/.ssh/authorized_keys",
|
||||
"chmod u=rw,go=r ~/.ssh/authorized_keys",
|
||||
]
|
||||
]
|
||||
|
||||
# setup venv, need all python commands in 1 list to be subprocessed at the same time
|
||||
venv_steps = []
|
||||
|
||||
need_to_fix_psycopg2 = False
|
||||
|
||||
is_python3 = os.environ['PYTHONVERSION'].startswith('3')
|
||||
|
||||
# @dw: The VSTS-shipped Pythons available via UsePythonVErsion are pure garbage,
|
||||
# broken symlinks, incorrect permissions and missing codecs. So we use the
|
||||
# deadsnakes PPA to get sane Pythons, and setup a virtualenv to install our
|
||||
# stuff into. The virtualenv can probably be removed again, but this was a
|
||||
# hard-fought battle and for now I am tired of this crap.
|
||||
if ci_lib.have_apt():
|
||||
venv_steps.extend([
|
||||
'echo force-unsafe-io | sudo tee /etc/dpkg/dpkg.cfg.d/nosync',
|
||||
'sudo add-apt-repository ppa:deadsnakes/ppa',
|
||||
'sudo apt-get update',
|
||||
'sudo apt-get -y install '
|
||||
'python{pv} '
|
||||
'python{pv}-dev '
|
||||
'libsasl2-dev '
|
||||
'libldap2-dev '
|
||||
.format(pv=os.environ['PYTHONVERSION']),
|
||||
'sudo ln -fs /usr/bin/python{pv} /usr/local/bin/python{pv}'
|
||||
.format(pv=os.environ['PYTHONVERSION'])
|
||||
])
|
||||
if is_python3:
|
||||
venv_steps.append('sudo apt-get -y install python{pv}-venv'.format(pv=os.environ['PYTHONVERSION']))
|
||||
# TODO: somehow `Mito36CentOS6_26` has both brew and apt installed https://dev.azure.com/dw-mitogen/Mitogen/_build/results?buildId=1031&view=logs&j=7bdbcdc6-3d3e-568d-ccf8-9ddca1a9623a&t=73d379b6-4eea-540f-c97e-046a2f620483
|
||||
elif is_python3 and ci_lib.have_brew():
|
||||
# Mac's System Integrity Protection prevents symlinking /usr/bin
|
||||
# and Azure isn't allowing disabling it apparently: https://developercommunityapi.westus.cloudapp.azure.com/idea/558702/allow-disabling-sip-on-microsoft-hosted-macos-agen.html
|
||||
# so we'll use /usr/local/bin/python for everything
|
||||
# /usr/local/bin/python2.7 already exists!
|
||||
need_to_fix_psycopg2 = True
|
||||
venv_steps.append(
|
||||
'brew install python@{pv} postgresql'
|
||||
.format(pv=os.environ['PYTHONVERSION'])
|
||||
)
|
||||
|
||||
# need wheel before building virtualenv because of bdist_wheel and setuptools deps
|
||||
venv_steps.append('/usr/local/bin/python{pv} -m pip install -U pip wheel setuptools'.format(pv=os.environ['PYTHONVERSION']))
|
||||
|
||||
if os.environ['PYTHONVERSION'].startswith('2'):
|
||||
venv_steps.extend([
|
||||
'/usr/local/bin/python{pv} -m pip install -U virtualenv'.format(pv=os.environ['PYTHONVERSION']),
|
||||
'/usr/local/bin/python{pv} -m virtualenv /tmp/venv -p /usr/local/bin/python{pv}'.format(pv=os.environ['PYTHONVERSION'])
|
||||
])
|
||||
else:
|
||||
venv_steps.append('/usr/local/bin/python{pv} -m venv /tmp/venv'.format(pv=os.environ['PYTHONVERSION']))
|
||||
# fixes https://stackoverflow.com/questions/59595649/can-not-install-psycopg2-on-macos-catalina https://github.com/Azure/azure-cli/issues/12854#issuecomment-619213863
|
||||
if need_to_fix_psycopg2:
|
||||
venv_steps.append('/tmp/venv/bin/pip3 install psycopg2==2.8.5 psycopg2-binary')
|
||||
|
||||
venv_steps.extend([
|
||||
# pbr is a transitive setup_requires of hdrhistogram. If it's not already
|
||||
# installed then setuptools attempts to use easy_install, which fails.
|
||||
'/tmp/venv/bin/pip install pbr==5.6.0',
|
||||
])
|
||||
|
||||
batches.append(venv_steps)
|
||||
|
||||
ci_lib.run_batches(batches)
|
@ -0,0 +1,13 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
import distutils.version
|
||||
|
||||
import ansible
|
||||
|
||||
__all__ = [
|
||||
'ansible_version',
|
||||
]
|
||||
|
||||
ansible_version = tuple(distutils.version.LooseVersion(ansible.__version__).version)
|
||||
del distutils
|
||||
del ansible
|
@ -0,0 +1,74 @@
|
||||
# Copyright 2019, David Wilson
|
||||
# Copyright 2021, Mitogen contributors
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# 1. Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
#
|
||||
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
# this list of conditions and the following disclaimer in the documentation
|
||||
# and/or other materials provided with the distribution.
|
||||
#
|
||||
# 3. Neither the name of the copyright holder nor the names of its contributors
|
||||
# may be used to endorse or promote products derived from this software without
|
||||
# specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# !mitogen: minify_safe
|
||||
|
||||
import logging
|
||||
|
||||
import mitogen.core
|
||||
import mitogen.parent
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class Options(mitogen.parent.Options):
|
||||
container = None
|
||||
username = None
|
||||
podman_path = 'podman'
|
||||
|
||||
def __init__(self, container=None, podman_path=None, username=None,
|
||||
**kwargs):
|
||||
super(Options, self).__init__(**kwargs)
|
||||
assert container is not None
|
||||
self.container = container
|
||||
if podman_path:
|
||||
self.podman_path = podman_path
|
||||
if username:
|
||||
self.username = username
|
||||
|
||||
|
||||
class Connection(mitogen.parent.Connection):
|
||||
options_class = Options
|
||||
child_is_immediate_subprocess = False
|
||||
|
||||
# TODO: better way of capturing errors such as "No such container."
|
||||
create_child_args = {
|
||||
'merge_stdio': True
|
||||
}
|
||||
|
||||
def _get_name(self):
|
||||
return u'podman.' + self.options.container
|
||||
|
||||
def get_boot_command(self):
|
||||
args = [self.options.podman_path, 'exec']
|
||||
if self.options.username:
|
||||
args += ['--user=' + self.options.username]
|
||||
args += ["--interactive", "--", self.options.container]
|
||||
return args + super(Connection, self).get_boot_command()
|
@ -1,4 +1,6 @@
|
||||
- include: setup/all.yml
|
||||
- include: regression/all.yml
|
||||
- include: integration/all.yml
|
||||
|
||||
- import_playbook: setup/all.yml
|
||||
tags: setup
|
||||
- import_playbook: regression/all.yml
|
||||
tags: regression
|
||||
- import_playbook: integration/all.yml
|
||||
tags: integration
|
||||
|
@ -1,10 +1,10 @@
|
||||
- include: copy.yml
|
||||
- include: fixup_perms2__copy.yml
|
||||
- include: low_level_execute_command.yml
|
||||
- include: make_tmp_path.yml
|
||||
- include: make_tmp_path__double.yml
|
||||
- include: remote_expand_user.yml
|
||||
- include: remote_file_exists.yml
|
||||
- include: remove_tmp_path.yml
|
||||
- include: synchronize.yml
|
||||
- include: transfer_data.yml
|
||||
- import_playbook: copy.yml
|
||||
- import_playbook: fixup_perms2__copy.yml
|
||||
- import_playbook: low_level_execute_command.yml
|
||||
- import_playbook: make_tmp_path.yml
|
||||
- import_playbook: make_tmp_path__double.yml
|
||||
- import_playbook: remote_expand_user.yml
|
||||
- import_playbook: remote_file_exists.yml
|
||||
- import_playbook: remove_tmp_path.yml
|
||||
- import_playbook: synchronize.yml
|
||||
- import_playbook: transfer_data.yml
|
||||
|
@ -1,9 +1,9 @@
|
||||
- include: multiple_items_loop.yml
|
||||
- include: result_binary_producing_json.yml
|
||||
- include: result_binary_producing_junk.yml
|
||||
- include: result_shell_echo_hi.yml
|
||||
- include: runner_new_process.yml
|
||||
- include: runner_one_job.yml
|
||||
- include: runner_timeout_then_polling.yml
|
||||
- include: runner_two_simultaneous_jobs.yml
|
||||
- include: runner_with_polling_and_timeout.yml
|
||||
- import_playbook: multiple_items_loop.yml
|
||||
- import_playbook: result_binary_producing_json.yml
|
||||
- import_playbook: result_binary_producing_junk.yml
|
||||
- import_playbook: result_shell_echo_hi.yml
|
||||
- import_playbook: runner_new_process.yml
|
||||
- import_playbook: runner_one_job.yml
|
||||
- import_playbook: runner_timeout_then_polling.yml
|
||||
- import_playbook: runner_two_simultaneous_jobs.yml
|
||||
- import_playbook: runner_with_polling_and_timeout.yml
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
- include: su_password.yml
|
||||
- include: sudo_flags_failure.yml
|
||||
- include: sudo_nonexistent.yml
|
||||
- include: sudo_nopassword.yml
|
||||
- include: sudo_password.yml
|
||||
- include: sudo_requiretty.yml
|
||||
- import_playbook: su_password.yml
|
||||
- import_playbook: sudo_flags_failure.yml
|
||||
- import_playbook: sudo_nonexistent.yml
|
||||
- import_playbook: sudo_nopassword.yml
|
||||
- import_playbook: sudo_password.yml
|
||||
- import_playbook: sudo_requiretty.yml
|
||||
|
@ -1,11 +1,11 @@
|
||||
---
|
||||
|
||||
- include: become_same_user.yml
|
||||
- include: disconnect_during_module.yml
|
||||
- include: disconnect_resets_connection.yml
|
||||
- include: exec_command.yml
|
||||
- include: home_dir.yml
|
||||
- include: put_large_file.yml
|
||||
- include: put_small_file.yml
|
||||
- include: reset.yml
|
||||
- include: reset_become.yml
|
||||
- import_playbook: become_same_user.yml
|
||||
- import_playbook: disconnect_during_module.yml
|
||||
- import_playbook: disconnect_resets_connection.yml
|
||||
- import_playbook: exec_command.yml
|
||||
- import_playbook: home_dir.yml
|
||||
- import_playbook: put_large_file.yml
|
||||
- import_playbook: put_small_file.yml
|
||||
- import_playbook: reset.yml
|
||||
- import_playbook: reset_become.yml
|
||||
|
@ -1,5 +1,5 @@
|
||||
- include: delegate_to_template.yml
|
||||
- include: local_action.yml
|
||||
- include: osa_container_standalone.yml
|
||||
- include: osa_delegate_to_self.yml
|
||||
- include: stack_construction.yml
|
||||
- import_playbook: delegate_to_template.yml
|
||||
- import_playbook: local_action.yml
|
||||
- import_playbook: osa_container_standalone.yml
|
||||
- import_playbook: osa_delegate_to_self.yml
|
||||
- import_playbook: stack_construction.yml
|
||||
|
@ -1,3 +1,3 @@
|
||||
- include: local_blemished.yml
|
||||
- include: paramiko_unblemished.yml
|
||||
- include: ssh_blemished.yml
|
||||
- import_playbook: local_blemished.yml
|
||||
- import_playbook: paramiko_unblemished.yml
|
||||
- import_playbook: ssh_blemished.yml
|
||||
|
@ -1,4 +1,4 @@
|
||||
- include: disconnect_cleanup.yml
|
||||
- include: lru_one_target.yml
|
||||
- include: reconnection.yml
|
||||
- include: remote_name.yml
|
||||
- import_playbook: disconnect_cleanup.yml
|
||||
- import_playbook: lru_one_target.yml
|
||||
- import_playbook: reconnection.yml
|
||||
- import_playbook: remote_name.yml
|
||||
|
@ -1,2 +1,2 @@
|
||||
|
||||
- include: resolv_conf.yml
|
||||
- import_playbook: resolv_conf.yml
|
||||
|
@ -1,2 +1,2 @@
|
||||
- include: complex_args.yml
|
||||
- include: ansible_2_8_tests.yml
|
||||
- import_playbook: complex_args.yml
|
||||
- import_playbook: ansible_2_8_tests.yml
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
- include: cwd_preserved.yml
|
||||
- include: env_preserved.yml
|
||||
- import_playbook: cwd_preserved.yml
|
||||
- import_playbook: env_preserved.yml
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
#- include: from_config_path.yml
|
||||
#- include: from_config_path_pkg.yml
|
||||
#- include: adjacent_to_playbook.yml
|
||||
- include: adjacent_to_role.yml
|
||||
#- include: overrides_builtin.yml
|
||||
#- import_playbook: from_config_path.yml
|
||||
#- import_playbook: from_config_path_pkg.yml
|
||||
#- import_playbook: adjacent_to_playbook.yml
|
||||
- import_playbook: adjacent_to_role.yml
|
||||
#- import_playbook: overrides_builtin.yml
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue