CI: Avoid tox (and clean up gate setup)

We don't need tox nor tell our users to use it when doing kolla
builds.
Tox is going away from base infra images.
It's already gone from aarch64 (arm64) ones.

Change-Id: I2eb5203ad93c011b8806f4b6fb56db081c14a2cb
This commit is contained in:
Radosław Piliszek 2020-03-15 15:16:04 +01:00 committed by Mark Goddard
parent 0c1b6c8a4b
commit ed1b74a35b
2 changed files with 20 additions and 20 deletions

View File

@ -60,13 +60,6 @@
when: when:
- ansible_architecture == 'aarch64' - ansible_architecture == 'aarch64'
- name: Ensure tox is installed
pip:
name: tox
extra_args: "-c {{ upper_constraints_file }}"
when: need_build_image
become: true
# 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:

View File

@ -2,11 +2,11 @@
set -o xtrace set -o xtrace
set -o errexit set -o errexit
set -o pipefail
# Enable unbuffered output for Ansible in Jenkins. # Enable unbuffered output for Ansible in Jenkins.
export PYTHONUNBUFFERED=1 export PYTHONUNBUFFERED=1
GIT_PROJECT_DIR=$(mktemp -d)
function setup_openstack_clients { function setup_openstack_clients {
# Prepare virtualenv for openstack deployment tests # Prepare virtualenv for openstack deployment tests
@ -28,7 +28,11 @@ function setup_openstack_clients {
~/openstackclient-venv/bin/pip install -c $UPPER_CONSTRAINTS ${packages[@]} ~/openstackclient-venv/bin/pip install -c $UPPER_CONSTRAINTS ${packages[@]}
} }
function setup_config { function prepare_images {
if [[ "${BUILD_IMAGE}" == "False" ]]; then
return
fi
if [[ $SCENARIO != "bifrost" ]]; then if [[ $SCENARIO != "bifrost" ]]; then
GATE_IMAGES="^cron,^fluentd,^glance,^haproxy,^keepalived,^keystone,^kolla-toolbox,^mariadb,^memcached,^neutron,^nova-,^openvswitch,^rabbitmq,^horizon,^chrony,^heat,^placement" GATE_IMAGES="^cron,^fluentd,^glance,^haproxy,^keepalived,^keystone,^kolla-toolbox,^mariadb,^memcached,^neutron,^nova-,^openvswitch,^rabbitmq,^horizon,^chrony,^heat,^placement"
else else
@ -70,7 +74,8 @@ function setup_config {
if [[ "debian" == $BASE_DISTRO ]]; then if [[ "debian" == $BASE_DISTRO ]]; then
PUSH="false" PUSH="false"
fi fi
cat <<EOF | sudo tee /etc/kolla/kolla-build.conf
sudo tee /etc/kolla/kolla-build.conf <<EOF
[DEFAULT] [DEFAULT]
namespace = lokolla namespace = lokolla
base = ${BASE_DISTRO} base = ${BASE_DISTRO}
@ -90,15 +95,16 @@ gate = ${GATE_IMAGES}
EOF EOF
mkdir -p /tmp/logs/build mkdir -p /tmp/logs/build
}
function prepare_images {
if [[ "${BUILD_IMAGE}" == "False" ]]; then
return
fi
sudo docker run -d -p 4000:5000 --restart=always -v /opt/kolla_registry/:/var/lib/registry --name registry registry:2 sudo docker run -d -p 4000:5000 --restart=always -v /opt/kolla_registry/:/var/lib/registry --name registry registry:2
pushd "${KOLLA_SRC_DIR}"
sudo tox -e "build-${BASE_DISTRO}-${INSTALL_TYPE}" python3 -m venv ~/kolla-venv
. ~/kolla-venv/bin/activate
pip install "${KOLLA_SRC_DIR}"
sudo ~/kolla-venv/bin/kolla-build
# NOTE(yoctozepto): due to debian buster we push after images are built # NOTE(yoctozepto): due to debian buster we push after images are built
# see https://github.com/docker/for-linux/issues/711 # see https://github.com/docker/for-linux/issues/711
if [[ "debian" == $BASE_DISTRO ]]; then if [[ "debian" == $BASE_DISTRO ]]; then
@ -106,13 +112,14 @@ function prepare_images {
sudo docker push $img; sudo docker push $img;
done done
fi fi
popd
deactivate
} }
setup_openstack_clients setup_openstack_clients
setup_config
RAW_INVENTORY=/etc/kolla/inventory RAW_INVENTORY=/etc/kolla/inventory
tools/kolla-ansible -i ${RAW_INVENTORY} -e ansible_user=$USER -vvv bootstrap-servers &> /tmp/logs/ansible/bootstrap-servers tools/kolla-ansible -i ${RAW_INVENTORY} -e ansible_user=$USER -vvv bootstrap-servers &> /tmp/logs/ansible/bootstrap-servers
prepare_images prepare_images