From 0acfaab7b10208093d89cb63a1f39336f4d67894 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Wed, 28 Nov 2018 14:52:40 +0100 Subject: [PATCH] Add openstack-helm repo images This adds the building of the images present in the OpenStack-Helm repository. Images follow the same process as images from the osh-infra repository. Kubernetes-entrypoint is not used anymore and therefore was not migrated over. Likewise, LOCI is not following these images building process, and therefore will be included in a different patch. The manual build script do not expose the extra arguments previously exposed, like KUBE_VERSION or OVS_VERSION by default. It also means a future tagged version of this repository will use the KUBE_VERSION or OVS_VERSION that are in tree, and therefore very explicit. Change-Id: If4ff73c37ed8bccb9f6951f3ccdbb7640e9b55a5 --- ceph-config-helper/Dockerfile.ubuntu_xenial | 40 +++++++++++++++ ceph-config-helper/build.sh | 14 ++++++ doc/source/ceph-config-helper.rst | 22 ++++++++ doc/source/gate-utils.rst | 24 +++++++++ doc/source/index.rst | 4 ++ doc/source/openvswitch.rst | 24 +++++++++ doc/source/tempest.rst | 21 ++++++++ gate-utils/Dockerfile.debian | 3 ++ gate-utils/build.sh | 14 ++++++ openvswitch/Dockerfile.debian | 56 +++++++++++++++++++++ openvswitch/build.sh | 14 ++++++ tempest/Dockerfile.ubuntu_xenial | 24 +++++++++ tempest/build.sh | 14 ++++++ zuul.d/ceph-config-helper.yaml | 44 ++++++++++++++++ zuul.d/gate-utils.yaml | 44 ++++++++++++++++ zuul.d/openvswitch.yaml | 44 ++++++++++++++++ zuul.d/tempest.yaml | 44 ++++++++++++++++ 17 files changed, 450 insertions(+) create mode 100644 ceph-config-helper/Dockerfile.ubuntu_xenial create mode 100755 ceph-config-helper/build.sh create mode 100644 doc/source/ceph-config-helper.rst create mode 100644 doc/source/gate-utils.rst create mode 100644 doc/source/openvswitch.rst create mode 100644 doc/source/tempest.rst create mode 100644 gate-utils/Dockerfile.debian create mode 100755 gate-utils/build.sh create mode 100644 openvswitch/Dockerfile.debian create mode 100755 openvswitch/build.sh create mode 100644 tempest/Dockerfile.ubuntu_xenial create mode 100755 tempest/build.sh create mode 100644 zuul.d/ceph-config-helper.yaml create mode 100644 zuul.d/gate-utils.yaml create mode 100644 zuul.d/openvswitch.yaml create mode 100644 zuul.d/tempest.yaml diff --git a/ceph-config-helper/Dockerfile.ubuntu_xenial b/ceph-config-helper/Dockerfile.ubuntu_xenial new file mode 100644 index 00000000..14c0eb4d --- /dev/null +++ b/ceph-config-helper/Dockerfile.ubuntu_xenial @@ -0,0 +1,40 @@ +FROM docker.io/ubuntu:xenial +LABEL maintainer="pete.birley@att.com" + +ARG KUBE_VERSION=v1.10.3 +ARG CEPH_RELEASE=luminous + +ADD https://download.ceph.com/keys/release.asc /etc/apt/ceph-release.asc +RUN set -ex ;\ + export DEBIAN_FRONTEND=noninteractive ;\ + apt-key add /etc/apt/ceph-release.asc ;\ + rm -f /etc/apt/ceph-release.asc ;\ + echo deb http://download.ceph.com/debian-${CEPH_RELEASE}/ xenial main | tee /etc/apt/sources.list.d/ceph.list ;\ + TMP_DIR=$(mktemp --directory) ;\ + cd ${TMP_DIR} ;\ + apt-get update ;\ + apt-get dist-upgrade -y ;\ + apt-get install --no-install-recommends -y \ + apt-transport-https \ + ca-certificates \ + ceph \ + curl \ + gcc \ + python \ + python-dev \ + jq ;\ + curl -sSL https://bootstrap.pypa.io/get-pip.py | python ;\ + pip --no-cache-dir install --upgrade \ + crush \ + rgwadmin \ + six \ + python-openstackclient \ + python-swiftclient ;\ + curl -sSL https://dl.k8s.io/${KUBE_VERSION}/kubernetes-client-linux-amd64.tar.gz | tar -zxv --strip-components=1 ;\ + mv ${TMP_DIR}/client/bin/kubectl /usr/bin/kubectl ;\ + chmod +x /usr/bin/kubectl ;\ + rm -rf ${TMP_DIR} ;\ + apt-get purge -y --auto-remove \ + python-dev \ + gcc ;\ + rm -rf /var/lib/apt/lists/* diff --git a/ceph-config-helper/build.sh b/ceph-config-helper/build.sh new file mode 100755 index 00000000..bc14b13d --- /dev/null +++ b/ceph-config-helper/build.sh @@ -0,0 +1,14 @@ +#!/bin/bash +SCRIPT=`realpath $0` +SCRIPT_DIR=`dirname ${SCRIPT}` +## Only build from main folder +cd ${SCRIPT_DIR}/.. + +IMAGE="ceph-config-helper" +VERSION=${VERSION:-latest} +DISTRO=${DISTRO:-ubuntu_xenial} +REGISTRY_URI=${REGISTRY_URI:-"openstackhelm/"} +EXTRA_TAG_INFO=${EXTRA_TAG_INFO:-""} +docker build -f ${IMAGE}/Dockerfile.${DISTRO} --network=host -t ${REGISTRY_URI}${IMAGE}:${VERSION}-${DISTRO}${EXTRA_TAG_INFO} ${extra_build_args} ${IMAGE} + +cd - diff --git a/doc/source/ceph-config-helper.rst b/doc/source/ceph-config-helper.rst new file mode 100644 index 00000000..036f5f94 --- /dev/null +++ b/doc/source/ceph-config-helper.rst @@ -0,0 +1,22 @@ +================================== +ceph-config-helper container image +================================== + +This container builds a small image with kubectl and some other +utilites for use in the ceph charts or interact with a ceph +deployment. + +Manual build for Ubuntu Xenial +============================== + +Here are the instructions for building Xenial image: + +.. literalinclude:: ../../ceph-config-helper/build.sh + :lines: 7-12 + :language: shell + +Alternatively, this step can be performed by running the script directly: + +.. code-block:: shell + + ./ceph-config-helper/build.sh diff --git a/doc/source/gate-utils.rst b/doc/source/gate-utils.rst new file mode 100644 index 00000000..5a4cb9fc --- /dev/null +++ b/doc/source/gate-utils.rst @@ -0,0 +1,24 @@ +========================== +gate-utils container image +========================== + +This container builds a small image with ipcalc for use in both the +multinode checks and development. + +Manual build +============ + +Debian +------ + +Here are the instructions for building the default Debian image: + +.. literalinclude:: ../../gate-utils/build.sh + :lines: 7-12 + :language: shell + +Alternatively, this step can be performed by running the script directly: + +.. code-block:: shell + + ./gate-utils/build.sh diff --git a/doc/source/index.rst b/doc/source/index.rst index 7687a18c..acf87199 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -63,7 +63,11 @@ an overview of the build process for each container. :maxdepth: 2 :caption: Contents: + ceph-config-helper + gate-utils libvirt mariadb + openvswitch + tempest vbmc loci diff --git a/doc/source/openvswitch.rst b/doc/source/openvswitch.rst new file mode 100644 index 00000000..efdd0e4a --- /dev/null +++ b/doc/source/openvswitch.rst @@ -0,0 +1,24 @@ +=========================== +OpenvSwitch container image +=========================== + +This container builds a small image with OpenvSwitch for use with +OpenStack-Helm. + +Manual build +============ + +Debian +------ + +Here are the instructions for building the default Debian image: + +.. literalinclude:: ../../openvswitch/build.sh + :lines: 7-12 + :language: shell + +Alternatively, this step can be performed by running the script directly: + +.. code-block:: shell + + ./openvswitch/build.sh diff --git a/doc/source/tempest.rst b/doc/source/tempest.rst new file mode 100644 index 00000000..5a32098a --- /dev/null +++ b/doc/source/tempest.rst @@ -0,0 +1,21 @@ +======================= +Tempest container image +======================= + +This image is installing tempest with a few tempest plugins from the +head of the master branch in OpenStack. + +Manual build for Ubuntu Xenial +============================== + +Here are the instructions for building Xenial image: + +.. literalinclude:: ../../tempest/build.sh + :lines: 7-12 + :language: shell + +Alternatively, this step can be performed by running the script directly: + +.. code-block:: shell + + ./tempest/build.sh diff --git a/gate-utils/Dockerfile.debian b/gate-utils/Dockerfile.debian new file mode 100644 index 00000000..25c16a92 --- /dev/null +++ b/gate-utils/Dockerfile.debian @@ -0,0 +1,3 @@ +FROM gcr.io/google-containers/debian-base-amd64:0.3 + +RUN /usr/local/bin/clean-install ipcalc diff --git a/gate-utils/build.sh b/gate-utils/build.sh new file mode 100755 index 00000000..2bef3880 --- /dev/null +++ b/gate-utils/build.sh @@ -0,0 +1,14 @@ +#!/bin/bash +SCRIPT=`realpath $0` +SCRIPT_DIR=`dirname ${SCRIPT}` +## Only build from main folder +cd ${SCRIPT_DIR}/.. + +IMAGE="gate-utils" +VERSION=${VERSION:-latest} +DISTRO=${DISTRO:-debian} +REGISTRY_URI=${REGISTRY_URI:-"openstackhelm/"} +EXTRA_TAG_INFO=${EXTRA_TAG_INFO:-""} +docker build -f ${IMAGE}/Dockerfile.${DISTRO} --network=host -t ${REGISTRY_URI}${IMAGE}:${VERSION}-${DISTRO}${EXTRA_TAG_INFO} ${extra_build_args} ${IMAGE} + +cd - diff --git a/openvswitch/Dockerfile.debian b/openvswitch/Dockerfile.debian new file mode 100644 index 00000000..61e28a51 --- /dev/null +++ b/openvswitch/Dockerfile.debian @@ -0,0 +1,56 @@ +FROM k8s.gcr.io/debian-iptables-amd64:v10 +LABEL maintainer="pete.birley@att.com" + +ARG OVS_VERSION=2.8.1 + +RUN set -ex ;\ + export DEBIAN_FRONTEND=noninteractive ;\ + apt-get update ;\ + apt-get upgrade -y ;\ + apt-get install --no-install-recommends -y \ + bash ;\ + apt-get install --no-install-recommends -y \ + build-essential \ + curl \ + libatomic1 \ + libssl1.1 \ + openssl \ + uuid-runtime \ + graphviz \ + autoconf \ + automake \ + bzip2 \ + debhelper \ + dh-autoreconf \ + libssl-dev \ + libtool \ + python-all \ + python-six \ + python-twisted-conch \ + python-zopeinterface ;\ + TMP_DIR=$(mktemp -d) ;\ + curl -sSL http://openvswitch.org/releases/openvswitch-${OVS_VERSION}.tar.gz | tar xz -C ${TMP_DIR} --strip-components=1 ;\ + cd ${TMP_DIR} ;\ + ./boot.sh ;\ + ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc ;\ + make ;\ + make install ;\ + cd / ;\ + rm -rf ${TMP_DIR} ;\ + apt-get purge --auto-remove -y \ + build-essential \ + curl \ + graphviz \ + autoconf \ + automake \ + bzip2 \ + debhelper \ + dh-autoreconf \ + libssl-dev \ + libtool \ + python-all \ + python-six \ + python-twisted-conch \ + python-zopeinterface ;\ + clean-install \ + iproute2 ;\ diff --git a/openvswitch/build.sh b/openvswitch/build.sh new file mode 100755 index 00000000..e608e5b2 --- /dev/null +++ b/openvswitch/build.sh @@ -0,0 +1,14 @@ +#!/bin/bash +SCRIPT=`realpath $0` +SCRIPT_DIR=`dirname ${SCRIPT}` +## Only build from main folder +cd ${SCRIPT_DIR}/.. + +IMAGE="openvswitch" +VERSION=${VERSION:-latest} +DISTRO=${DISTRO:-debian} +REGISTRY_URI=${REGISTRY_URI:-"openstackhelm/"} +EXTRA_TAG_INFO=${EXTRA_TAB_INFO:-""} +docker build -f ${IMAGE}/Dockerfile.${DISTRO} --network=host -t ${REGISTRY_URI}${IMAGE}:${VERSION}-${DISTRO}${EXTRA_TAG_INFO} ${extra_build_args} ${IMAGE} + +cd - diff --git a/tempest/Dockerfile.ubuntu_xenial b/tempest/Dockerfile.ubuntu_xenial new file mode 100644 index 00000000..2a3e3c8f --- /dev/null +++ b/tempest/Dockerfile.ubuntu_xenial @@ -0,0 +1,24 @@ +FROM ubuntu:16.04 + +RUN set -ex ;\ + export DEBIAN_FRONTEND=noninteractive ;\ + apt-get update ;\ + apt-get upgrade -y ;\ + apt-get install netbase -y ;\ + apt-get install --no-install-recommends -y \ + python-dev \ + build-essential \ + python-pip \ + git ;\ + git clone https://git.openstack.org/openstack/tempest ;\ + git clone https://git.openstack.org/openstack/cinder-tempest-plugin ;\ + git clone https://git.openstack.org/openstack/heat-tempest-plugin ;\ + git clone https://git.openstack.org/openstack/keystone-tempest-plugin ;\ + git clone https://git.openstack.org/openstack/neutron-tempest-plugin ;\ + pip install -U setuptools ;\ + pip install wheel ;\ + pip install -e tempest/ \ + cinder-tempest-plugin/ \ + heat-tempest-plugin/ \ + keystone-tempest-plugin/ \ + neutron-tempest-plugin/ ;\ diff --git a/tempest/build.sh b/tempest/build.sh new file mode 100755 index 00000000..b230e540 --- /dev/null +++ b/tempest/build.sh @@ -0,0 +1,14 @@ +#!/bin/bash +SCRIPT=`realpath $0` +SCRIPT_DIR=`dirname ${SCRIPT}` +## Only build from main folder +cd ${SCRIPT_DIR}/.. + +IMAGE="tempest" +VERSION=${VERSION:-latest} +DISTRO=${DISTRO:-ubuntu_xenial} +REGISTRY_URI=${REGISTRY_URI:-"openstackhelm/"} +EXTRA_TAG_INFO=${EXTRA_TAG_INFO:-""} +docker build -f ${IMAGE}/Dockerfile.${DISTRO} --network=host -t ${REGISTRY_URI}${IMAGE}:${VERSION}-${DISTRO}${EXTRA_TAG_INFO} ${extra_build_args} ${IMAGE} + +cd - diff --git a/zuul.d/ceph-config-helper.yaml b/zuul.d/ceph-config-helper.yaml new file mode 100644 index 00000000..c70d4f25 --- /dev/null +++ b/zuul.d/ceph-config-helper.yaml @@ -0,0 +1,44 @@ +--- +# Copyright 2018, SUSE LINUX GmbH. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- project: + check: + jobs: + - openstack-helm-images-ceph-config-helper-ubuntu_xenial + gate: + jobs: + - openstack-helm-images-ceph-config-helper-ubuntu_xenial + #experimental: + # jobs: + # - openstack-helm-infra-five-ubuntu + +- job: + name: openstack-helm-images-ceph-config-helper + parent: openstack-helm-images-base + abstract: true + files: + - ^ceph-config-helper/.* + vars: + image_path: ceph-config-helper + +- job: + name: openstack-helm-images-ceph-config-helper-ubuntu_xenial + parent: openstack-helm-images-ceph-config-helper + files: + - ^ceph-config-helper/build.sh + - ^ceph-config-helper/Dockerfile.ubuntu_xenial$ + - ^zuul.d/ceph-config-helper.yaml + vars: + distro: "ubuntu_xenial" diff --git a/zuul.d/gate-utils.yaml b/zuul.d/gate-utils.yaml new file mode 100644 index 00000000..8d7e8d5e --- /dev/null +++ b/zuul.d/gate-utils.yaml @@ -0,0 +1,44 @@ +--- +# Copyright 2018, SUSE LINUX GmbH. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- project: + check: + jobs: + - openstack-helm-images-gate-utils-debian + gate: + jobs: + - openstack-helm-images-gate-utils-debian + #experimental: + # jobs: + # - openstack-helm-infra-five-ubuntu + +- job: + name: openstack-helm-images-gate-utils + parent: openstack-helm-images-base + abstract: true + files: + - ^gate-utils/.* + vars: + image_path: gate-utils + +- job: + name: openstack-helm-images-gate-utils-debian + parent: openstack-helm-images-gate-utils + files: + - ^gate-utils/build.sh + - ^gate-utils/Dockerfile.debian$ + - ^zuul.d/gate-utils.yaml + vars: + distro: "debian" diff --git a/zuul.d/openvswitch.yaml b/zuul.d/openvswitch.yaml new file mode 100644 index 00000000..21ba36b8 --- /dev/null +++ b/zuul.d/openvswitch.yaml @@ -0,0 +1,44 @@ +--- +# Copyright 2018, SUSE LINUX GmbH. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- project: + check: + jobs: + - openstack-helm-images-openvswitch-debian + gate: + jobs: + - openstack-helm-images-openvswitch-debian + #experimental: + # jobs: + # - openstack-helm-infra-five-ubuntu + +- job: + name: openstack-helm-images-openvswitch + parent: openstack-helm-images-base + abstract: true + files: + - ^openvswitch/.* + vars: + image_path: openvswitch + +- job: + name: openstack-helm-images-openvswitch-debian + parent: openstack-helm-images-openvswitch + files: + - ^openvswitch/build.sh + - ^openvswitch/Dockerfile.debian$ + - ^zuul.d/openvswitch.yaml + vars: + distro: "debian" diff --git a/zuul.d/tempest.yaml b/zuul.d/tempest.yaml new file mode 100644 index 00000000..6d23850e --- /dev/null +++ b/zuul.d/tempest.yaml @@ -0,0 +1,44 @@ +--- +# Copyright 2018, SUSE LINUX GmbH. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- project: + check: + jobs: + - openstack-helm-images-tempest-ubuntu_xenial + gate: + jobs: + - openstack-helm-images-tempest-ubuntu_xenial + #experimental: + # jobs: + # - openstack-helm-infra-five-ubuntu + +- job: + name: openstack-helm-images-tempest + parent: openstack-helm-images-base + abstract: true + files: + - ^tempest/.* + vars: + image_path: tempest + +- job: + name: openstack-helm-images-tempest-ubuntu_xenial + parent: openstack-helm-images-tempest + files: + - ^tempest/build.sh + - ^tempest/Dockerfile.ubuntu_xenial$ + - ^zuul.d/tempest.yaml + vars: + distro: "ubuntu_xenial"