1162 Commits

Author SHA1 Message Date
Mohammed Naser
d311a4289a tox_parse_output: add no_log to tox_output
The `tox_parse_output` currently logs the entire output of tox
into the syslog as the natural Ansible behaviour, as part of doing
that, it also encodes it inside utf-8.  This results in errors
in the case that the the data contains surrogates and crashes the
entire job.

Given that this issue really occurs during logging and we don't
have a reason to log all of the tox output to the syslog, this
patch sets the module parameter to `no_log` which should skip the
encoding and logging for that parameter[0].

[0]: https://github.com/ansible/ansible/blob/stable-2.9/lib/ansible/module_utils/basic.py#L1945-L1957

Change-Id: I470cd35111a63662c43f779fc9e119aa8d78c838
2020-04-01 08:52:10 -04:00
Tobias Henkel
a3c7c22c06
Ignore errors when parsing tox output
Retrieving file comments is not an essential part of the job and
should not fail the job if something goes wrong.

Change-Id: Ide13343c6eda3a1fd0f45cb33cba35f3b048ece6
2020-04-01 14:35:48 +02:00
Ian Wienand
ca2ee69e60 local-log-download : role with script to download all log files
This is an alternative to I98c80f657f38c5e1ed5f28e5d36988a3429ad1f8
which does not modify the upload script, but rather queries the API
and manifest for what to download.

The script is a hybrid of python and bash to not implement json API
parsing badly in bash, but not replicate curl badly in python either.
The script sanity checks for dependencies, which are considered pretty
standard for any developer who would be interested in downloading logs
like this.

The role writes out the script with the correct build values coded
into it, so a potential user just has to run it without any arguments
or modification.

Change-Id: Ic33732adbfd3210191bf4976c3ee316cfc50568e
2020-04-01 07:41:26 +11:00
Zuul
7e2b931332 Merge "Remove lint skip in tox iniline comment parser" 2020-03-31 19:05:11 +00:00
Zuul
430bfc90be Merge "Revert "Revert "Extract pep8 messages for inline comments""" 2020-03-31 19:05:10 +00:00
Zuul
472c591358 Merge "install-docker: allow removal of conflicting packages" 2020-03-31 16:38:30 +00:00
James E. Blair
2961a8f30e Remove lint skip in tox iniline comment parser
This isn't necessary any more since we added the fake zuul_return
module to this repo.

Change-Id: Ib7ac96cd38d2e987f884a086cb29d9807f275c60
2020-03-31 07:49:52 -07:00
Zuul
d78891a59d Merge "Improve job and node information banner" 2020-03-30 21:37:23 +00:00
Sorin Sbarnea
cce6535468 install-docker: allow removal of conflicting packages
Allow us to define which packages need to be removed before installing
the desired ones.

Fixes use of role on systems where it was desired to install upstream
docker but the system one was already installed.

Change-Id: Ib6ae0a8fba937901b29565e2d36486eccf4f67bb
2020-03-30 16:00:23 +01:00
Sorin Sbarnea
8a5bc42bb9 Improve job and node information banner
Adds information that is can be key regarding the outcome of the job:
* distribution name
* distribution version

Change-Id: I8362ef2f0a89de4c318f13c874b6f083a4f1699f
2020-03-30 10:47:24 +01:00
Ian Wienand
eef32848a4 test-upload-logs-swift: revert download script
We forgot to revert test-upload-logs-swift with the revert
4f13f7c07f101ee34ebfcfdf6175adb3857f8ac5 in the production role.

Change-Id: I4977091b1ab8e5188a71d16e609c43a2482496c4
2020-03-30 12:32:02 +11:00
Mohammed Naser
7668ec7c38 Revert "Revert "Extract pep8 messages for inline comments""
This reverts commit b35f47190a0674e44e4b5d38b8062fc717fb4cf0.

