46 Commits

Author SHA1 Message Date
Zuul
55db214278 Merge "Replace debian:testing with quay.io/opendevmirror/httpd:alpine" 2025-02-21 22:42:54 +00:00
Clark Boylan
3ffa0a1e34 Replace debian:testing with quay.io/opendevmirror/httpd:alpine
We have several tests that were using debian:testing from docker hub as
a base image to deploy some content that would validate execution of
container runtimes. Docker hub has some pretty strict rate limits in
place these days so we'd like to use an image on quay.io instead.
The opendevmirror org is already mirroring the httpd:alpine image there
which is a smal relatively simple image that we can use for this
purpose.

Note we switch from debian with bash to alpine with a busybox sh. But
the tools we rely on (touch, echo, sleep) all appear to be present.

Change-Id: I9bb5db416e3b9601c67de1c053162fd30a977bbd
2025-02-17 12:06:13 -08:00
Clark Boylan
f793a76e33 Use registry:2 image mirrored to quay.io
In our container job roles and tests we sometimes need to set up a
registry. In those caes we've typically been using registry:2 from
docker.io. Docker has put in place some pretty strict rate limits so
we've mirrored the image to quay.io as an alternative source location.
Fetch the image from that location.

Change-Id: Idccaa350bd2951d5b56314ea4f19bdcb9c13d1a1
2025-02-17 09:58:07 -08:00
James E. Blair
4077fb8e8f Add mirror-container-images role and job
This adds a role (and job) to mirror container images from one
registry to another.

Also, disable the name[template] ansible-lint check because it
greatly reduces the utility of including templates in task names.

Change-Id: Id01295c51b67ffb7e98637c6cdcc4e7a14c92b22
2024-12-02 09:47:12 -08: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
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
Radosław Piliszek
bae449c42c Reenable buildset-registry jobs
As a followup to I4d05f9b187f9e40c3dcb2597e08c5bb50c261b17

We switch buildset-registry jobs to debian bookworm which has new enough
golang to build the latest skopeo version. Latest skopeo is used in
order to get api version negotiation behavior which is necessary for
talking to modern docker (version 25 or newer).

Change-Id: Ie673ef6724b0a40e3cfb2ba83e90d566e1f1837c
Co-Authored-By: Clark Boylan <cboylan@sapwetik.org>
2024-03-21 21:09:01 +00:00
James E. Blair
509880073e Remove command.warn usage
This is no longer present in Ansible 9.

Removing these upsets ansible-lint, so those errors are ignored.

The base roles job has bitrotted on centos-7 and bionic due to
a bad voluptuous release used in an stestr test.  That is fixed in
this change as well.

Change-Id: I67886d5ad82ab590979f82bd102d6f974b9d4421
2024-02-14 15:17:52 -08:00
Ian Wienand
0ad671bfbf
test-registry: split docker and container paths
This ended up calling into push-to-intermediate-registry with both
docker_images *and* container_images variable set.

This hid from testing that push-to-intermeidate-registry was not
working with only the container_images variable set.

Split these calls up so we don't have both variables defined.

Change-Id: If84b039852f2afc4df66c98e64fcce6f30f51246
2023-03-24 12:19:47 +11:00
Ian Wienand
977aaf6f59
ansible-lint: use pipefail
Use pipefail in some shell commands.  In this case I don't think we
can really be fooled, but not a bad idea to fail if the first command
errors.

Change-Id: I25750c4edfe815af9e9d9ee47639b315e7133aa2
2023-02-03 15:36:25 +11:00
Ian Wienand
7a66a26b77
ansible-lint: fix a bunch of command-instead-of-shell errors
These all trigger command-instead-of-shell for ansible-lint 6.12.0.
It seems a few were ignored with warnings with
I4e415cbd34f0f4cb15857051bf95458e0316de86.

I don't see why these can't be command: for consistency

Change-Id: Ib0f590b461d2a5a7d9bb8bdddcbbfb2230cc3d1c
2023-02-03 15:06:03 +11:00
Ian Wienand
818521ee77
zuul-jobs-test-registry-docker-* : update to jammy nodes
This is currently failing as buildx is incomaptible with the old
version of skopeo.

Switch to jammy nodes and install an updated skopeo for testing.

