Add the option to run the container-check script

This review adds the functionality to install the
container-check package and run the script
to update the containers and include the latest rpms.
The containers should be updated when there is a change
to be built and tested or when the latest rpms are required.

By default, containers will not be updated. Feature sets or
environment files will be used to enable the container update.

Change-Id: I7fc3a83c95a76fe5005eeb084ad044fee9084bdb
This commit is contained in:
Ronelle Landy 2017-10-17 17:36:23 -04:00 committed by Emilien Macchi
parent 936bfff9d6
commit dfe4d96289
4 changed files with 62 additions and 0 deletions

View File

@ -30,6 +30,10 @@ overcloud-prep-containers variables
* 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
* delete_docker_cache: <false> -- whether to stop Docker, wipe all the Docker data, and restart
* update_containers: <false> -- whether to run container-check to update containers
* container_process_count: <8> -- number of concurrent processes to run when updating containers
overcloud-prep-config variables
-------------------------------

View File

@ -5,3 +5,5 @@ containerized_overcloud: false
overcloud_prep_containers_script: overcloud-prep-containers.sh.j2
overcloud_prep_containers_log: overcloud_prep_containers.log
prepare_service_env_args: -e {{ overcloud_templates_path }}/environments/docker.yaml
update_containers: false
container_process_count: 8

View File

@ -1,4 +1,30 @@
---
- when: update_containers|bool
block:
- name: Install python-setuptools
yum:
name: python-setuptools
state: latest
become: true
- name: easy-install pip
command: easy_install pip
become: true
- name: Update pip
pip:
name: pip
state: latest
extra_args: --upgrade
become: true
- name: Pip install container-check
pip:
name: container-check
state: latest
extra_args: --upgrade
become: true
- name: Prepare for the containerized deployment
shell: >
set -o pipefail &&

View File

@ -62,6 +62,7 @@ openstack overcloud container image upload --verbose --config-file {{ working_di
## ::
openstack overcloud container image prepare \
--images-file {{ working_dir }}/overcloud_containers.yaml \
--env-file {{ working_dir }}/containers-default-parameters.yaml \
{{ prepare_service_env_args }} \
--namespace {{ local_docker_registry_host }}:8787/{{ docker_registry_namespace }} \
@ -82,6 +83,35 @@ openstack overcloud container image prepare \
{% endif %}
--tag $BUILD_ID
{% if update_containers|bool %}
# See https://github.com/imain/container-check for script and documentation
## * rename the base-os yum repos to disable them. This will speed up the update
## ::
CENTOS_REPOS=$(find /etc/yum.repos.d -type f -name "CentOS-*.repo" -o -name "quickstart-centos-*.repo")
for f in $CENTOS_REPOS ; do
sudo mv "$f" "$f"_disabled
done
yum clean all
yum repolist
## * update the containers with yum updates from OpenStack repos. ( delorean-current, dependent patches built by DLRN )
## ::
# do not update ceph
cat overcloud_containers.yaml | grep -v ceph > containers_update.yaml
container-check -c {{ working_dir }}/containers_update.yaml -u -p {{ container_process_count }}
## * re-enable the base-os yum repos.
## ::
DISABLED_REPOS=$(find /etc/yum.repos.d -type f -name "*.repo_disabled")
for f in $DISABLED_REPOS ; do
sudo mv -- "$f" "${f%.repo_disabled}.repo"
done
yum clean all
yum repolist
{% endif %}
echo "============================="
echo "Containers default parameters:"
cat {{ working_dir }}/containers-default-parameters.yaml