Add test docker image build jobs

Moving the intermediate image pulls to the image build job is a
substantial change, so let's test it first before we commit it
to production.

Change-Id: Ic4b43fa4976692bb58908a25e3b1a2e06d9ef637
This commit is contained in:
James E. Blair 2020-02-27 06:54:47 -08:00
parent a64ad5c140
commit 2433993b70
3 changed files with 91 additions and 0 deletions

View File

@ -0,0 +1,34 @@
- hosts: all
tasks:
- name: Install docker
include_role:
name: install-docker
- name: Open the IPv4 port for the buildset registry
become: true
iptables:
action: insert
chain: openstack-INPUT
destination_port: '5000:5001'
jump: ACCEPT
match: tcp
ctstate: NEW
protocol: tcp
ip_version: ipv4
- name: Open the IPv6 port for the buildset registry
become: true
iptables:
action: insert
chain: openstack-INPUT
destination_port: '5000:5001'
jump: ACCEPT
match: tcp
ctstate: NEW
protocol: tcp
ip_version: ipv6
- name: Run buildset registry (if not already running)
when: buildset_registry is not defined
include_role:
name: run-buildset-registry
- name: Use buildset registry
include_role:
name: use-buildset-registry

View File

@ -0,0 +1,3 @@
- hosts: localhost
roles:
- pull-from-intermediate-registry

View File

@ -142,6 +142,60 @@
+v5Gg5Wb07OWvBjg0jcL9IvNwQXgWh39y4uq4TmKcYXHL6RnICtN5Hp4Gc7xDxNvp2+uC
Na/OOailVlvkWMcpO/l77/qFtNXoRxFTDWYqp5rE3fGmdq09hCiflFWgMMre08=
- job:
name: opendev-buildset-registry-test
description: |
Starts a buildset registry which interacts with the intermediate
CI registry to share speculative container images between
projects.
Configure any jobs which require the use of a buildset registry
to depend on this job using the "dependencies" job attribute.
This job will pause after starting the registry so that it is
available to any jobs which depend on it. Once all such jobs
are complete, this job will finish.
pre-run: playbooks/buildset-registry/pre-test.yaml
run: playbooks/buildset-registry/run.yaml
post-run: playbooks/buildset-registry/post.yaml
secrets:
- secret: opendev-intermediate-registry
name: intermediate_registry
requires: docker-image
- job:
name: opendev-build-docker-image-base
parent: opendev-buildset-registry-test
description: |
This is a parent for an image build job which expects a
buildset registry to be running and pulls images from the
intermediate registry into it. It mostly exists so that
the intermediate registry secret need not be supplied to the
image build playbook.
pre-run: playbooks/docker-image/pre.yaml
secrets:
- secret: opendev-intermediate-registry
name: intermediate_registry
- job:
name: opendev-build-docker-image-test
parent: opendev-build-docker-image-base
description: |
Starts a buildset registry (if one has not already been started,
e.g., by invoking :zuul:job:`opendev-buildset-registry` and
specifying it as a dependency) and builds one or more docker
images.
Analog of build-docker-image job, but with a buildset registry.
This job will pause after starting the registry so that it is
available to any jobs which depend on it. Once all such jobs
are complete, this job will finish.
.. include:: ../../playbooks/docker-image/README.rst
run: playbooks/docker-image/run.yaml
provides: docker-image
- job:
name: opendev-buildset-registry
description: |