1069 Commits

Author SHA1 Message Date
Clark Boylan
40d32838d5 Escape special filename characters in urls
The href url paths need to have quoted filenames to handle cases where
filenames have special characters like : in them.

Change-Id: I0bc0de8d27c6e45c4a6b8841985b8265f0219df2
2019-09-30 14:12:18 -07:00
Clark Boylan
46b7b6e1c9 Use import_role on persistent-firewall
Previously to persist the filewall we were including the
persistent-firewall role. This seems to occasionally break because the
second invocation of the role (on multinode jobs after setting up the
multinode bridge) fails with an RC of -13 when listing ipv4 iptables
roles. Then when we try to write them to disk the variable is empty.

One thought is that dynamically loading the role multiple times may be
confusing ansible. Use import_role to statically load the role instead
and see if this helps.

Change-Id: I2458f8eb4c2e4638336fa14e436e13b5a2263cce
2019-09-30 10:39:02 -07:00
Colleen Murphy
18285584f1 Use iptables for openSUSE
In openSUSE Tumbleweed, the SuSEfirewall2 package was removed in favor
of firewalld[1]. This commit updates the iptables persistance tasks to
avoid using SuSEfirewall2 and instead use rc.local to restore saved
rules upon restart, and undefines the iptables_service variable for SUSE
since there is no service to restart any more. See the related change
for image builds[2].

[1] https://lists.opensuse.org/opensuse-factory/2019-01/msg00490.html
[2] https://review.opendev.org/683236

Change-Id: I0f8d74dd00df192c20b96a9368b964839c306171
2019-09-27 15:45:01 -07:00
Zuul
01f6c26e29 Merge "Remove invalid argument from format_exc() calls" 2019-09-24 08:29:42 +00:00
Zuul
d5edece13c Merge "Add more languages for build-releasenotes" 2019-09-24 02:43:39 +00:00
Ian Wienand
20bffbcfc0 Remove invalid argument from format_exc() calls
The argument here is an integer "limit", not the exception.

I think that we only notice this on Python 3 because of exception
chaining.  It causes a real failure though because the exception
handler that is meant to fall into "pass" raises another exception
when ipv6 doesn't work.

Change-Id: I0908a0a3dbb2356caabbffd062379751a0b61c41
2019-09-24 12:15:28 +10:00
Andreas Jaeger
0f42cbb88b Add more languages for build-releasenotes
Update list of languages since we have some more translations.

Change-Id: Ib9636132549673908660e47ad5e33ad3d9386c0f
2019-09-23 14:01:05 +02:00
Andreas Jaeger
4dbd165ef0 Fix tox_install_sibling_packages.py for py3
Under Python3, subprocess.check_output returns binary data,
convert to utf-8 so that it runs under both Python2 and 3.
Using decode works with both Py2 and Py3.

Note that in other places, we already convert the output of check_output
with decode, this change follows that pattern.

Change-Id: I727a2368233473f57978ba24947f6d861b02f7da
2019-09-22 10:44:23 +02:00
Paul Belanger
550e5da4b4 Allow upload-logs to toggle compression of console logs
We should make it easy for users to view console logs by default.
Today, we compress and upload logs and by default apache / nginx will
not properly display them as plain text.  This commit changes the
default to not compress, but allows more advanced users to enable this
logic.  As mostly likley it also means additional configuration for
your web server.

Change-Id: Ic446db4f85e2098db8fa4568f8c5140ba564e931
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2019-09-20 17:03:58 +00:00
James E. Blair
e35c529bac Retry pushes to dockerhub
To deal with things like 502 bad gateway errors.

