From cd8e356a401a44d38e7edf50aa36d3cbeb0bbfc0 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Mon, 26 Nov 2018 15:03:12 +0100 Subject: [PATCH] Add openSUSE Leap 15 VBMC image Co-Authored-By: Stephanie Miller Change-Id: I979fc15bde85f30d23d3c2a5ad720f90f7afa7b3 --- doc/source/vbmc.rst | 25 +++++++++++++++++++++++-- vbmc/Dockerfile.suse_15 | 33 +++++++++++++++++++++++++++++++++ zuul.d/vbmc.yaml | 20 +++++++++++--------- 3 files changed, 67 insertions(+), 11 deletions(-) create mode 100644 vbmc/Dockerfile.suse_15 diff --git a/doc/source/vbmc.rst b/doc/source/vbmc.rst index 04f6d3a4..e28ab8dc 100644 --- a/doc/source/vbmc.rst +++ b/doc/source/vbmc.rst @@ -5,8 +5,11 @@ vBMC container image This container builds a small image with kubectl and some other utilities for use in both the ironic checks and development. -Manual build for CentOS 7 -========================= +Manual build +============ + +CentOS 7 +-------- Here are the instructions for building CentOS 7 vBMC image: @@ -19,3 +22,21 @@ Alternatively, this step can be performed by running the script directly: .. code-block:: shell ./vbmc/build.sh + +openSUSE Leap 15 +---------------- + +To build an openSUSE leap 15 image, you can export varibles before +running the build script: + +.. code-block:: shell + + DISTRO=suse_15 ./vbmc/build.sh + +Should you want to have a specific version of vbmc for a different +openSUSE base image, you can use the extra arguments for the +build process, for example: + +.. code-block:: shell + + DISTRO=suse_15 extra_build_args="--build-args PROJECT_REF= --build-args FROM=" ./vbmc/build.sh diff --git a/vbmc/Dockerfile.suse_15 b/vbmc/Dockerfile.suse_15 new file mode 100644 index 00000000..0f89d65e --- /dev/null +++ b/vbmc/Dockerfile.suse_15 @@ -0,0 +1,33 @@ +ARG FROM=docker.io/opensuse/leap:15 +FROM ${FROM} +LABEL maintainers=stephane@alum.mit.edu +ARG PROJECT_REF=master +RUN set -ex ;\ + zypper update -y ;\ + zypper install -y --type pattern devel_basis ;\ + zypper install -y \ + ceph-common \ + git \ + libguestfs \ + libvirt \ + libvirt-daemon \ + libvirt-daemon-config-nwfilter \ + libvirt-daemon-driver-lxc \ + libvirt-daemon-driver-nwfilter \ + libvirt-devel \ + openvswitch \ + python-devel \ + python-xml \ + qemu-kvm ;\ + zypper clean ;\ + curl https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py ;\ + python /tmp/get-pip.py ;\ + rm -f /tmp/get-pip.py ;\ + TMP_DIR=$(mktemp -d) ;\ + git clone https://github.com/openstack/virtualbmc ${TMP_DIR} ;\ + cd ${TMP_DIR} && git checkout ${PROJECT_REF} && cd - ;\ + pip install -U ${TMP_DIR} ;\ + rm -rf ${TMP_DIR} ;\ + useradd --user-group --create-home --home-dir /var/lib/nova nova ;\ + chmod 755 /var/lib/nova ;\ + usermod -a -G qemu nova diff --git a/zuul.d/vbmc.yaml b/zuul.d/vbmc.yaml index c69737ce..fed1f770 100644 --- a/zuul.d/vbmc.yaml +++ b/zuul.d/vbmc.yaml @@ -20,16 +20,16 @@ # Alternatively, we can add a deploy using vbmc, and reuse # the deploy's functional testing - openstack-helm-images-vbmc-centos_7 + - openstack-helm-images-vbmc-suse_15 gate: jobs: - openstack-helm-images-vbmc-centos_7 + - openstack-helm-images-vbmc-suse_15 - job: name: openstack-helm-images-vbmc parent: openstack-helm-images-base abstract: true - files: - - ^vbmc/.* vars: image_path: vbmc @@ -46,10 +46,12 @@ # This is an example of how to re-use the jobs for # multi-distro. The image would get built with a # different tag, based on distro argument. -#- job: -# name: openstack-helm-images-vbmc-ubuntu_bionic -# parent: openstack-helm-images-vbmc -# files: -# - ^vbmc/Dockerfile.ubuntu_bionic$ -# vars: -# distro: "ubuntu_bionic" \ No newline at end of file +- job: + name: openstack-helm-images-vbmc-suse_15 + parent: openstack-helm-images-vbmc + files: + - ^vbmc/Dockerfile.suse_15 + - ^vbmc/build.sh + - ^zuul.d/vbmc.yaml + vars: + distro: "suse_15"