1952 Commits

Author SHA1 Message Date
Ian Wienand
bd992f3a76 ensure-docker: remove amd64 architecture pin
Just let this install the repo for whatever architecture we're running
on.

Change-Id: Ifdff9b731db5d5ab93dd7da6f7d8a311b3162113
2020-08-14 10:30:03 +10:00
00f4aab4d9 Fix url for ARA report
https://review.opendev.org/#/c/742971 changed
defaults for ara_report_path to be an absolute path but
missed changes in zuul artifacts. The url here
needs to be relative to log dir to be browsable.

Change-Id: I53511709227ea890eb417778be89e49e03771ff2
2020-08-12 12:27:17 +05:30
Zuul
7633994ed6 Merge "add-build-sshkey: call cmd with command" 2020-08-11 19:34:37 +00:00
Zuul
2975f163f5 Merge "Allow ara-report to run on any node" 2020-08-11 18:18:00 +00:00
Albin Vass
2e7b28ee86 add-build-sshkey: call cmd with command
Currently a new cmd shell is opened instead of running the command
supplied when adding the build key for ssh enabled windows nodes.

Fix this by adding a '/c' flag.

Change-Id: I582febfe91d5dc229cc6a1959477a461a237336b
2020-08-11 11:40:33 +02:00
Clark Boylan
4ab37d798a Loop over incomplete subunit files properly
We are still trying to get incomplete subunit files into our logs. This
is now failing because we assumed a single dict with a files entry to
iterate over but in reality we get a list of dicts with files entries to
iterate over. In order to iterate over this content we use
with_subelements to iterate over and copy the found files.

Change-Id: I160ac5caeec6fd7f5a35e805b7d4811b20405d14
2020-08-07 14:01:18 -07:00
Zuul
155a880534 Merge "Fix partial subunit stream logging" 2020-08-06 21:56:45 +00:00
Clark Boylan
43aa849174 Drop suse mirror types in our zypper repo configs
zypper wants to autodetect these values and it appears that upstream
changes repo types because we are having errors now. Dropping this
config manually on a held node seems to fix things.

Change-Id: I8ad28da7164d9a0955f43d4864ba24c14f0bd4a3
2020-08-06 13:59:27 -07:00
Clark Boylan
f9475ddc41 Fix partial subunit stream logging
In a previous change I attempted to log in flight subunit streams that
may be left behind if a job times out. This unfortunately didn't work
because in the cases we leave those files behind we also assume that we
don't have a valid .stestr state due to the contents of this directly.

Address this by modifying the find-stestr.sh script to indicate via its
return code if .stestr or .testrepository are present separate from
which commands are valid to run. Then in ansible we can do steps that
always apply if (s)testr were used (like copying partial logs) and
separately do subunit parsing if the contents of the (s)testr db
directories are valid.

Change-Id: I1c8f2405d74484631f633065baf9764dbd0209ee
2020-08-06 11:40:46 -07:00
Zuul
1ba95015ac Merge "Avoid to use 'length' filter with null value" 2020-08-06 13:36:52 +00:00
Pierre-Louis Bonicoli
222056a26f
Avoid to use 'length' filter with null value
This error occurs when variables are null and
DEFAULT_JINJA2_NATIVE is enabled:

    object of type 'NoneType' has no len()

Change-Id: I7c69be60b846c03e30a0a6e8893bf2f3a3d5e5b8
2020-08-03 03:31:29 +02:00
James E. Blair
c24c09e82c Allow ara-report to run on any node
This role had some assumptions that it would run only on the
zuul-executor.  If we remove those assumptions, it can run on any
worker node, which allows it to be used in untrusted playbooks.

Note that this is backwards compatible only in the case that the
user did not provide a non-default value for ara_report_path.  If
a user overrode that (eg, to put the report in a directory other
than "ara" under the executor log dir), this will break.

Change-Id: I3a28368a049fa583398ece8a66f90783f53098f4
2020-07-24 18:56:02 +00:00
Zuul
fcf84346ef Merge "Collect partial subunit files" 2020-07-23 20:04:16 +00:00
Zuul
f2ad332b48 Merge "Disable base role testing that runs code on localhost" 2020-07-23 20:04:14 +00:00
Zuul
672ca9ecc3 Merge "Reinstate docker tag cleanup" 2020-07-23 18:58:09 +00:00
Clark Boylan
8a08cb94ac Collect partial subunit files
If (s)testr are killed during a test run (possibly due to a timeout)
they will "leak" a tmp file containing the subunit stream to that point.
This file is useful for debugging so collect it. We don't process it
further as the file is a partial stream and humans may need to look at
it to make sense of it.