Change-Id: I40b9134200bcbbbe469acab3aedbea2eaf4c0f14
2023-02-03 15:05:17 +11:00
Ian Wienand
65aa2bdc1f use-buildset-registry: support microk8s
This enables microk8s/containerd to pull through the intermediate zuul
registry.  This is tested with the new
zuul-jobs-test-registry-buildset-registry-k8s-microk8s job.

Change-Id: I5a6c0d63a6ba0acf94ab9f0ef94777fab58fec6e
2023-01-09 10:37:45 -08:00
James E. Blair
aa8c7dee29 Remove kubernetes docker jobs
The kubernetes + docker jobs are failing because the ensure-kubernetes
role no longer works with the docker runtime.  It will be updated to
use microk8s in a later change, and we will deprecate its use with
docker.

Change-Id: Ia0a6d470ddfe594810ad761ed3494884f56cdb46
2023-01-08 08:04:51 -08:00
Ian Wienand
56e662d350
test-registry-post: collect k8s logs
Change-Id: I4ed79c8489b9df4375913ecfd821365670892081
2022-11-07 12:44:15 +11:00
Ian Wienand
df942a2aea linters: rename loop variable
In this repo we name the loop variables.  Although this is a test
playbook, it's good for consistency.  This is picked up by a later
version of ansible-lint.  This should have no operational change.

Change-Id: I084a1e8515fe1fda039190fe6518512ebf03217e
2022-07-27 17:06:30 +10:00
Clark Boylan
4c40b92950 Prevent leaks of buildset registry credentials
Because buildset registries may be used by jobs that finish before other
jobs are finished using the buildset registry we must be careful not to
expose the registry credentials in the jobs that finish sooner.
Otherwise logs for the earlier job runs could potentially be used to
poison the registry for later jobs.

This is likely currently incomplete. Other Zuulians should look over it
carefully to ensure we're covering all the bases here.

The cases I've identified so far are:

* Setting facts that include passwords
* Reading and writing to files that include passwords (as content may be
  logged)
* Calling modules with passwords passed as arguments (the module
  invocation is logged)

I've also set no_log on zuul_return that passes up credentials because
while the logging for zuul_return is minimal today, I don't want to
count on it remaining that way.

We also use the yet to be merged secret_data attribute on zuul_return to
ensure that zuul_return itself does not expose anything unwanted.

Finally it would be great if others could check over the use of
buildset_registry variables to make sure there aren't any that got
missed. One thing I'm not sure of is whether or not when conditionals
get logged and if we need to be careful about their use too.

Temporarily remove some buildset-regitry jobs which are in a catch-22.

Change-Id: I2dea683e27f00b99a7766bf830981bf91b925265
2021-06-24 09:56:19 -07:00
Guillaume Chauvel
911fe88a9f Fix buildset-registry test on focal
Fix ensure-kubernetes role for focal
As focal doesn't exist for project atomic ppa [1]
Install is performed from opensuse repository only

As cri-o package 1.15 for ubuntu focal doesn't exist, update to 1.16

[1] http://ppa.launchpad.net/projectatomic/ppa/ubuntu/dists/
[2] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/

Change-Id: I7f02b7337a5f51a86be1a2332f2305b0ae722934
2021-05-25 16:38:00 +02:00
Gonéri Le Bouder
2bb9b4995a ensure-docker: ensure docker.socket is stopped
On Centos8, during the docker-ce installation, the docker.socket service
is start with a bogus state:

docker.socket: Socket unit configuration has changed while unit has been running, no open socket file descriptor left. The socket unit is not functional until restarted.

Later, when the `Assure docker service is running` task tries to start
the service, it fails with the following error:

dockerd[29743]: failed to load listeners: no sockets found via socket activation: make sure the service was started by systemd

Example:
https://0c7366f2ce9149f2de0c-399b55a396b5093070500a70ecbf09b9.ssl.cf1.rackcdn.com/410/c233496b96c70cfc6204e75d10116a96b08d4663/check/ansible-test-sanity-docker/787388f/ara-report/index.html

Another example: https://github.com/kata-containers/tests/issues/3103

Also: Remove use of kubectl --generator=run-pod/v1

This has been deprecated since 1.17 and removed since 1.20. run-pod wound
up being the only generator that did anything, so this parameter became a
no-op. This has to be squashed into this commit to unbreak the gate.