Change-Id: Iaa745394baafcdfedc188f8503b7c7fc9ee92f5b
2019-09-20 09:50:44 -07:00
Zuul
8dd07b8aa5 Merge "Clean non-bare remote repos" 2019-09-17 17:47:02 +00:00
Zuul
cec475c082 Merge "Add a netconsole role" 2019-09-17 08:38:16 +00:00
Zuul
42a5fabffd Merge "Retry container gets in upload-logs-swift" 2019-09-16 17:09:57 +00:00
Zuul
cf69fc08a7 Merge "Add tests for manifest generation for missing files" 2019-09-16 11:56:22 +00:00
Clark Boylan
287880a63a Retry container gets in upload-logs-swift
We have been getting HTTP 401 unauthorized errors at the rate of about
once a day when trying to get containers in the swift logs role.
Manually getting and posting objects to the same container after the
jobs fail seems to work so this appears to be a transient failure.

Attempt to workaround this by retrying the container get calls several
times.

Change-Id: Ia7395ffa0b120fbbecde0c9bb6e8583078167143
2019-09-13 09:17:27 -07:00
Mohammed Naser
f3615abc01 Add tests for manifest generation for missing files
This is a patch that adds test to make sure that we handle FileNotFound
exceptions during walks.

Change-Id: I6d3513ddb4a705a28043065b1398b75018ee3115
2019-09-12 19:39:09 +02:00
Clark Boylan
1aacb23399 Log swift upload tracebacks with ansible
The old code will log swift upload tracebacks via logging.exception()
which doesn't seem to bubble back up into ansible's logging. We address
this by using traceback.format_exc() to format an exception traceback
string which we pass to ansible's module.fail_json().

Change-Id: I524bd0d5a9529011cffb6d09866b22b2c97fab7d
2019-09-12 10:37:44 -07:00
Bogdan Dobrelya
db6677a867 Fix evaluating nodepool_ip and switch_ip facts
In I32fb17bae98f13f735da4d5b9a6a01e948f21678, the evaluated facts
should also fallback to public_ipv4, when private_ipv4 is "empty-like",
e.g. contains no valid IP but something like '\n'.

It also restores the lost switch_private_ip fact just in case.

Change-Id: I139272746129213994f298a4a9178b4441d439af
Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
2019-09-10 17:54:17 +02:00
Tristan de Cacqueray
517bc81404 Add prepare-workspace-openshift role
Change-Id: I41ce5a1ec5ca8b1b101af77169e31fc4a9131ae9
2019-09-09 13:44:27 +00:00
Ian Wienand
7f41a50ac0 Add a netconsole role
This role sets up a host to report via netconsole.  It is a port of
old devstack-gate functionality from circa
Iebc8e1812d1441aba7c18d3e7c982b620b5198a0.

Change-Id: I37c26fdbcdf61a55fae4cbee3eb61a4bc45ca628
2019-09-09 18:14:00 +10:00
Albin Vass
110dcaacf9 Clean non-bare remote repos
In case of reused workspaces on static nodes remote
non-bare repos needs to be cleaned up to make sure
that any untracked files from any earlier jobs are removed.

Change-Id: I00dda298f499b241a224c19657ebbb8a9015eb4d
2019-09-06 07:16:05 -07:00
Clark Boylan
fd2b753088 Add build shard log path docs to upload-logs(-swift)
The upload logs roles can make use of the build logs sharding via their
calls into set-zuul-log-path-fact. Document this.

Change-Id: Ia57fc6a47227657f9fac70074e453cf8d4c16c26
2019-09-05 15:27:18 +00:00
Zuul
ed1c6867e1 Merge "Only use RHEL8 deps repo on Red Hat systems newer than 7" 2019-09-04 21:57:14 +00:00
Zuul
c19a6a2cf5 Merge "Add option for object store friendly log paths" 2019-09-04 20:15:10 +00:00
Clark Boylan
b62efba8a4 Add option for object store friendly log paths
For logs stored in object storage services we want to be able to shard
into different containers. This improves scalability of the object
stores. To do this consistently we prefix all log paths with the first 3
characters of the build uuid. This way we get container names like
log_123, log_abc, and so on for a total of 4096 containers.

This behavior is off by default because users of filesystems stores
without a zuul dashboard may still want periodic/ to be filed into a top
level dir for browseability.

