2711 Commits

Author SHA1 Message Date
Clark Boylan
b007e86a0f Support new style mirror_info in use-docker-mirror
This adds new style mirror_info handling to use-docker-mirror to give us
greater control over whether or not docker hub should be mirrored. We
ignore old style configuration if new style is present which gives us
this control. Otherwise we fallback to the old behavior.

We also update the ensure-docker test jobs to be triggered by updates to
the use-docker-mirror roles as ensure-docker includes this role. We
should get decent functional testing coverage this way.

Change-Id: Ia1b216a6dd68bcafbe599777037c5d7b1b3e8201
2024-11-19 14:56:56 -08:00
Clark Boylan
7682f2fb5b Cap the ansible version used by ansible-lint
the openvswitch.openvswitch collection is removed from Ansible packages
starting with Ansible 11. This causes ansible-lint to correctly not find
the openvswitch_bridge module when ansible-lint runs with Ansible 11.
Workaround this by capping Ansible used by ansible-lint to <10 and leave
a note about the module going away where we use it.

Change-Id: Id2d4e4f59c7d7e595c5458bc8717146c2326c573
2024-11-19 14:27:44 -08:00
Zuul
d2d25cd9ec Merge "Switch logo color in docs pages to dark blue" 2024-11-13 00:37:31 +00:00
Jeremy Stanley
0fef0d461e Switch logo color in docs pages to dark blue
The trademark for the logo, as filed, is specified as dark blue.
That logo needs to be displayed in a user guide or manual or
alongside a direct download of the software in order to demonstrate
continued use of the mark, and the foundation's trademark lawyers
have expressed concern that a white version is insufficient (but
they seem to be okay with the current background color as long as
the lines of the logo are colored similar to the version on file).

This is a copy of the equivalent change from the zuul repository.

Co-Authored-By: James E. Blair <jim@acmegating.com>
Depends-On: https://review.opendev.org/934443
Change-Id: I2de26048c3a4cb8cb6b67bf786b526963c6ec04b
2024-11-12 19:02:54 +00:00
Slawek Kaplonski
f2bc6bb699
Use "curl" to trigger rtd.org webhook with http basic auth
For some reason (unknown really for us) triggering webhook with http
basic auth using Ansible's uri module started recently failing when it
is run on some operating systems, like e.g. Ubuntu Noble.

Let's switch to use curl command directly to trigger that webhook
instead.

Change-Id: Idbf643ea27220504ac9e37eaf9f18930d2fc08ab
2024-11-08 22:19:39 +11:00
Zuul
8deeecf821 Merge "Include filesystem stats in dstat" 2024-10-22 23:21:16 +00:00
Zuul
05506c0ffd Merge "Add other nodes to buildx builder" 2024-10-04 23:00:21 +00:00
Zuul
617739c61f Merge "Print instance type in emit-job-header role" 2024-10-04 22:45:23 +00:00
Mohammed Naser
bdae8c9433 Add other nodes to buildx builder
If you need to run native arm64 builds, you can take advantage
of this change which will rely on the remote builders in order
to build things natively giving a significant speed up in
container build time.

Change-Id: I962bb2357a2c458d5e72b334b4fe36b55b034864
2024-09-30 18:58:21 -04:00
Mohammed Naser
655e88b7ba Only update qemu-static container settings on x86_64
The image only support x86_64 so if you're running
this role against an arm64 node, this breaks.

Change-Id: Ied74ef9e4337346910c817ea5f3540af9ccfdf0b
2024-09-30 13:46:14 -04:00
Clark Boylan
cb0b00ed87 Replace blockdiag/seqdiag with graphviz
The blockdiag/seqdiag set of tools and their sphinx extensions are no
longer maintained. This hasn't been a huge issue until we started
running jobs on Python3.12 as we need to run an older version of Pillow
to support these tools and that needs special libs to build wheels on
python3.12.

Rather than continue to try and make old unmaintained tools work we
switch to graphviz which is maintained and has support built into
sphinx. This does require us to install graphviz as a system dep but
that seems like a reasonable tradeoff for using supported tooling.

The resulting graph specifications are also slightly more verbose.

Co-Authored-By: James E. Blair <jim@acmegating.com>
Change-Id: I2d1e4c3d648723402aae2d87fb3233f4418d5003
2024-09-25 11:18:04 -07:00
James E. Blair
f618a471fc Include filesystem stats in dstat
This counts the open file handles and inodes.  This may be useful
(after establishing a baseline) for evaluating ulimit errors.