Change-Id: I71cd0520ff62c41e4e3ebe9eb9e8a3839147726e
2020-03-29 19:21:46 -04:00
Zuul
4b23fe8b64 Merge "install-kubernetes: fix missing package, fix the client.key file path" 2020-03-27 19:35:48 +00:00
Mohammed Naser
9fc0e3580a install-kubernetes: fix missing package, fix the client.key file path
The install-kubernetes role is now failing due to the fact that
minikube now requires conntrack.  This patch solves this.

Change-Id: I1e59d5e9255064646bd8e8c6b6edb2c34d45b516
2020-03-27 10:04:53 -07:00
Zuul
753305bd7d Merge "Revert "upload-logs-swift: Create a download script"" 2020-03-27 14:26:24 +00:00
Zuul
a436f6a114 Merge "ensure-tox: use python3 by default" 2020-03-27 14:26:23 +00:00
James E. Blair
4f13f7c07f Revert "upload-logs-swift: Create a download script"
This reverts commit acde44818d0827174b22290192b3c728c440a1c5 and
the testing part of b3f417a6e6fb9539d4f7aee46a123e7ced76d0b5.

We'd like to obtain more consensus on the download script before
we commit to this.  In particular, the new zuul manifest file may
make it possible to do this without adding the feature to the
log upload roles.

Change-Id: I959c44b4dac6cad6d1b3d82ba6bc0949c9c759ff
2020-03-27 14:59:49 +01:00
Zuul
5627cb77e9 Merge "upload-logs-swift: Add a unicode file" 2020-03-25 22:55:26 +00:00
Zuul
a85ab8c775 Merge "upload-logs-swift: Create a download script" 2020-03-25 22:55:26 +00:00
Zuul
a08be61483 Merge "Trim whitespace from uri password for docker promote" 2020-03-24 18:06:49 +00:00
olesandr kozachenko
c20150566a add role for collecting the kubernetes pod&kubelet logs
Change-Id: I73a0cf471b9e7a8b924655e22e1f7dde069df5c7
2020-03-23 22:28:02 +02:00
Monty Taylor
a86510bd02 Trim whitespace from uri password for docker promote
The uri module faithfully passes the entire string, even if it has
trailing whitespace such as a newline. The zuul encrypt_secret
command currently does not trim, so if echo was used instead of
echo -n this can fail in a hard to debug manner.

Change-Id: Ic9525ac2925b6639f58604ca40dc878d20511ff8
2020-03-23 13:01:46 -05:00
James E. Blair
b4dc66ec33 use-buildset-registry: protect against /var/user/1000 not existing
This is the case on Xenial; we'll just accept that podman and friends
may not work there.

Change-Id: Icd14e4502ff21640a1948671a475448adaf868f5
2020-03-20 13:28:03 -07:00
Ian Wienand
b3f417a6e6 upload-logs-swift: Add a unicode file
Everything's better with some unicode sprinkled in.  Add a unicode
filename to keep unit testing on its toes.

Note this is duplicated across the test role too.

Change-Id: Iaefe9bea2c1a10d440ef75df3acd71fdd9a4157e
2020-03-20 13:15:00 +11:00
Ian Wienand
acde44818d upload-logs-swift: Create a download script
After we have determinted the root URL, create a download script from
a given jinja2 template.  This is added to the file list at the root
and uploaded with the other files.

Generated index files are given a new flag so they can be
differentiated.

This is an impelementation of
Iea8abd4cd71ece26b51335642f73bd2e544c42dd for the swift-upload role.

Change-Id: I98c80f657f38c5e1ed5f28e5d36988a3429ad1f8
2020-03-20 13:14:55 +11:00
Ian Wienand
a68ddd3c5f test-upload-logs-swift: fix download link
We can just find the basename of the template file, and return that --
the artifact will be a relative URL which will be right.

For additional help, add a metadata string you could copy-paste to
download.