Change-Id: I8e72a6e587edcbdf89b793cad2d7c96c535601e7
2019-09-04 09:52:38 -07:00
Zuul
8496717a05 Merge "Document globally unique container name requirement" 2019-09-04 15:50:36 +00:00
Clark Boylan
e35fe87488 Document globally unique container name requirement
Some Swift API implementations (ceph) require globally unique container
names. Document how zuul users can deal with this by setting a unique
value for the zuul_log_container var when using the upload-logs-swift
role.

Change-Id: Ib9c72cf4a08412615c8a45f3eab8d3eb37c61138
2019-09-03 08:45:13 -07:00
Andreas Jaeger
0ca632b19d Switch PDF file name to doc-PROJECT.pdf
Further work on the PDF generation showed that many projects have
project logos as svg files with the name PROJECT.svg, those get
converted to PROJECT.pdf and collide with the default name used here.

Change the default to "doc-PROJECT.pdf" to have a unique name.

This is a change in the default but we only added this 11 days ago, so
I hope it's fine to change.

Change-Id: I4f2224633fd4edbc3121af53d0202796cf8a0a60
2019-09-03 14:40:39 +02:00
Ronelle Landy
e1ebeefecb Only use RHEL8 deps repo on Red Hat systems newer than 7
cecf9e902c
broke Openstack jobs running on Red Hat 7.

This review includes the ansible_distribution_major_version
when deciding which repos to include for openvswitch.

Change-Id: I6ec32e2913843adb0778a63133296bb26a0b5e6e
2019-08-30 15:11:01 -04:00
Dmitriy Rabotyagov
fa2cbeaae2 Fix handling of dangling symlink
There may be broken symlinks within the log directories, those fail with
an error when os.stat() is executed on them. So if/else is replaced with
try/except while TypeError used to catch when self.full_path is None

Change-Id: Iffee97760a39fa4f7760bd67fb63c5f0905064bd
2019-08-26 22:28:14 +03:00
Monty Taylor
8e3fec5388 Update keystoneauth exception name
The execption is HttpException

Change-Id: I3783b4faaef2ee4bc045a0ad3dc9ff671cc1290d
2019-08-26 16:21:18 +02:00
Jens Harbott
dd40f5ed9f Fix handling of dangling symlink on manifest generation
There may be broken symlinks within the log directories, those fail with
an error when os.stat() is executed on them. Let's just skip those.

Change-Id: I3e6982c53a08f57ac0e592b8a0041bbb39812d1f
2019-08-26 13:57:03 +00:00
Andreas Jaeger
c74b03649a Switch PDF fetching to known files
Some repos produce intermediate PDF files, for example from svg files,
and thus we have multiple PDF files.

Change the PDF fetching to a list of pdf_files which can be supplied,
the default is the name of the repos with ".pdf" attached, like
"octavia.pdf".

https://review.opendev.org/#/c/667249/3 illustrates the problem.

Change-Id: I5d3b6d6c2884ba66bdd35639b023d6d76f64ac01
2019-08-24 12:24:07 +02:00
Andreas Jaeger
601711dfa3 Handle sphinx PDF files
This enhances fetch-sphinx-tarball to fetch PDF files as well if
they are published

For now, it collects a single PDF file since sphinx only generates one.
The name of the PDF file is not known in advance.

The publishing is done with https://review.opendev.org/678142.
This will then be used by https://review.opendev.org/664555.

Change-Id: I872ab1f696495dc40cb845e0eee5f6f0ffe892d8
2019-08-23 08:30:05 +02:00
Clark Boylan
5c089bf032 Allow for overriding dns resolvers in install-kubernetes
By default kubernetes wants to use the local resolvers on the host
system. But in many cases the local resolver may be 127.0.0.1 which is a
different localhost on the host system then in the container network
namespaces. To address this disconnect you can supply a different
resolv.conf with a list of nameservers to use instead. Add support for
this.

Note that the test currently only uses ipv4 resolvers because by default
k8s has no support for ipv6.

