Filter image list by deployed services
This change adds environment file arguments to "openstack overcloud container image prepare" calls so that only deployed images are in the generated files. This will lead to upload commands only transferring the required images to the undercloud registry, which should lead to a significant speedup of containerized CI jobs. Change-Id: I48b6b2e2be847314c45ae1d399fa70caf54ac2f4 Closes-Bug: #1710992
This commit is contained in:
parent
1ddb21fd48
commit
2e637c5825
@ -33,3 +33,5 @@ Role Variables
|
||||
docker images used for TripleO deployment
|
||||
- `docker_image_tag`: <'latest'> -- tag of docker images used for
|
||||
TripleO deployment
|
||||
- `deploy_composable_scenario`: <false> -- whether to deploy one of the
|
||||
composable scenarios
|
||||
|
@ -21,3 +21,4 @@ timestamper_cmd: >-
|
||||
# enable_libvirt_tripleo_ui is a switch to force the steps to run with or
|
||||
# without virtbmc
|
||||
enable_libvirt_tripleo_ui: false
|
||||
deploy_composable_scenario: false
|
||||
|
@ -29,6 +29,7 @@ overcloud-prep-containers variables
|
||||
* overcloud_prep_containers_script: overcloud-prep-containers.sh.j2
|
||||
* overcloud_prep_containers_log: overcloud_prep_containers.log
|
||||
* undercloud_network_cidr: 192.168.24.0/24
|
||||
* prepare_service_env_args: -e {{ overcloud_templates_path }}/environments/docker.yaml
|
||||
|
||||
overcloud-prep-config variables
|
||||
-------------------------------
|
||||
|
@ -8,3 +8,4 @@ overcloud_prep_containers_log: overcloud_prep_containers.log
|
||||
# Useful in CI to workaround disk space issue
|
||||
# https://bugs.launchpad.net/tripleo/+bug/1694709
|
||||
delete_docker_cache: false
|
||||
prepare_service_env_args: -e {{ overcloud_templates_path }}/environments/docker.yaml
|
||||
|
@ -1,5 +1,12 @@
|
||||
# Create the scripts that will be used to setup the overcloud images
|
||||
|
||||
- name: set the service environments for container image prepare
|
||||
set_fact:
|
||||
prepare_service_env_args: >-
|
||||
-e {{ overcloud_templates_path }}/environments/docker.yaml
|
||||
-e {{ overcloud_templates_path }}/ci/environments/{{ composable_scenario }}
|
||||
when: deploy_composable_scenario|bool
|
||||
|
||||
- name: Create overcloud prep-containers script
|
||||
template:
|
||||
src: "{{ overcloud_prep_containers_script }}"
|
||||
|
@ -17,6 +17,7 @@ set -eux
|
||||
|
||||
openstack overcloud container image prepare \
|
||||
--images-file {{ working_dir }}/overcloud_containers.yaml \
|
||||
{{ prepare_service_env_args }} \
|
||||
--namespace {{ docker_registry_namespace }} \
|
||||
--tag {{ docker_image_tag }} \
|
||||
--pull-source {{ docker_registry_host }} \
|
||||
@ -40,6 +41,7 @@ sudo systemctl start docker
|
||||
|
||||
openstack overcloud container image prepare \
|
||||
--env-file {{ working_dir }}/containers-default-parameters.yaml \
|
||||
{{ prepare_service_env_args }} \
|
||||
--namespace {{ local_docker_registry_host }}:8787/{{ docker_registry_namespace }} \
|
||||
--tag {{ docker_image_tag }}
|
||||
|
||||
|
@ -16,12 +16,14 @@ source {{ upgrade_working_dir }}/stackrc
|
||||
# pull latest containers to the registry
|
||||
openstack overcloud container image prepare \
|
||||
--images-file {{ upgrade_working_dir }}/overcloud_upgrade_containers.yaml \
|
||||
-e {{ tht_dir }}/environments/docker.yaml \
|
||||
--namespace {{ docker_registry_namespace }} \
|
||||
--tag {{ docker_image_tag }} \
|
||||
--push-destination {{ local_docker_registry_host }}:8787
|
||||
|
||||
openstack overcloud container image prepare \
|
||||
--env-file ~/containers-default-parameters.yaml \
|
||||
-e {{ tht_dir }}/environments/docker.yaml \
|
||||
--namespace {{ local_docker_registry_host }}:8787/{{ docker_registry_namespace }} \
|
||||
--tag {{ docker_image_tag }}
|
||||
|
||||
|
@ -78,6 +78,12 @@ sudo ln -f -s /usr/share/openstack-puppet/modules/* /etc/puppet/modules/
|
||||
{% if undercloud_docker_registry_host is defined %}
|
||||
openstack overcloud container image prepare \
|
||||
--env-file {{ working_dir }}/undercloud-containers-default-parameters.yaml \
|
||||
{% if containerized_undercloud|bool %}
|
||||
-e {{overcloud_templates_path}}/environments/services-docker/ironic.yaml \
|
||||
-e {{overcloud_templates_path}}/environments/services-docker/mistral.yaml \
|
||||
-e {{overcloud_templates_path}}/environments/services-docker/zaqar.yaml \
|
||||
-e {{overcloud_templates_path}}/environments/docker.yaml \
|
||||
{% endif %}
|
||||
--namespace {{ undercloud_docker_registry_host }}:{{ undercloud_docker_registry_port }}/{{ undercloud_docker_registry_namespace }}
|
||||
{% if undercloud_docker_registry_insecure|bool %}
|
||||
echo " DockerInsecureRegistryAddress: {{ undercloud_docker_registry_host }}:{{ undercloud_docker_registry_port }}" >> \
|
||||
|
Loading…
Reference in New Issue
Block a user