Change-Id: I1a6f931fdd1613d1e51a20ed76a69c76bbb14dc1
2020-03-20 13:08:40 +11:00
Zuul
476c6d918d Merge "test-upload-logs-swift: move script artifact after upload" 2020-03-20 01:36:00 +00:00
Ian Wienand
114a3a97c9 test-upload-logs-swift: move script artifact after upload
We need to move this after the upload step, because this is where we
get the final URL.

Change-Id: I76aff454be75d45fcb27e900c51aac9bc6a5f25a
2020-03-20 11:24:06 +11:00
Zuul
0a16a6a907 Merge "Replace occurences of '/' in nodename to something more path friendly" 2020-03-20 00:21:51 +00:00
Ian Wienand
de303d1045 test-upload-logs-swift: add download script as an artifact
Some time ago we merged Id91350ff1c531fd7266f3bf76681a8415941481f to
test the idea of a download script; proposed in
I98c80f657f38c5e1ed5f28e5d36988a3429ad1f8.

However, we never actually go to either merging or abandoning the
actual change in I98c80f657f38c5e1ed5f28e5d36988a3429ad1f8.

This adds the download script as an artifact, which brings the testing
role in-line with the latest thinking in the actual job proposed in
I98c80f657f38c5e1ed5f28e5d36988a3429ad1f8.

Once tested, we can then actually get reviews this time and decide to
either go with this, or revert the whole thing and remove it from the
testing role.

Change-Id: Id1d8b04ff65a4dc567b73f22bcfb2795a3f13d7d
2020-03-20 09:14:26 +11:00
Zuul
1e4e4bd91e Merge "Add support for installing python with pyenv" 2020-03-19 14:52:13 +00:00
Zuul
e06a916021 Merge "Optimize repos for size when preparing for nodecache" 2020-03-18 20:23:55 +00:00
Zuul
5786a6615e Merge "Kubernetes Node Support for Mirroring Git Repos" 2020-03-18 20:18:04 +00:00
Alfredo Moralejo
c4c6958622 Use centos8 deps repo for RHEL8 nodes
CentOS8 deps should be compatible with RHEL and provide latest versions
of deps compared to the old rhel8 one. Let's switch to use it to install
openvswitch too.

Change-Id: I04090a179706c52e3db4e9118b74f7c7d5ad9776
2020-03-18 10:29:04 +01:00
Monty Taylor
e71d0d2607 Add support for installing python with pyenv
In order to install particular python versions on distros that
don't otherwise have them, add an option for installing via
pyenv.

The packages to be installed to allow for Python to be built were
tested on the official Docker containers so they should provide
a fair amount of coverage from a minimal environment.

Co-Authored-By: Mohammed Naser <mnaser@vexxhost.com>
Change-Id: Ic3312458b499a4b743895fa5829bb25155f77654
2020-03-17 17:32:49 -04:00
Zuul
75e3b15939 Merge "install-docker: add option to use buildset registry" 2020-03-17 01:00:01 +00:00
Albin Vass
94e69147a7 Replace occurences of '/' in nodename to something more path friendly
Inventory hostnames like "abc/123" is valid in both ansible and zuul
but this role breaks since it uses it as part of a path. This sanitizes
the hostname from "abc/123" to "abc_123".

Change-Id: Ic89d595b6f004b5ca4805f1af8387e8ba56564aa
2020-03-16 11:27:10 +01:00
Mohammed Naser
ae05322a85 install-docker: add option to use buildset registry
At the moment, the build registry is not used inside Kubernetes jobs
and it is required to override the entire pre.yaml just to enable it.

This patch adds an option of using docker_use_buildset_registry inside
install-docker which can be used in order to install Docker and letting
it use the buildset registry simply by adjusting the job.vars

Change-Id: I1b42eac6accbf7c350aee76d18a823ba6327548d
2020-03-14 18:30:39 -04:00
Mohammed Naser
44608e16e7 wait-for-pods: Wait for all pods to become Ready
This refactors the code inside helm-template which waits for all
pods to become Ready to move inside it's own seperate role instead
which can be used for other tasks.

