From c6c1cde3f9cf8bb232071b78ab89c79a0c7689b8 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Thu, 3 Jun 2021 15:31:43 +0100 Subject: [PATCH] CI: test base container image build in seed jobs Currently we do not have any coverage of building container images. This change adds a basic test of building the base image to the seed jobs. A potential future enhancement could involve pushing to a local registry running on the seed. Change-Id: Id7378dd844aca7cb5634535308eba0f60342c81d --- playbooks/kayobe-seed-base/overrides.yml.j2 | 4 +++- playbooks/kayobe-seed-base/run.yml | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/playbooks/kayobe-seed-base/overrides.yml.j2 b/playbooks/kayobe-seed-base/overrides.yml.j2 index 4d0420f24..9bba1e70f 100644 --- a/playbooks/kayobe-seed-base/overrides.yml.j2 +++ b/playbooks/kayobe-seed-base/overrides.yml.j2 @@ -10,7 +10,9 @@ docker_registry_mirrors: kolla_docker_namespace: "openstack.kolla" # use the published images from a site mirror of quay.io kolla_docker_registry: "{{ zuul_site_mirror_fqdn }}:4447" -kolla_source_url: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/openstack/kolla'].src_dir }}" +# NOTE(mgoddard): The kolla repository is copied to /tmp/kolla and made +# readable by the stack user. +kolla_source_url: "/tmp/kolla" kolla_source_version: "{{ zuul.projects['opendev.org/openstack/kolla'].checkout }}" kolla_ansible_source_url: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/openstack/kolla-ansible'].src_dir }}" kolla_ansible_source_version: "{{ zuul.projects['opendev.org/openstack/kolla-ansible'].checkout }}" diff --git a/playbooks/kayobe-seed-base/run.yml b/playbooks/kayobe-seed-base/run.yml index 270081ee4..35f29d929 100644 --- a/playbooks/kayobe-seed-base/run.yml +++ b/playbooks/kayobe-seed-base/run.yml @@ -9,3 +9,21 @@ shell: cmd: "{{ kayobe_src_dir }}/dev/seed-deploy.sh &> {{ logs_dir }}/ansible/seed-deploy" executable: /bin/bash + + # NOTE(mgoddard): The stack user cannot read the kolla source code, which + # lives in the zuul user's home directory. Copy it to a readable location. + - name: Create a readable copy of kolla source code + become: true + copy: + src: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['opendev.org/openstack/kolla'].src_dir }}" + dest: /tmp + owner: stack + group: stack + remote_src: true + + - name: Ensure base container image is built + shell: + cmd: > + source {{ kayobe_src_dir }}/dev/environment-setup.sh && + kayobe seed container image build ^base &> {{ logs_dir }}/ansible/container-image-build + executable: /bin/bash