Change-Id: I3c0d7d88613e2c9112e809f036aef3dfeaf7ab72
2019-08-21 09:36:27 -07:00
Ian Wienand
3e758a8790 upload-logs-swift: fix keystoneauth1 exceptions
Import keystoneauth1.exceptions to access the exceptions.  HttpError
also lives under "exceptions.http.", so update that reference.

Change-Id: I4afe8c9fc8239a31d62a2a1d09794211b5066472
2019-08-21 09:55:16 +10:00
Zuul
60e7542875 Merge "Remove sphinx_output_dir" 2019-08-16 17:17:05 +00:00
Zuul
fef6fa4321 Merge "install-openshift: bump version to 3.11.0" 2019-08-16 14:32:51 +00:00
Andreas Jaeger
56b9c68ba2 Remove sphinx_output_dir
this is a partial revert of Ifd270cbc2d4bd42418b89a3b3061748ce537ae42,
we do not need sphinx_output_dir anymore, the single use that needed it
has been changed.

Change-Id: I95543b1a56c04dbfb8591612e4c48be0d8631633
2019-08-16 15:39:59 +02:00
Tristan Cacqueray
7e7243fe15 install-openshift: bump version to 3.11.0
This change install the latest 3.x version of openshift.

Change-Id: I941f8831a9ecdb930b7a0edd85f7f15a3b8d57e6
2019-08-15 16:54:26 +00:00
Zuul
7f4b3a6486 Merge "Retry more operations" 2019-08-15 14:44:11 +00:00
Zuul
eb1568c9e4 Merge "Log errors better in case of unknown REST errors" 2019-08-15 14:39:13 +00:00
James E. Blair
8595026f46 Retry more operations
This adds a generic retry handler that takes a callable, and uses
that not only for the exsting retries around the POST call, but
also the actions when creating the container.

Change-Id: I910b8e886f107d4fe38a9334ba836f010f92557c
2019-08-14 14:42:38 -07:00
Monty Taylor
e5897bdd44 Log errors better in case of unknown REST errors
If we get an unexpected exception, it's helpful to know the
cloud and region involved. It's also nice to return that information
for maybe better readability.

Change-Id: I1c589744103512d981e64e1a3f9506d40e1bf4cf
2019-08-14 14:22:01 -07:00
Andreas Jaeger
22a17fa19b Revert "Partial sync fetch-sphinx-tarball with fetch-sphinx-output"
We don't need this here - let's change openstack-manuals instead.

This reverts commit 75ae975235305b7a832dd0dc7c8d4ce540df4794.

Change-Id: I9611950a391823efd2f7d2187da0992f00e0e454
2019-08-14 20:13:23 +00:00
Andreas Jaeger
75ae975235 Partial sync fetch-sphinx-tarball with fetch-sphinx-output
Add and use variable sphinx_output_dir as it's used in
fetch-sphinx-output.

Change-Id: I3fa7b1982463816d16ca6515edffb9e73b8cdbe5
2019-08-14 19:43:36 +02:00
James E. Blair
bf8442a895 Return preview artifact in fetch-sphinx-output
This adds an extra variable to the role which can be used to
better control the URL which is returned as the artifact.

Change-Id: Ifd270cbc2d4bd42418b89a3b3061748ce537ae42
2019-08-14 07:58:38 -07:00
James E. Blair
ea00b6aa5a Use human-readable names for artifact returns
This will cause links to appear on the build page with text like
"Docs preview site".

Change-Id: I65f8990b65607e72190a871409c3e31014ce86df
2019-08-12 07:13:27 -07:00
James E. Blair
ed0c36250c Remove download_artifact_name parameter
This parameter was deprecated.  Now it should be removed so that
the name field can be freed up to be a human-readable name.

Change-Id: I0ace733e037ebeffcaf516332e7c5b48b3c7a1a3
2019-08-12 07:10:52 -07:00
Zuul
634fa42920 Merge "Don't install centos repos on RHEL" 2019-08-09 08:31:22 +00:00