Merge "[CI] Support building source images with in-review changes"
This commit is contained in:
commit
09e667a0b6
@ -42,20 +42,38 @@
|
|||||||
|
|
||||||
- hosts: primary
|
- hosts: primary
|
||||||
any_errors_fatal: true
|
any_errors_fatal: true
|
||||||
|
vars:
|
||||||
|
kolla_build_config:
|
||||||
|
DEFAULT:
|
||||||
|
profile: gate
|
||||||
|
logs_dir: /tmp/logs/build
|
||||||
|
# NOTE(yoctozepto): we cannot build and push at the same time on debian
|
||||||
|
# buster see https://github.com/docker/for-linux/issues/711.
|
||||||
|
push: "{{ base_distro != 'debian' }}"
|
||||||
|
base: "{{ base_distro }}"
|
||||||
|
install_type: "{{ install_type }}"
|
||||||
|
registry: "127.0.0.1:4000"
|
||||||
|
namespace: lokolla
|
||||||
|
tag: "{{ build_image_tag }}"
|
||||||
|
template_override: /etc/kolla/template_overrides.j2
|
||||||
|
# NOTE(yoctozepto): to avoid issues with IPv6 not enabled in the docker daemon
|
||||||
|
# and since we don't need isolated networks here, use host networking
|
||||||
|
network_mode: host
|
||||||
tasks:
|
tasks:
|
||||||
- name: detect whether need build images
|
- name: detect whether need build images
|
||||||
set_fact:
|
set_fact:
|
||||||
need_build_image: true
|
need_build_image: true
|
||||||
when:
|
when:
|
||||||
- item.project.short_name == "kolla"
|
# NOTE(yoctozepto): if there is any tested change that does not belong to kolla-ansible,
|
||||||
- item.branch == zuul.branch
|
# then kolla images should be built
|
||||||
|
- item.project.short_name != "kolla-ansible"
|
||||||
with_items: "{{ zuul['items'] }}"
|
with_items: "{{ zuul['items'] }}"
|
||||||
|
|
||||||
# NOTE(yoctozepto): required to template template_overrides.j2 for Zuul
|
# NOTE(yoctozepto): required to template template_overrides.j2 for Zuul
|
||||||
- name: Include kolla Zuul vars if building new images
|
- name: Include kolla Zuul vars if building new images
|
||||||
include_vars:
|
include_vars:
|
||||||
file: "{{ zuul.executor.work_root }}/src/opendev.org/openstack/kolla/tests/vars/zuul.yml"
|
file: "{{ zuul.executor.work_root }}/src/opendev.org/openstack/kolla/tests/vars/zuul.yml"
|
||||||
when: need_build_image # only then kolla sources are available (and used)
|
when: need_build_image
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
# NOTE(mgoddard): This only affects the remote copy of the repo, not the
|
# NOTE(mgoddard): This only affects the remote copy of the repo, not the
|
||||||
@ -84,12 +102,16 @@
|
|||||||
mode: 0777
|
mode: 0777
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
- import_role:
|
||||||
|
name: kolla-build-config
|
||||||
|
when: need_build_image
|
||||||
|
|
||||||
# NOTE(yoctozepto): required to customize kolla to use local mirrors
|
# NOTE(yoctozepto): required to customize kolla to use local mirrors
|
||||||
- name: Template template_overrides.j2
|
- name: Template template_overrides.j2
|
||||||
template:
|
template:
|
||||||
src: "{{ zuul.executor.work_root }}/src/opendev.org/openstack/kolla/tests/templates/template_overrides.j2"
|
src: "{{ zuul.executor.work_root }}/src/opendev.org/openstack/kolla/tests/templates/template_overrides.j2"
|
||||||
dest: /etc/kolla/template_overrides.j2
|
dest: /etc/kolla/template_overrides.j2
|
||||||
when: need_build_image # only then kolla sources are available (and used)
|
when: need_build_image
|
||||||
|
|
||||||
- name: Ensure /etc/docker exists
|
- name: Ensure /etc/docker exists
|
||||||
file:
|
file:
|
||||||
@ -247,9 +269,7 @@
|
|||||||
chdir: "{{ kolla_ansible_src_dir }}"
|
chdir: "{{ kolla_ansible_src_dir }}"
|
||||||
environment:
|
environment:
|
||||||
BASE_DISTRO: "{{ base_distro }}"
|
BASE_DISTRO: "{{ base_distro }}"
|
||||||
INSTALL_TYPE: "{{ install_type }}"
|
|
||||||
BUILD_IMAGE: "{{ need_build_image }}"
|
BUILD_IMAGE: "{{ need_build_image }}"
|
||||||
TAG: "{{ build_image_tag }}"
|
|
||||||
KOLLA_SRC_DIR: "{{ ansible_env.HOME }}/src/opendev.org/openstack/kolla"
|
KOLLA_SRC_DIR: "{{ ansible_env.HOME }}/src/opendev.org/openstack/kolla"
|
||||||
SCENARIO: "{{ scenario }}"
|
SCENARIO: "{{ scenario }}"
|
||||||
UPPER_CONSTRAINTS: "{{ upper_constraints_file }}"
|
UPPER_CONSTRAINTS: "{{ upper_constraints_file }}"
|
||||||
|
@ -79,28 +79,7 @@ function prepare_images {
|
|||||||
GATE_IMAGES="^cron,^elasticsearch,^fluentd,^grafana,^haproxy,^keepalived,^kibana,^kolla-toolbox,^mariadb,^memcached,^prometheus,^rabbitmq"
|
GATE_IMAGES="^cron,^elasticsearch,^fluentd,^grafana,^haproxy,^keepalived,^kibana,^kolla-toolbox,^mariadb,^memcached,^prometheus,^rabbitmq"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# NOTE(yoctozepto): we cannot build and push at the same time on debian
|
sudo tee -a /etc/kolla/kolla-build.conf <<EOF
|
||||||
# buster see https://github.com/docker/for-linux/issues/711.
|
|
||||||
PUSH="true"
|
|
||||||
if [[ "debian" == $BASE_DISTRO ]]; then
|
|
||||||
PUSH="false"
|
|
||||||
fi
|
|
||||||
|
|
||||||
sudo tee /etc/kolla/kolla-build.conf <<EOF
|
|
||||||
[DEFAULT]
|
|
||||||
namespace = lokolla
|
|
||||||
base = ${BASE_DISTRO}
|
|
||||||
install_type = ${INSTALL_TYPE}
|
|
||||||
tag = ${TAG}
|
|
||||||
profile = gate
|
|
||||||
registry = 127.0.0.1:4000
|
|
||||||
push = ${PUSH}
|
|
||||||
logs_dir = /tmp/logs/build
|
|
||||||
template_override = /etc/kolla/template_overrides.j2
|
|
||||||
# NOTE(yoctozepto): to avoid issues with IPv6 not enabled in the docker daemon
|
|
||||||
# and since we don't need isolated networks here, use host networking
|
|
||||||
network_mode = host
|
|
||||||
|
|
||||||
[profiles]
|
[profiles]
|
||||||
gate = ${GATE_IMAGES}
|
gate = ${GATE_IMAGES}
|
||||||
EOF
|
EOF
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
timeout: 7200
|
timeout: 7200
|
||||||
post-timeout: 1800
|
post-timeout: 1800
|
||||||
required-projects:
|
required-projects:
|
||||||
|
- openstack/kolla
|
||||||
- openstack/kolla-ansible
|
- openstack/kolla-ansible
|
||||||
- openstack/requirements
|
- openstack/requirements
|
||||||
irrelevant-files:
|
irrelevant-files:
|
||||||
@ -44,6 +45,7 @@
|
|||||||
ansible_python_interpreter: python3
|
ansible_python_interpreter: python3
|
||||||
roles:
|
roles:
|
||||||
- zuul: zuul/zuul-jobs
|
- zuul: zuul/zuul-jobs
|
||||||
|
- zuul: openstack/kolla
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: kolla-ansible-kvm-base
|
name: kolla-ansible-kvm-base
|
||||||
|
Loading…
Reference in New Issue
Block a user