diff --git a/openvswitch/Dockerfile.debian b/openvswitch/Dockerfile.debian deleted file mode 100644 index 165b266e..00000000 --- a/openvswitch/Dockerfile.debian +++ /dev/null @@ -1,57 +0,0 @@ -ARG FROM=k8s.gcr.io/debian-iptables-amd64:v10 -FROM ${FROM} -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/Dockerfile.suse_15 b/openvswitch/Dockerfile.suse_15 deleted file mode 100644 index fe399f3b..00000000 --- a/openvswitch/Dockerfile.suse_15 +++ /dev/null @@ -1,10 +0,0 @@ -ARG FROM=docker.io/opensuse/leap:15 -FROM ${FROM} -LABEL maintainers=stephane@alum.mit.edu - -RUN set -ex ;\ - zypper refresh ;\ - zypper up -y ;\ - zypper install -y bash ;\ - zypper install -y \ - openvswitch diff --git a/openvswitch/Dockerfile.suse_15-dpdk b/openvswitch/Dockerfile.suse_15-dpdk deleted file mode 100644 index aadc0029..00000000 --- a/openvswitch/Dockerfile.suse_15-dpdk +++ /dev/null @@ -1,10 +0,0 @@ -ARG FROM=docker.io/opensuse/leap:15.0 -FROM ${FROM} -LABEL maintainers=mbuil@suse.com - -RUN set -ex ;\ - zypper refresh ;\ - zypper up -y ;\ - zypper install -y bash \ - openvswitch dpdk;\ - zypper clean --all diff --git a/openvswitch/Dockerfile.ubuntu b/openvswitch/Dockerfile.ubuntu new file mode 100644 index 00000000..322baa11 --- /dev/null +++ b/openvswitch/Dockerfile.ubuntu @@ -0,0 +1,7 @@ +ARG FROM=docker.io/ubuntu:jammy +FROM ${FROM} + +RUN set -ex && \ + apt-get update && \ + apt-get install -y openvswitch-switch && \ + rm -rf /var/lib/apt/lists/* diff --git a/openvswitch/Dockerfile.ubuntu-dpdk b/openvswitch/Dockerfile.ubuntu-dpdk new file mode 100644 index 00000000..2d0e9d8a --- /dev/null +++ b/openvswitch/Dockerfile.ubuntu-dpdk @@ -0,0 +1,28 @@ +ARG FROM=docker.io/ubuntu:jammy +FROM ${FROM} + +ARG DEBIAN_FRONTEND=noninteractive + +RUN set -ex && \ + apt-get update && \ + apt-get -y upgrade && \ + apt-get install --no-install-recommends -y \ + iproute2 \ + iptables \ + pciutils \ + jq \ + tcpdump && \ + apt-get install --install-recommends -y \ + openvswitch-switch \ + openvswitch-switch-dpdk \ + libdpdk-dev \ + ovn-central \ + ovn-host \ + ovn-controller-vtep && \ + update-alternatives --set ovs-vswitchd /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk && \ + rm -rf \ + /var/cache/debconf/* \ + /var/lib/apt/lists/* \ + /var/log/* \ + /tmp/* \ + /var/tmp/* diff --git a/openvswitch/Dockerfile.ubuntu_bionic b/openvswitch/Dockerfile.ubuntu_bionic deleted file mode 100644 index 8eac2f92..00000000 --- a/openvswitch/Dockerfile.ubuntu_bionic +++ /dev/null @@ -1,8 +0,0 @@ -ARG FROM=docker.io/ubuntu:bionic -FROM ${FROM} -LABEL maintainer="cheng1.li@intel.com" - -RUN set -ex; \ - apt-get update; \ - apt-get install -y openvswitch-switch; \ - rm -rf /var/lib/apt/lists/* diff --git a/openvswitch/Dockerfile.ubuntu_bionic-dpdk b/openvswitch/Dockerfile.ubuntu_bionic-dpdk deleted file mode 100644 index 20f0dae3..00000000 --- a/openvswitch/Dockerfile.ubuntu_bionic-dpdk +++ /dev/null @@ -1,122 +0,0 @@ -ARG FROM=docker.io/ubuntu:bionic -FROM ${FROM} -LABEL maintainer="cheng1.li@intel.com" - -# Options to compile ovs-dpdk either from source (DPDK and OVS) or -# install it from package. By default package install is enabled. -# For src compile pass following build-args. -ARG OVS_SRC_COMPILE_VERSION="2.11.1" -ARG DPDK_SRC_COMPILE_VERSION="18.11.5" - -# URL to fetch the code package from. The package name should follow -# this naming convention: openvswitch-${OVS_SRC_COMPILE_VERSION}.tar.gz -ARG OVS_SRC_URL="http://openvswitch.org/releases" - -# URL to fetch the code package from. The package name should follow -# this naming convention: dpdk-${DPDK_SRC_COMPILE_VERSION}.tar.xz -ARG DPDK_SRC_URL="http://fast.dpdk.org/rel" - -# Option to apply any patch to DPDK or OVS sources, in case using -# source compilation. For this ensure the patch file is kept in -# same folder as this Dockerfile, and pass following build-args. -ARG OVS_PATCH_FILE_NAME="" -ARG DPDK_PATCH_FILE_NAME="" - -# Any extra compile-time flags for OVS -ARG OVS_EXTRA_COMPILE_FLAGS="" - -# Any extra compile-time flags for DPDK -ARG DPDK_EXTRA_COMPILE_FLAGS="" - -ADD Dockerfile.ubuntu_bionic-dpdk ${OVS_PATCH_FILE_NAME}* ${DPDK_PATCH_FILE_NAME}* ./ - -RUN set -ex;\ - rm -rf Dockerfile.ubuntu_bionic-dpdk ;\ - apt-get update; \ - if [ -n "$OVS_SRC_COMPILE_VERSION" -a -n "$DPDK_SRC_COMPILE_VERSION" ]; then \ - if [ -n "$OVS_PATCH_FILE_NAME" ]; then \ - OVS_PATCH_TMP_DIR=$(mktemp -d) ;\ - mv ./${OVS_PATCH_FILE_NAME} ${OVS_PATCH_TMP_DIR}/${OVS_PATCH_FILE_NAME} ;\ - fi ;\ - if [ -n "$DPDK_PATCH_FILE_NAME" ]; then \ - DPDK_PATCH_TMP_DIR=$(mktemp -d) ;\ - mv ./${DPDK_PATCH_FILE_NAME} ${DPDK_PATCH_TMP_DIR}/${DPDK_PATCH_FILE_NAME} ;\ - fi ;\ - 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 \ - libpcap-dev \ - libnuma-dev ;\ - TMP_DIR=$(mktemp -d) ;\ - curl -sSL ${DPDK_SRC_URL}/dpdk-${DPDK_SRC_COMPILE_VERSION}.tar.xz | tar xJ -C ${TMP_DIR} --strip-components=1 ;\ - export DPDK_DIR=${TMP_DIR} ;\ - cd ${DPDK_DIR} ;\ - if [ -d "$DPDK_PATCH_TMP_DIR" ]; then \ - patch -p1 < ${DPDK_PATCH_TMP_DIR}/${DPDK_PATCH_FILE_NAME} ;\ - fi ;\ - export DPDK_TARGET=x86_64-native-linuxapp-gcc ;\ - export DPDK_BUILD=${DPDK_DIR}/build ;\ - make config T=${DPDK_TARGET} ;\ - cd ${DPDK_BUILD} ;\ - sed -i 's/CONFIG_RTE_KNI_KMOD=.*$/CONFIG_RTE_KNI_KMOD=n/' .config ;\ - sed -i 's/CONFIG_RTE_LIBRTE_KNI=.*$/CONFIG_RTE_LIBRTE_KNI=n/' .config ;\ - sed -i 's/CONFIG_RTE_EAL_IGB_UIO=.*$/CONFIG_RTE_EAL_IGB_UIO=n/' .config ;\ - make -j $(nproc) EXTRA_CFLAGS='-Ofast -fPIC' MACHINE_CFLAGS="-march=native" ${DPDK_EXTRA_COMPILE_FLAGS};\ - make install ;\ - TMP_DIR=$(mktemp -d) ;\ - curl -sSL ${OVS_SRC_URL}/openvswitch-${OVS_SRC_COMPILE_VERSION}.tar.gz | tar xz -C ${TMP_DIR} --strip-components=1 ;\ - cd ${TMP_DIR} ;\ - if [ -d "$OVS_PATCH_TMP_DIR" ]; then \ - patch -p1 < ${OVS_PATCH_TMP_DIR}/${OVS_PATCH_FILE_NAME} ;\ - fi ;\ - ./boot.sh ;\ - ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --with-dpdk=$DPDK_BUILD CFLAGS="-Ofast -g -march=native" ${OVS_EXTRA_COMPILE_FLAGS} ;\ - make -j $(nproc) CFLAGS="-Ofast -g -march=native" ${OVS_EXTRA_COMPILE_FLAGS} ;\ - make install ;\ - cd / ;\ - rm -rf ${DPDK_DIR} ;\ - rm -rf ${TMP_DIR} ;\ - rm -rf ${OVS_PATCH_TMP_DIR} ;\ - rm -rf ${DPDK_PATCH_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 ;\ - else \ - apt-get install -y openvswitch-switch-dpdk ;\ - update-alternatives --set ovs-vswitchd /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk ;\ - fi ;\ - apt-get install --no-install-recommends -y iproute2 tcpdump conntrack ;\ - apt-get install --no-install-recommends -y python3 python3-dev python3-pip python3-setuptools ;\ - pip3 --no-cache-dir install ovs netifaces ;\ - rm -rf /var/lib/apt/lists/* ;\ diff --git a/openvswitch/Dockerfile.ubuntu_focal b/openvswitch/Dockerfile.ubuntu_focal deleted file mode 100644 index 6c5f1cb8..00000000 --- a/openvswitch/Dockerfile.ubuntu_focal +++ /dev/null @@ -1,8 +0,0 @@ -ARG FROM=docker.io/ubuntu:focal -FROM ${FROM} -LABEL maintainer="mnaser@vexxhost.com" - -RUN set -ex; \ - apt-get update; \ - apt-get install -y openvswitch-switch; \ - rm -rf /var/lib/apt/lists/* diff --git a/openvswitch/Dockerfile.ubuntu_jammy b/openvswitch/Dockerfile.ubuntu_jammy deleted file mode 100644 index f8e9309b..00000000 --- a/openvswitch/Dockerfile.ubuntu_jammy +++ /dev/null @@ -1,7 +0,0 @@ -ARG FROM=docker.io/ubuntu:jammy -FROM ${FROM} - -RUN set -ex; \ - apt-get update; \ - apt-get install -y openvswitch-switch; \ - rm -rf /var/lib/apt/lists/* diff --git a/openvswitch/build.sh b/openvswitch/build.sh index e608e5b2..97856930 100755 --- a/openvswitch/build.sh +++ b/openvswitch/build.sh @@ -6,9 +6,10 @@ cd ${SCRIPT_DIR}/.. IMAGE="openvswitch" VERSION=${VERSION:-latest} -DISTRO=${DISTRO:-debian} +DISTRO=${DISTRO:-ubuntu} +DISTRO_VERSION=${DISTRO_VERSION:-focal} 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} +docker build -f ${IMAGE}/Dockerfile.${DISTRO} --network=host --build-arg="FROM=${DISTRO}:${DISTRO_VERSION}" -t ${REGISTRY_URI}${IMAGE}:${VERSION}-${DISTRO}${EXTRA_TAG_INFO} ${extra_build_args} ${IMAGE} cd - diff --git a/zuul.d/openvswitch.yaml b/zuul.d/openvswitch.yaml index 44d13035..818e6e18 100644 --- a/zuul.d/openvswitch.yaml +++ b/zuul.d/openvswitch.yaml @@ -40,28 +40,36 @@ docker_images: - context: openvswitch repository: openstackhelm/openvswitch - dockerfile: Dockerfile.ubuntu_bionic - tags: - - latest-ubuntu_bionic - - "ubuntu_bionic-{{ currentdate }}" - - context: openvswitch - repository: openstackhelm/openvswitch - dockerfile: Dockerfile.ubuntu_bionic-dpdk - tags: - - latest-ubuntu_bionic-dpdk - - "ubuntu_bionic-dpdk-{{ currentdate }}" - - context: openvswitch - repository: openstackhelm/openvswitch - dockerfile: Dockerfile.ubuntu_focal + dockerfile: Dockerfile.ubuntu tags: - latest-ubuntu_focal - "ubuntu_focal-{{ currentdate }}" + build_args: + - FROM=ubuntu:focal - context: openvswitch repository: openstackhelm/openvswitch - dockerfile: Dockerfile.ubuntu_jammy + dockerfile: Dockerfile.ubuntu-dpdk + tags: + - latest-ubuntu_focal-dpdk + - "ubuntu_focal-dpdk-{{ currentdate }}" + build_args: + - FROM=ubuntu:focal + - context: openvswitch + repository: openstackhelm/openvswitch + dockerfile: Dockerfile.ubuntu tags: - latest-ubuntu_jammy - "ubuntu_jammy-{{ currentdate }}" + build_args: + - FROM=ubuntu:jammy + - context: openvswitch + repository: openstackhelm/openvswitch + dockerfile: Dockerfile.ubuntu-dpdk + tags: + - latest-ubuntu_jammy-dpdk + - "ubuntu_jammy-dpdk-{{ currentdate }}" + build_args: + - FROM=ubuntu:jammy files: &openvswitch_files - openvswitch/.* - zuul.d/openvswitch.yaml