Change-Id: Ibb234c46c49fe656cf918a7a4af115e0d26f23f0
2020-03-14 14:14:43 -04:00
Mohammed Naser
bed3643b28 ensure-tox: use python3 by default
The role currently defaults to installing tox with python2 in order
to maintain compatibility with existing jobs.  This change makes the
default behaviour use python3 as python2 is EOL.

Change-Id: Ic41b8fee7ae8a8f5df6c1107c6ed812c14b8c8be
2020-03-12 17:49:45 -04:00
Mohammed Naser
ffe0738f60 install-kubernetes: install lz4 packages
minikube has added a new "feature" which pre-loads a blob of data
with everything it needs that we can't disable, with a fallback.

we're currently downloading ~500MB and failing to use it because
it's compressed by lz4 which we don't have in images, this change
adds that to the package list.

Change-Id: If74faf2b21d564fa23253ea2eb5378457f055735
2020-03-12 15:04:16 -04:00
Benjamin Schanzel
f18644891d Kubernetes Node Support for Mirroring Git Repos
The `mirror-workspace-git-repos` uses Git to mirror repos from the
executor to build nodes. This comes in handy when the node already
holds a copy of the repo(s), as Git can incrementally update them.
Currently, `mirror-workspace-git-repos` assumes the build node is
directly reachable via ssh. This is (usually) not the case when
running against a Kubernetes Pod build node, thus we can not
efficiently update repos on such nodes using Git.
This change allows pushing Git repos to Kubernetes Pods by bridging
the Git communication over `kubectl` and thereby allowing for the
same behaviour as for standard, non-container, ssh-reachable build
nodes.
(cf. https://git-scm.com/docs/git-remote-ext)

Change-Id: I71919d3bc93e48d5bb24234265fca9c84ce23b87
2020-03-09 14:44:24 +01:00
Mohammed Naser
9254fbb5ff ensure-tox: add prefer_python2
This patch enables the ability to set a value which prefers the
installation of tox within python2 over python3.

Change-Id: I29c9585aa9048c0e2855ec1eaf1f48041cfe46e2
2020-03-04 07:21:20 +00:00
Tobias Henkel
e0e3f3b81c
Optimize repos for size when preparing for nodecache
We currently run 'git gc' on repos before creating the tarball for the
node cache. On busy repos this is not enough to cut down the size of
the repo. With more aggressive pruning and packing one of our repos in
the cache got down from 6GB to 1.8GB.

Change-Id: I7ef428c25fde713efabd966d59b5bd97ec248d7e
2020-03-02 09:54:56 +01:00
Zuul
3cbce518ad Merge "install-javascript-packages: add tox_constraints_file" 2020-02-26 05:40:28 +00:00
Zuul
5ac43d06e1 Merge "Fix install-docker on centos-8" 2020-02-25 17:52:01 +00:00
Zuul
fe15bf4934 Merge "Fix cleanup of symlink fixtures" 2020-02-25 16:46:09 +00:00
Sorin Sbarnea
299a654806 Fix install-docker on centos-8
Implements workaround for the missing --nobest option in Ansible
package module in order to succeed installing docker-ce.

Change-Id: I96e133dc5c59b9c811ff69df7651adadfcdf3a97
2020-02-25 10:56:37 +00:00
Jeremy Stanley
f607fd9a24 Precreate AFS target directory in upload
This works around missing parent directories in AFS, since rsync
will create the target directory but not its parent directories. In
cases where the parent directory does not yet exist, it's nice to
create it automatically first, if we can.

Change-Id: Ia136ea3a416d6085d1f6e277b4c071573c5660e4
2020-02-24 19:40:04 +00:00
Zuul
f05f26b1ca Merge "Use CentOS8 dependencies repo to install openvswitch" 2020-02-24 18:40:56 +00:00