Change-Id: I6d5c67d7c5c03d4aa7cd88b2238163cc729d9782
2024-09-25 09:53:08 -07:00
Zuul
e971613316 Merge "Cleanup remaining Ansible lint warnings" 2024-09-23 21:29:50 +00:00
Zuul
ebbed9d385 Merge "Install doc bindep profile in zuul-jobs-test-tox" 2024-09-23 21:22:04 +00:00
Zuul
2dd43ed7f1 Merge "Validate that node_version is set" 2024-09-19 20:31:36 +00:00
Zuul
7e54b91d61 Merge "Modernize ensure-nodejs" 2024-09-19 20:23:13 +00:00
Monty Taylor
e188ce71ca Validate that node_version is set
We removed the default value, because having a default value actually
makes no sense at all. To be helpful for any transitions, add a runtime
check that the variable is set.

Also, while we're at it, update the docs to indicate that the parameter
is required.

Change-Id: I1e18ea51d9d56561608ff241d71b63965c4f78bd
2024-09-19 13:00:26 -07:00
Clark Boylan
8d4f01b74a Cleanup remaining Ansible lint warnings
Make it easier for people to see lint errors by cleaning up the
remaining lint warnings.

Change-Id: I2b614b19f5dccd1aa2ad568ff31acabc9b87c383
2024-09-18 16:46:00 -07:00
Clark Boylan
3f27b0cd46 Install doc bindep profile in zuul-jobs-test-tox
This job that tests the zuul-jobs tox role runs various tox targets
including the docs target. This means we need to install dependencies
for doc building. On Ubuntu Noble this include libjpeg-dev for Pillow
wheel building and we fail without this profile installed.

We keep the default profiles of compile and test because we also run
other targets that likely depend on these profiles.

Change-Id: Ifa3495488f35b1fbe4fc665c4d0ac5ed8adb33aa
2024-09-18 16:46:00 -07:00
Clark Boylan
efa55f881d Modernize ensure-nodejs
The ensure-nodejs role defaults to install nodejs 6 which produces this
error currently:

  Failed to update apt cache: W:The repository
  'https://deb.nodesource.com/node_6.x noble Release' does not have a
  Release file., W:Data from such a repository can't be authenticated
  and is therefore potentially dangerous to use.

We need to make a few changes to bring this ensure-nodejs role up to
modern expectations for nodesource usage. First we drop the default
nodejs version from ensure-nodejs. Everyone is already setting this
value to make this role work or they are broken and will need to change
something anyway. This gets us off of the nodejs update treadmill in
this role.

Then with nodejs 16 and newer there is a new gpg key and no deb-src
packages so we need to change the apt configuration if using 16 and
newer. We make these changes to match the corresponding setup_16.x etc
scripts from nodesource.

Change-Id: I0d5c93e4fbcee0be2cc477bf9f625e419a2b9bd1
2024-09-18 16:46:00 -07:00
Zuul
5b4e7f7ac5 Merge "Bump the default ensure-kubernetes microk8s version to 1.31/stable" 2024-09-18 23:29:29 +00:00
James E. Blair
8a7dd50b6b Ignore some recent ansible-list warnings
We don't need to name every play; in the Zuul context, they are
usually pretty self-evident.  It might be nice, but it doesn't
seem necessary to require it.

We really don't need to care about using upper or lower case.

The key-order seems very arbitrary and counterproductive to make
all our developers memorize someone else's arbitrary preference
for ordering.

Change-Id: I49455b6946d5d9b6bffd58420fea586ecc6c5f80
2024-09-18 09:16:37 -07:00
Clark Boylan
b16fae463e Bump the default ensure-kubernetes microk8s version to 1.31/stable
Previously we pinned to 1.28/stable due to a bug that prevented
1.29/stable from working. Now we've hit a new issue with 1.28/stable on
bookworm. The fix for that appears to simply be to upgrade to
1.31/stable so we do so here. More details can be found in this GitHub
issue:

  https://github.com/canonical/microk8s/issues/4361

The new version appears to return from the snap installation before the
k8s installation is fully ready to deal with add-on installation. This
occasionally produces errors like:

  subprocess.CalledProcessError:
  Command '('/snap/microk8s/7178/microk8s-kubectl.wrapper', 'get',
            'all,ingress', '--all-namespaces')'
  returned non-zero exit status 1.

Work around that with `microk8s status --wait-ready` to ensure that k8s
is up before adding addons.

While we are at it we also update the collect-kubernetes-logs role to
collect microk8s inspect output as that would've enabled us to debug the
above issue without holding nodes. We also update test jobs to trigger
when the collect-kubernetes-logs and collect-container-logs roles are
updated to ensure we get coverage from those jobs when updating these
roles.

Change-Id: I60022ec6468c2cadd723a71bbc583f20096b27dc
2024-09-17 15:04:05 -07:00
James E. Blair
819e0194a0 Fix build-diskimage playbook paths
Change-Id: I6d8cb77bca3bb442300babd21fe635d76833ce3e
2024-09-12 09:09:42 -07:00
James E. Blair
4e1e155638 Allow dib_elements key to be a nested list
It's highly likely that folks may want to use YAML anchors to
build up list of DIB elements.  To aid in that, allow the value
to be a list of lists and automatically flatton it.

