From 3e5730cd5310feb71b8eae82578bf39e6cf57613 Mon Sep 17 00:00:00 2001 From: Andrii Ostapenko Date: Mon, 20 Jan 2020 19:42:41 -0600 Subject: [PATCH] Enable Debian gate build and fix mirrors related issues Also fixes related issue with distutils installation for Debian Stretch and Ubuntu Xenial with py3: unlike in Bionic, distutils is installed with python3 and python3-distutils package is not available in these distributions. Run Debian build with py3 against stable/train, as master requires at least python3.6, not available for distribution out of box. Also increases job timeout to 5400 due to increased amount of builds. Change-Id: I04c9253af80d941afb45231bee20f7bb1c4a96d4 --- .zuul.d/base.yaml | 2 +- .zuul.d/requirements.yaml | 2 +- README.md | 8 +++--- dockerfiles/debian/Dockerfile | 2 +- playbooks/vars.yaml | 48 ++++++++++++++++++++--------------- scripts/install.sh | 5 +++- 6 files changed, 38 insertions(+), 29 deletions(-) diff --git a/.zuul.d/base.yaml b/.zuul.d/base.yaml index b6cfe56d..533591f7 100644 --- a/.zuul.d/base.yaml +++ b/.zuul.d/base.yaml @@ -3,4 +3,4 @@ pre-run: playbooks/setup-gate.yaml run: playbooks/loci-builder.yaml post-run: playbooks/post.yaml - timeout: 3600 + timeout: 5400 diff --git a/.zuul.d/requirements.yaml b/.zuul.d/requirements.yaml index 257b49e7..c03b7b5f 100644 --- a/.zuul.d/requirements.yaml +++ b/.zuul.d/requirements.yaml @@ -12,7 +12,7 @@ - job: name: loci-requirements parent: loci-base - timeout: 2400 + timeout: 3600 vars: project: requirements required-projects: diff --git a/README.md b/README.md index d7574e40..38b81f1f 100644 --- a/README.md +++ b/README.md @@ -87,10 +87,10 @@ $ docker build https://opendev.org/openstack/loci.git \ For more advanced building you can use docker build arguments to define: * `FROM` The base Docker image to build from. Currently supported are - `ubuntu:bionic`, `ubuntu:xenial`, `centos:7`, `opensuse/leap:15`, or - a base image derived from one of those distributions. Dockerfiles to - bootstrap the base images can be found in the `dockerfiles` directory, - and are a good starting point for customizing a base image. + `ubuntu:bionic`, `ubuntu:xenial`, `centos:7`, `opensuse/leap:15`, + `debian:stretch`, or a base image derived from one of those distributions. + Dockerfiles to bootstrap the base images can be found in the `dockerfiles` + directory, and are a good starting point for customizing a base image. * `PROJECT` The name of the project to install. * `PROJECT_REPO` The git repo containing the OpenStack project the container should contain diff --git a/dockerfiles/debian/Dockerfile b/dockerfiles/debian/Dockerfile index 48a4afd3..81ad6935 100644 --- a/dockerfiles/debian/Dockerfile +++ b/dockerfiles/debian/Dockerfile @@ -2,7 +2,7 @@ ARG FROM=debian:stretch FROM ${FROM} ARG DEBIAN_URL=http://deb.debian.org/debian/ -ARG DEBIAN_SECURITY_URL=http://security.debian.org/ +ARG DEBIAN_SECURITY_URL=http://security.debian.org/debian-security/ ARG DEBIAN_SECURITY_DISTRIBUTION=stretch/updates ARG CEPH_URL=http://download.ceph.com/debian-nautilus/ ARG ALLOW_UNAUTHENTICATED=false diff --git a/playbooks/vars.yaml b/playbooks/vars.yaml index a4274a3d..601fe784 100644 --- a/playbooks/vars.yaml +++ b/playbooks/vars.yaml @@ -101,24 +101,30 @@ distros: PROJECT_REPO: http://172.17.0.1/git/openstack/requirements FROM: base:leap15 PYTHON3: yes -# - name: debian -# image: debian:stretch -# buildargs: -# base: -# DEBIAN_URL: http://{{ zuul_site_mirror_fqdn }}/debian/ -# DEBIAN_SECURITY_URL: http://{{ zuul_site_mirror_fqdn }}/debian/ -# DEBIAN_SECURITY_DISTRIBUTION: stretch-security -# CEPH_URL: http://{{ zuul_site_mirror_fqdn }}/ceph-deb-luminous/ -# ALLOW_UNAUTHENTICATED: "true" -# PIP_INDEX_URL: http://{{ zuul_site_mirror_fqdn }}/pypi/simple -# PIP_TRUSTED_HOST: "{{ zuul_site_mirror_fqdn }}" -# project: -# PROJECT: "{{ project }}" -# PROJECT_REPO: http://172.17.0.1/git/openstack/{{ project }} -# PROJECT_REF: "{{ project_reference }}" -# WHEELS: 172.17.0.1:5000/loci/requirements:master-debian -# FROM: base:debian -# requirements: -# PROJECT: requirements -# PROJECT_REPO: http://172.17.0.1/git/openstack/requirements -# FROM: base:debian + - name: debian + image: debian:stretch + release: train + buildargs: + base: + DEBIAN_URL: http://{{ zuul_site_mirror_fqdn }}/debian/ + DEBIAN_SECURITY_URL: http://{{ zuul_site_mirror_fqdn }}/debian-security/ + DEBIAN_SECURITY_DISTRIBUTION: stretch/updates + CEPH_URL: http://{{ zuul_site_mirror_fqdn }}/ceph-deb-nautilus/ + ALLOW_UNAUTHENTICATED: "true" + PIP_INDEX_URL: http://{{ zuul_site_mirror_fqdn }}/pypi/simple + PIP_TRUSTED_HOST: "{{ zuul_site_mirror_fqdn }}" + project: + PROJECT: "{{ project }}" + PROJECT_REPO: http://172.17.0.1/git/openstack/{{ project }} + PROJECT_REF: "stable/train" + PROJECT_RELEASE: "train" + WHEELS: 172.17.0.1:5000/loci/requirements:train-debian + FROM: base:debian + PYTHON3: yes + requirements: + PROJECT: requirements + PROJECT_REPO: http://172.17.0.1/git/openstack/requirements + PROJECT_REF: "stable/train" + PROJECT_RELEASE: "train" + FROM: base:debian + PYTHON3: yes diff --git a/scripts/install.sh b/scripts/install.sh index c5794a8b..a5a31dc5 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -11,7 +11,7 @@ if [[ "${PYTHON3}" == "no" ]]; then python3="" python_version=2 else - dpkg_python_packages=("python3" "python3-virtualenv" "python3-distutils") + dpkg_python_packages=("python3" "python3-virtualenv") rpm_python_packages=("python3") python3="python3" python_version=3 @@ -21,6 +21,9 @@ case ${distro} in debian|ubuntu) export LC_CTYPE=C.UTF-8 apt-get update + if [[ ! -z "$(apt-cache search ^${python3}-distutils$)" ]]; then + dpkg_python_packages+=("python3-distutils") + fi apt-get upgrade -y apt-get install -y --no-install-recommends \ git \