Change-Id: I666046fe2a3aa079643092c71573803851a67be2
2021-04-20 18:44:37 -05:00
Paul Belanger
d2718417e2 ensure-podman: Use official podman repos for ubuntu
Reading the installation guide for podman, they reference opensuse.org
as the official package repos for ubuntu:

  https://podman.io/getting-started/installation

Using this repo allows us to pull in much newer version of podman on
ubuntu.  The current PPA package repo hasn't been updated since late
2019.

Change-Id: Ie34419184925a4bcf30422a782e6a238c11f2319
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2021-04-01 16:39:00 -04:00
Paul Belanger
b3ca356c76 Refresh intermediate TLS certs for testing
Lets use 10 years for testing.

Change-Id: Iba2fdb50df8c405fc42d9f7b2433480db70bb0d3
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2020-11-24 11:39:17 -05:00
Zuul
8748c9add2 Merge "test-playbooks: avoid warnings with shell/command" 2020-06-09 17:20:03 +00:00
Sorin Sbarnea
5c263fb437 test-playbooks: avoid warnings with shell/command
Avoids runtime warnings from use of Ansible shell/command module when
executed commands also have ansible modules.

Change-Id: I4e415cbd34f0f4cb15857051bf95458e0316de86
2020-06-04 18:54:37 +01:00
Sorin Sbarnea
b5408ca3fc test-playbooks: improved syntax
- added space around jinja variables
- use "name" argument on include_role, instead of undocumented role

Change-Id: I0984ca391667ace24705b20dd60eddd90e3a281e
2020-06-03 19:47:41 +01:00
Andreas Jaeger
a87a1e45b1 Rename test install role to ensure-
install-registry-cert is an internal test-only role, rename it to ensure
to be consistent with the removal of all install- roles.

Change-Id: I9906428639f1370fb39633f13ec18a22f1381453
2020-05-26 09:41:33 +02:00
Monty Taylor
f449ae20fb Set up siblings dirs for each build in the loop
The buildx patch unfortunately changed the logic associated with
siblings to set up siblings in a loop one time, rather than to
do a loop of "set up siblings, build, cleanup siblings". This causes
builds to fail when they're using siblings with an error about
siblings dir not having been cleaned up.

Change-Id: I3c45bfa77ec9f2609689e04044c18f066adc9741
2020-05-05 17:52:50 -05:00
Zuul
618c78f191 Merge "Support multi-arch image builds with docker buildx" 2020-05-05 13:22:18 +00:00
Monty Taylor
63bd307e63 Support multi-arch image builds with docker buildx
Docker has experimental support for building multi-arch
container images with a buildx command. Currently it only
supports pushing to a registry after running and the images
don't end up in the local docker images list. To work around
that, push to the buildset registry then pull back. This
is the inverse of the normal case where we build, then
retag, then push. The end result should be the same.

Change-Id: I6a4c4f9e262add909d2d5c2efa33ec69b9d9364a
2020-05-04 14:02:13 -05:00
Mohammed Naser
1c95063442 cleanup: move tests to use ensure-package-repositories
In order to keep things clean, let's re-use the role we have
for setting up repos.

Change-Id: I989c4d45e28f94767ff9d63937d273d0542312f5
2020-05-01 15:49:30 +02:00
vass
33cd649941 Update registry test to use ensure-podman and ensure-docker
Change-Id: I5f1e774ea834f08f6e5602f936132b21ecf591a8
2020-04-07 04:53:04 +00:00
vass
276a5e919a Rename install-openshift to ensure-openshift for consistency
The old role will be kept and include ensure-openshift for backwards-compatability.

Change-Id: I6ff81fbd04f25207c87834b36e4d636eb9d44a93
2020-04-04 15:41:29 -04:00
vass
fcf3202ba4 Rename install-kubernetes to ensure-kubernetes for consistency
The old role will be kept and include ensure-kubernetes for backwards compatability.

Change-Id: Ic0c18a833f4a07e123f8313673bd9c864d7d2919
2020-04-04 15:41:29 -04: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
Tristan Cacqueray
211e92ec40 crio: add missing registries.conf
This change fixes recent cri-o test failure because of a missing
registries.conf file.