Change-Id: I55b9cb16951b51da32f99ca5858b75217951b279
2024-09-12 07:54:38 -07:00
Dong Zhang
3e3e5e23dc Print instance type in emit-job-header role
It would be useful especially when ec2 fleet api is configured,
and the instance type is unknown in advance.

Change-Id: Ibcdade5cfffd13fddd95e797c60c5327bb34fdb6
2024-09-10 15:16:19 +02:00
James E. Blair
7dfb7d0eeb Synchronize test-prepare-workspace-git to prepare-workspace-git
Change-Id: I9763ac89097f8580fa2abf14e759fe088cc9a609
2024-08-28 09:56:02 -07:00
James E. Blair
d6ae964f47 Avoid fstrings in test-prepare-workspace-git
Fstrings are not supported in python3.5 which is in use on Xenial.
We don't claim to support Xenial, but this is an easy regression
to avoid.

Also, add test jobs for this role so that we get feedback before
copying it to the prod roles.

Also, add a xenial test job to exercise it since we still have
Xenial nodes available.

Change-Id: Ifc773aa688adb1a01cfe691b3bdca0b3086658cd
2024-08-28 09:55:55 -07:00
Zuul
5209c8add4 Merge "Add a role to convert diskimages between formats" 2024-08-27 17:00:39 +00:00
Zuul
81942240d0 Merge "Add a diskimage-builder job" 2024-08-27 16:57:46 +00:00
Zuul
f28d8f70d4 Merge "Add build_diskimage_environment role variable" 2024-08-27 16:57:44 +00:00
Zuul
1e734ead42 Merge "Add build-diskimage role" 2024-08-27 16:57:42 +00:00
Zuul
adbb174801 Merge "Add ensure-dib role" 2024-08-27 16:40:36 +00:00
Zuul
264868c384 Merge "Synchronize test-prepare-workspace-git to prepare-workspace-git" 2024-08-27 16:29:00 +00:00
Simon Westphahl
5c10b708f0 Add a role to convert diskimages between formats
This adds a role convert-diskimage which uses the qemu-img tool to
convert diskimages from one format to another. Currently supported image
formats are raw and qcow2.

Change-Id: I4770af04c37f39e0cce23d5dd59ead744bed7d74
2024-08-27 08:59:53 -07:00
Zuul
8cf3466a9b Merge "Update ensure-kubernetes with podman support" 2024-08-26 17:15:56 +00:00
Zuul
1d13156a50 Merge "Fix k8s-crio buildset registry test" 2024-08-26 17:07:12 +00:00
James E. Blair
6dab604706
Add a diskimage-builder job
This uses the new roles.

Change-Id: I047f0ab0eb784b1d3dd9384a4e96e2119d5b2580
2024-08-23 13:37:38 +02:00
James E. Blair
c5c2eae9c1
Add build_diskimage_environment role variable
This adds a role variable to configure the diskimage-builder environment.
This allows users a choice of using the Ansible "environment" argument,
or using a variable.  The variable may be particularly useful since it
allows full configuration of the role from a Zuul job definition.

Change-Id: I68542f13454b4f2e2e9bb8d356feefddba23d8f2
2024-08-23 13:37:37 +02:00
Simon Westphahl
dded8d0853
Add build-diskimage role
Role in order to build a diskimage in a Zuul job.

Change-Id: I18756445d41d51b05b3dbb334e43a94637253321
2024-08-23 13:31:27 +02:00
Jan Gutter
83bfd5b917
Update ensure-kubernetes with podman support
* This adds some extra options to the ensure-kubernetes role:
  * podman + cri-o can now be used for testing
  * This mode seems to be slightly more supported than the
    current profiles.
* The location for minikube install can be moved.
* The use-buildset-registry role needed slight updates in order
  to populate the kubernetes registry config early.

Change-Id: Ia578f1e00432eec5d81304f70db649e420786a02
2024-08-22 20:50:39 +01:00
Jan Gutter
e637029091
Fix k8s-crio buildset registry test
* It looks like zuul-jobs-test-registry-buildset-registry-k8s-crio
  is busted with Ubuntu Jammy + cri-o installed from kubic, with
  errors like https://github.com/cri-o/ocicni/issues/77
  (also, kubic has been wound down and cri-o has been spun off)
* cri-o in Noble uninstalls docker-ce, in a follow-up we should
  clean that up and switch to a pure podman profile
* This minikube configuration is not supported, but it seems that
  upstream cri-o might have made some fixes that makes it work

