Pull from intermediate registry in image build job

Move the pull-from-intermediate-registry role from the buildset
registry job into the image build job so that we can be more
specific with provides/requires (by attaching them to the leaf
node jobs instead of the registry job).

Change-Id: I86669a039e391b8c67dcb6a3397edd79d7563186
This commit is contained in:
James E. Blair 2020-03-03 14:39:01 -08:00
parent 9b235be0c0
commit 13b71f7793
3 changed files with 15 additions and 93 deletions

View File

@ -1,34 +0,0 @@
- 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

@ -32,7 +32,3 @@
- name: Use buildset registry
include_role:
name: use-buildset-registry
- hosts: localhost
roles:
- pull-from-intermediate-registry

View File

@ -142,60 +142,6 @@
+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: |
@ -218,8 +164,22 @@
requires: docker-image
- job:
name: opendev-build-docker-image
name: opendev-build-docker-image-base
parent: opendev-buildset-registry
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
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