Change-Id: Ieb2efa0e097cc76dc9b67389e86c2646dfc0c00d
2020-02-14 22:22:18 +00:00
Mohammed Naser
228033e78a collect-container-logs: add role
We use this in a few different places and it's really useful
to collect all the logs of all containers.

Change-Id: Idc46a47f444bf48cd040f4f9724f3a6ee8bc8f8e
2020-01-09 19:52:01 -05:00
James E. Blair
b6cb191295 Add cri-o support to use-buildset registry
This lets use-buildset-registry notify cri-o about the new
registries.conf file if it is being used as the container backend
for k8s.

Change-Id: Ia1805519ab4b6bb5f79df0492f702effc6a3e024
2020-01-07 07:35:28 -08:00
Zuul
8a8adfb58f Merge "openshift speculative containers" 2019-12-11 19:17:27 +00:00
Ian Wienand
599954715e build-docker-image: fix up siblings copy
There are a number of issues with this.  Firstly, it needs to copy the
parent directories to make a heirarchy in the .zuul-siblings
directory.  The current "cp -r" was only copying the final directory.
Switch into the source directory and use "--parent" to do this.

Also, it should be copying into the context dir.  Add the
{{ item.context }} to the path where appropriate.

Make new testing image that copies in files from the siblings.
Because COPY will fail if the sources aren't there, this is like an
assert that we copied it correctly.

Change-Id: I9f3b0a1f71d20cf7511f224648dd2fa51a039015
2019-12-09 11:14:21 +11:00
James E. Blair
6a9aa82fcc openshift speculative containers
Change-Id: I81f7be6065a74f45386ea735a5291d48b7e042ce
2019-12-06 13:50:25 -08:00
James E. Blair
d48667a3c5 use-buildset-registry: Add podman support
Change-Id: I41718073962c8e7eb3d8810276e550fb84bd6e99
2019-12-05 11:44:15 -08:00
Ian Wienand
0b0cb18a60 build-docker-image: add option to install siblings
When you build from a Dockerfile, it runs in a given "context"; that
is the directory the Dockerfile is in and the directories below it.
It can not access anything outside that context during the build.

When building a container for a project in the gate, you may wish to
install sibling projects that Zuul has checked-out into your container
(i.e. so that Depends-On works).  As mentioned, because
/home/zuul/src/<project> is not in the context of the current project,
you will not be able to access this source code during the container
build.

So to help facilitate dependencies, add a siblings: tag which can copy
some or all of the required-projects already specified for the job
into a special sub-directory of the current source.

Because all the code is now in the same context, this will allow build
scripts to be written that look for directories in .zuul-siblings and
can install the source code from there.  To further help the scripts,
the ZUUL_SIBLINGS arg is set for the docker build giving the copied
paths.

The test is updated with some paths to test the copy.

Change-Id: I079d823e7194e15b1b496aea0f53f70f6b563f02
2019-12-03 20:59:45 +11:00
James E. Blair
91ae8e62de Test buildset registry with k8s and docker
This adds a test job for the buildset registry with k8s with the
docker runtime.

Change-Id: I0ec1d3d5980424f85f5e7619b9dec96c8f0f70f1
2019-10-28 15:45:39 -07:00
James E. Blair
a899ed2e5b Don't sudo when saving container logs in registry test
We should not need elevated privileges for this.

Change-Id: Ie7eead23da925eceefaa8c7296bf5e63f9d1ea84
2019-10-28 15:42:29 -07:00
James E. Blair
4da8f6c3a7 Open iptables ports in registry test job
Open the iptables ports in the same way there are opened in the
production opendev configuration.  Do that in a pre-playbook and
move some tasks into it for retryability.

Change-Id: I992174aa3c7e47f9d2f70605172cd8b9460c53eb
2019-10-22 14:38:51 -07:00
James E. Blair
6e865fa04a Collect container logs from test-registry job
To help with debugging job errors.

Change-Id: I31bb65ee059f14603761d0fec0f8d3d5dc3344a1
2019-08-12 08:00:21 -07:00
James E. Blair
2f2d6ce3f7 Add a registry test job
This exercises the intermediate and buildset registry roles.

Change-Id: Ic0da2d6b48a7b9f9b616033c70db471ba98181b4
2019-06-03 09:03:35 -07:00