From c84a9757dd449dbd8863bb1dcc55837abe26a716 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Fri, 5 Feb 2021 11:49:13 +0100 Subject: [PATCH] Test building seed deployment images in the seed job This requires stackhpc.os-images v1.10.0 or newer, for compatibility with CentOS 8 when SELinux is enabled: we disable SELinux, but without rebooting it stays enabled. This Ansible role was updated to v1.10.2 in master and stable/victoria by I5efdbd52556721914fe69d7c6ba454b2c721b643, for another reason. Remember to bump the requirement when backporting to earlier releases. It also needs changes in the way we interact with Bifrost to avoid using the env-vars file which has been removed. This is implemented by change I25078e69acdf41a4ef9957f99fe5047de54b778d. Finally, it requires building seed deployment images only after deploying Bifrost, because the task copying images onto the seed expects /etc/kolla/bifrost to exist. We also copy log files to identify issues when the job fails. Change-Id: I4719b4d397c01b35c78cb84c6d686dd27742d1c0 --- dev/functions | 17 +++++++---------- playbooks/kayobe-seed-base/overrides.yml.j2 | 3 +++ roles/kayobe-diagnostics/files/get_logs.sh | 6 ++++++ 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/dev/functions b/dev/functions index 197de96a5..2a3b0ae48 100644 --- a/dev/functions +++ b/dev/functions @@ -282,16 +282,6 @@ function seed_deploy { run_kayobe seed host configure fi - # Note: This must currently be done before host configure, because host - # configure runs kolla-ansible.yml, which validates the presence of the - # built deploy images. - if is_deploy_image_built_locally; then - echo "Building seed deployment images" - run_kayobe seed deployment image build - else - echo "Not building seed deployment images" - fi - if [[ ${KAYOBE_SEED_CONTAINER_IMAGE_BUILD} = 1 ]]; then echo "Building seed container images" run_kayobe seed container image build @@ -304,6 +294,13 @@ function seed_deploy { echo "Deploying containerised seed services" run_kayobe seed service deploy fi + + if is_deploy_image_built_locally; then + echo "Building seed deployment images" + run_kayobe seed deployment image build + else + echo "Not building seed deployment images" + fi } function seed_upgrade { diff --git a/playbooks/kayobe-seed-base/overrides.yml.j2 b/playbooks/kayobe-seed-base/overrides.yml.j2 index b875cd23a..15aa10303 100644 --- a/playbooks/kayobe-seed-base/overrides.yml.j2 +++ b/playbooks/kayobe-seed-base/overrides.yml.j2 @@ -28,3 +28,6 @@ pip_index_url: "http://{{ zuul_site_mirror_fqdn }}/pypi/simple" # are using for SSH to be removed. Use a dummy interface. aio_bridge_ports: - dummy1 + +# Build seed deployment images (IPA) +ipa_build_images: true diff --git a/roles/kayobe-diagnostics/files/get_logs.sh b/roles/kayobe-diagnostics/files/get_logs.sh index 1b7e1fe73..c9b644efd 100644 --- a/roles/kayobe-diagnostics/files/get_logs.sh +++ b/roles/kayobe-diagnostics/files/get_logs.sh @@ -89,6 +89,12 @@ copy_logs() { docker cp bifrost_deploy:/var/log/mariadb/mariadb.log ${LOG_DIR}/kolla/mariadb/ fi + # IPA build logs + if [[ -f /opt/kayobe/images/ipa/ipa.stderr ]] || [[ -f /opt/kayobe/images/ipa/ipa.stdout ]]; then + mkdir -p ${LOG_DIR}/kayobe + cp /opt/kayobe/images/ipa/ipa.stderr /opt/kayobe/images/ipa/ipa.stdout ${LOG_DIR}/kayobe/ + fi + # Rename files to .txt; this is so that when displayed via # logs.openstack.org clicking results in the browser shows the # files, rather than trying to send it to another app or make you