diff --git a/playbooks/tripleo-buildcontainers/defaults/main.yaml b/playbooks/tripleo-buildcontainers/defaults/main.yaml index 13293932a..f649d3f76 100644 --- a/playbooks/tripleo-buildcontainers/defaults/main.yaml +++ b/playbooks/tripleo-buildcontainers/defaults/main.yaml @@ -1,3 +1,4 @@ push_registry: "127.0.0.1:8787" push_tag: "latest" push_containers: "false" +use_buildah: false diff --git a/playbooks/tripleo-buildcontainers/post.yaml b/playbooks/tripleo-buildcontainers/post.yaml index 62979ec65..4b14d5b9e 100644 --- a/playbooks/tripleo-buildcontainers/post.yaml +++ b/playbooks/tripleo-buildcontainers/post.yaml @@ -13,11 +13,14 @@ mkdir -p {{ workspace }}/conf/ mkdir -p {{ workspace }}/logs/system mkdir -p {{ workspace }}/etc/docker + mkdir -p {{ workspace }}/logs/buildah-builds mv *.conf {{ workspace }}/conf/ mv *.log {{ workspace }}/logs/ + mv /tmp/kolla-* {{ workspace }}/logs/buildah-builds/ || true rsync -var --no-links /var/log/ {{ workspace }}/logs/system/ || true rsync -var --no-links /etc/docker/ {{ workspace }}/etc/docker/ || true + rsync -var --no-links /etc/containers/ {{ workspace }}/etc/containers/ || true gzip -r "{{ workspace }}/logs" "{{ workspace }}/conf" "{{ workspace }}/etc" chmod -R a+r "{{ workspace }}" chown -R {{ ansible_user }}: "{{ workspace }}" diff --git a/playbooks/tripleo-buildcontainers/pre.yaml b/playbooks/tripleo-buildcontainers/pre.yaml index bdfeed4e2..41c9fc958 100644 --- a/playbooks/tripleo-buildcontainers/pre.yaml +++ b/playbooks/tripleo-buildcontainers/pre.yaml @@ -43,6 +43,23 @@ - name: Reset connection because of group changes for current user meta: reset_connection + - name: Prepare Buildah + become: true + when: use_buildah | default(false) | bool + block: + - name: Install Buildah + package: + name: buildah + state: present + + - name: Configure insecure registry + ini_file: + path: /etc/containers/registries.conf + section: 'registries.insecure' + option: registries + value: + - localhost:8787 + - name: Setup repo web service become: true block: diff --git a/playbooks/tripleo-buildcontainers/run.yaml b/playbooks/tripleo-buildcontainers/run.yaml index c45293fe8..085725c6e 100644 --- a/playbooks/tripleo-buildcontainers/run.yaml +++ b/playbooks/tripleo-buildcontainers/run.yaml @@ -51,11 +51,13 @@ chdir: '{{ workspace }}' shell: | set -x + BUILDAH="" source {{ workspace }}/venv/bin/activate TRIPLEO_COMMON_PATH="{{ openstack_git_root }}/tripleo-common" + if [[ "{{ use_buildah | default(False) }}" == "True" ]]; then BUILDAH="--use-buildah"; fi openstack overcloud container image build \ --config-file $TRIPLEO_COMMON_PATH/container-images/overcloud_containers.yaml \ - --kolla-config-file {{ workspace }}/kolla-build.conf > {{ workspace }}/build.log 2> {{ workspace }}/build-err.log + --kolla-config-file {{ workspace }}/kolla-build.conf $BUILDAH > {{ workspace }}/build.log 2> {{ workspace }}/build-err.log RESULT=$? exit $RESULT diff --git a/zuul.d/build-containers.yaml b/zuul.d/build-containers.yaml index e110c7982..08175511f 100644 --- a/zuul.d/build-containers.yaml +++ b/zuul.d/build-containers.yaml @@ -7,6 +7,7 @@ check: jobs: - tripleo-build-containers-centos-7 + - tripleo-build-containers-centos-7-buildah gate: queue: tripleo jobs: @@ -17,3 +18,11 @@ parent: tripleo-build-containers-base-with-files nodeset: single-centos-7-node voting: true + +- job: + name: tripleo-build-containers-centos-7-buildah + parent: tripleo-build-containers-base-with-files + nodeset: single-centos-7-node + branches: ^(?!stable/(pike|queens|rocky)).*$ + vars: + use_buildah: true