* Update the job to use Ubuntu Noble instead of Jammy
* Update ensure-podman for Ubuntu Noble
  (podman is now part of the Ubuntu distro)
* Update the cri-o install in ensure-minikube for Ubuntu Noble and later
  (cri-o is now part of k8s)

Other miscellaneous fixes and workarounds:

* k8s.gcr.io is being sunsetted, updated the test image:
  https://kubernetes.io/blog/2023/03/10/image-registry-redirect/
* Relaxed the security to run minikube from /tmp (in future,
  we should set the default to /usr/local/bin)
* Updated the microk8s check-distro task for Noble

Change-Id: I3b0cbac5c72c31577797ba294de8b8c025f8c2c3
2024-08-22 20:50:31 +01:00
Simon Westphahl
e749223328
Add ensure-dib role
Role installs the diskimage-builder in a virtualenv.

Change-Id: I0801daa6d5b8039bfbdefb7357942b1c5a58732f
2024-08-19 09:13:07 +02:00
James E. Blair
e3d891d16d Synchronize test-prepare-workspace-git to prepare-workspace-git
This updates prepare-workspace-git to the new module-based system.

Change-Id: I99f1673775c161f1f8b5d95ce5daee3363571e3b
2024-08-02 11:47:49 -07:00
James E. Blair
f1714ea75b Update test-prepare-workspace-git to use a module
This updates test-prepare-workspace-git to use a new Ansible module
for its work.  This module supports each of the three main tasks
with a single Python invocation for all projects, rather than
using Ansible to loop over them.

Within the python invocation, a ThreadPoolExecutor with 10 workers
is used to execute the setup processes with increased parallelism.

This should greatly improve the workspace sync speed for jobs with
large numbers of repos.

A simple local test with the 16 Zuul project repos reduces the
workspace-prep time to less than 50% of the current time.

This removes the mirror_workspace_quiet role variable, since detailed
information about the repo state can now be found in the repo state
JSON file.

Otherwise, the actual git commands used to prepare the repos should
be identical.

Change-Id: Ib4b6bb379fe656ac9109b8e6073eff8c28c7eaee
2024-08-02 11:47:37 -07:00
Lukas Kranz
d8ec17cab0 Remove get_md5 parameter from stat module.
The get_md5 parameter was removed with ansible 9.
https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_9.html#id44

If it is being used the following error appears:
"Unsupported parameters for (stat) module: get_md5..."

Unrelated, but also blocking testing/merging of this change, the
Ansible version specs for older python versions is loosened
to allow installing older versions of Ansible on test nodes (like
focal) that have older pythons that are unsupported by newer Ansible.

Change-Id: I99dd4f16fde659d84eb3dfa191557b3d9508b0fb
2024-08-01 07:12:17 -07:00
Zuul
bd1d95ccdd Merge "Make prepare-workspace-git behavior more consistent" 2024-07-24 20:04:29 +00:00
e7d31aa59d Fix wheel_mirror for Debian
The default wheel_mirror(including major.minor) no longer works for Debian,
Fix it by using just major version like debian-11-x86_64. Similar was
fixed in [1] but missed fixing configure-mirrors.

[1] https://review.opendev.org/c/openstack/project-config/+/897545

Change-Id: I4194f18a06527d8af8922f3baf8766a7148e23fa
2024-07-24 10:31:19 +05:30
James E. Blair
51fe46231f Make prepare-workspace-git behavior more consistent
This runs the same commands on the git repo regardless of whether
it was cloned or if the role found it there already.  Since the
purpose of the role is to mirror the workspace repos from the
executor to the remote node, this will produce more consistent
behavior.

Note that anyone somehow relying on, say, the origin being set
outside of this role may encounter a behavior change.  It is expected
that anyone manipulating a repo that is also managed by this role
would perform those manipulations idempotently after running this
role.

Change-Id: I428bf2980a526919d5b154c585943be92d4c1cfa
2024-07-23 17:19:26 -07:00
James E. Blair
78276a58c5 Fix prepare-workspace-git operating on existing repos
Commit 8003cdc76ca177061b1a462d07efaff83e18491b causes problems
if the remote repo already exists (e.g., the worker node is static
and not ephemeral) because it unconditionally removes settings
which are only conditionally set if the workspace is newly cloned.

Fix that by remove the Ansible "creates" check from the task and
executing the set calls unconditionally (but also, recreate the
functionality of the create check for the cloning part of the
task, which is what we're really trying to avoid).

This will run a few extra command such as clearing the bare flag
and also resetting the origin remote.  That should be fine in
this role since we expect it to do whatever it takes to make the
remote repo the same as the local one.

Also, resync test-prepare-workspace-git.

Change-Id: Ife12992df9ce2b0ce199b3980a4baa255cb0f28a
2024-07-23 17:18:03 -07:00