Change-Id: I6f0e61ec78f4dd9e2c4e52bc968b4f57586cb22e
2020-07-22 15:32:25 -07:00
Clark Boylan
44d2187e7f Disable base role testing that runs code on localhost
The workspace setup role requires local code execution on the executor.
This is not allowed from an untrusted context so we disable it.

The previous assertions about the zuul-cloner setup depend on the
workspace setup running successfully. Disable those extra assertions.

subunit fetching role assertions grepped the html file for validity on
localhost. Disable this as well.

Change-Id: I7449749f50b6e4a34c4615b00836a7148e01c768
2020-07-22 15:32:18 -07:00
James E. Blair
2dc89d8347 Reinstate docker tag cleanup
This uses a new method of calculating the cutoff time which does not
require executing code on the executor.

Change-Id: I92e71727e24281a31cb7caf0b78dd17a5aaae129
Co-Authored-By: Clark Boylan <clark.boylan@gmail.com>
2020-07-22 08:39:54 -07:00
Zuul
919fe2e8a7 Merge "dco-license: remove the empty nodeset" 2020-07-22 15:23:12 +00:00
Zuul
8c1d5d0519 Merge "Temporarily disable tag cleanup in docker promote" 2020-07-22 15:07:37 +00:00
Tristan Cacqueray
61228901c2 dco-license: remove the empty nodeset
The job was relying on a security hole to execute untrusted command
on the executor (localhost). This change prevents failure after the
hole is fixed.

Change-Id: I910fb6e6a2659e77991111c8ce5a6b763556aeec
2020-07-22 14:46:41 +00:00
James E. Blair
abd4ab18a3 Temporarily disable tag cleanup in docker promote
This was relying on a bug in the executor.  It's not critical
functionality, so just avoid it for now.

Change-Id: I6069150324d0b921cdb8cbc6902e74ec2a6036cc
2020-07-22 07:26:05 -07:00
Zuul
9ee30e5216 Merge "Add upload-logs-s3" 2020-07-22 07:50:20 +00:00
Xing Zhang
1242a98137
Fix add repositories in RedHat and Suse
These tasks should be used with become like Debian.yaml, otherwise
error will occurred like this:
[Errno 13] Permission denied: '/etc/yum.repos.d/test.repo'

Change-Id: I9c6f0132536500d36ba0098b635b1858e05d7ccf
2020-07-21 10:51:28 +08:00
Zuul
9e20909819 Merge "Enable tls-proxy in ensure-devstack" 2020-07-20 20:49:12 +00:00
Zuul
15b4903a32 Merge "add-build-sshkey: Ensure .ssh exists, enable admin authorized_keys" 2020-07-20 15:57:17 +00:00
Albin Vass
838b0c8877 Add upload-logs-s3
Change-Id: I6ce64734ed5f20a212e6cb953d09ea2769238bea
2020-07-19 21:22:36 +02:00
Albin Vass
45ea044d53 Remove copy paste from upload-logs-swift
Change-Id: Ia365e46bf58ebd6d17ec064e3a0114dd64278c77
2020-07-19 13:27:30 +02:00
Clark Boylan
7f5e3ef831 Enable tls-proxy in ensure-devstack
We do this because it better approximates a production environment and
it seems that devstack is better tested when tls-proxy is enabled.

Change-Id: If607caf301211181b4f37a2c7012f875de3d285c
2020-07-18 15:05:33 -07:00
Zuul
eb9eb8bc12 Merge "Add a test that exercises the GCS Credentials class" 2020-07-16 21:08:41 +00:00
James E. Blair
a488ed2cdc Add a test that exercises the GCS Credentials class
We subclass the GCS Credentials class.  We can't completely test
it without either hitting the live Google cloud or substantial
mocking, but we should be able to exercise most of the functionality
we typically use.  Do that by asking it to load a token from disk
and assert that it adds that token to a fake request headers
dictionary.

This also corrects a "problem" detected by the test.  The current
super() call uses the python3 form, which is fine in that all current
uses of this code are using python3, but we still run python27 tests
on this repo, so we'll use the python2/python3 compat syntax.

Change-Id: Ifa4209617f4be52008b6294ebd10f0deb9bd6a51
2020-07-16 13:30:13 -07:00
Zuul
fdd7867ee6 Merge "Remove default tox_envlist: venv" 2020-07-16 20:17:13 +00:00
Albin Vass
c388e61160 Remove default tox_envlist: venv
Setting tox_envlist to venv by default is unintuitive for
many users. Remove this behaviour and let default tox
behaviour be the same as running tox on the commandline.

Change-Id: I1b6d59ee4ebb7f6b3adcf4bd35d7148e83389008
2020-07-16 21:59:57 +02:00
James E. Blair
c0abf5cffc Fix GCS log upload
The google-auth Credential class added some new variables in the
constructor; make sure that we call it in order to avoid later
reference errors.

Change-Id: I338a3368b90a6612801ba587982d3053bbd3ba78
2020-07-16 12:32:02 -07:00
Zuul
8e4b52617c Merge "upload-afs-synchronize: expand documentation" 2020-07-15 16:07:39 +00:00
Zuul
2b5777e82a Merge "write-inventory: add per-host variables" 2020-07-14 21:26:48 +00:00
Ian Wienand
c19ea2e6f9 upload-afs-synchronize: expand documentation
The upload-afs-synchronize role was added with
I493d8829e3fd98e84f1b8f0e776e7ba41abf16c2 and used as part of the
artifact promote process for tarballs and other uploads.  However the
role is useful as a generic way to upload results to AFS and avoid
some commonly hit caveats such as getting permissions flags wrong.

Expand the README to explain things a little more.

Change-Id: Ia643b02b503560d1057697fc5a7d143fd728b177
2020-07-15 06:48:44 +10:00
Sean McGinnis
09b4be329e
Strip path from default ensure_pip_from_upstream_interpreters
The ensure-pip role has an option to provide multiple interpreters to
use. If not specified, we default to ansible_python.executable. This
default includes the full path to the executable. Those manually
providing which interpreters to use will not know what the full path is,
only the versions they would like to use. To make things consistent,
this strips off the path so we just have the version (python, python3,
python3.8, etc).

Change-Id: I339afc08393e9c6b1d26a05cf13b6fdc151f46d5
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-07-10 11:24:27 -05:00
Zuul
2f9ef55117 Merge "Install venv for all platforms in ensure-pip" 2020-07-10 14:30:20 +00:00
Sean McGinnis
0aca372814
Install venv for all platforms in ensure-pip
The ensure-pip tasks will install python3-venv, but multiple
interpreters may be specified. This adds handling to make sure the venv
package is installed for all requested interpreters.

Change-Id: I670d5815bfc902f9c50a98df715ef60b61bab594
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-07-09 16:02:45 -05:00
Albin Vass
a7faab5819 add-build-sshkey: Ensure .ssh exists, enable admin authorized_keys
Change-Id: I54608635711a4936ce01c3859706236627d80af9
2020-07-09 21:05:12 +02:00
Zuul
a0c29f2843 Merge "emit-job-header: add inventory hostname" 2020-07-09 13:02:03 +00:00
Albin Vass
dd59a158e8 Enforce BatchMode when setting up ssh for windows
Change-Id: I62742dc43df5276f51805e259229405ba9b19362
2020-07-09 14:09:27 +02:00
Zuul
25af9d4014 Merge "fetch-coverage-output: direct link to coverage data" 2020-07-08 07:59:01 +00:00
Ian Wienand
184152f07e write-inventory: add per-host variables
This allows us to write out host-specific variables into the inventory
from external jobs.

Change-Id: I0c3d08f6446174cb38d5eebaeae1db9dceb956b2
2020-07-08 17:20:21 +10:00
Zuul
3b8470b4a7 Merge "Allow deleting workspace after running terraform destroy" 2020-07-07 16:29:38 +00:00
Zuul
c900f1c4df Merge "Drop support for ansible 2.6" 2020-07-07 11:32:11 +00:00
Luigi Toscano
82828cea50 fetch-coverage-output: direct link to coverage data
Make it easier to find them.

Change-Id: I0e8ee7e3c9f6e55461168b97525b26625eb018f0
2020-07-06 01:03:00 +02:00
Alex Schultz
d8c3a4a808 Make persist-iptables more robust
We're seeing when the shell command fails (for whatever reason) and since
it's failed_when: false, the subsequent tasks actually fail.  We can
check if stdout is not defined as a failure condition because that means
the module itself failed and we should not continue to process the
next tasks since they depend on stdout being defined.. Additionally we
can add some retries to try again if possible.

Change-Id: Iabc1619009220c6f1c91b84f81d5262c4d9d8430
Related-Bug: #1885697
2020-07-02 09:42:58 -06:00
Ian Wienand
1842495fcb emit-job-header: add inventory hostname
When you're running a multi-node job, it would be nice to see the
inventory hostname in this list, so if you want to say, monitor one of
the nodes, you don't have to guess which is which.

Change-Id: Ibf822d51711c74d963a7287eaeaa9a40ff074e79
2020-07-02 15:59:15 +10:00