From 4c9097c681c937531132456a5f7443175b591b17 Mon Sep 17 00:00:00 2001 From: Trevor Vardeman Date: Wed, 17 Apr 2019 11:22:28 -0500 Subject: [PATCH] Adding changes to support ppc64le amphora builds with CentOS Updated diskimage create script to include an argument for disabling the temporary filesystem. Updated diskimage create to support ppc64le as an argument. Updated backports to support a properly configured PaaS repository for CentOS on power. Change-Id: I8897278b1ac8b76d564f45bd0c7cbc26b29a8e5d --- diskimage-create/README.rst | 4 +++- diskimage-create/diskimage-create.sh | 22 +++++++++++++------ .../pre-install.d/01-backports | 21 +++++++++++++++++- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/diskimage-create/README.rst b/diskimage-create/README.rst index bf8239ef7d..88d00a22cc 100644 --- a/diskimage-create/README.rst +++ b/diskimage-create/README.rst @@ -91,11 +91,12 @@ Command syntax: .. line-block:: $ diskimage-create.sh - [-a i386 | **amd64** | armhf ] + [-a i386 | **amd64** | armhf | ppc64le ] [-b **haproxy** ] [-c **~/.cache/image-create** | ] [-d **xenial**/**7** | trusty | ] [-e] + [-f] [-h] [-i **ubuntu** | fedora | centos | rhel ] [-l ] @@ -114,6 +115,7 @@ Command syntax: '-c' is the path to the cache directory (default: ~/.cache/image-create) '-d' distribution release id (default on ubuntu: xenial) '-e' enable complete mandatory access control systems when available (default: permissive) + '-f' disable tmpfs for build '-h' display help message '-i' is the base OS (default: ubuntu) '-l' is output logfile (default: none) diff --git a/diskimage-create/diskimage-create.sh b/diskimage-create/diskimage-create.sh index c71a462b35..eef9da6856 100755 --- a/diskimage-create/diskimage-create.sh +++ b/diskimage-create/diskimage-create.sh @@ -20,11 +20,12 @@ set -e usage() { echo echo "Usage: $(basename $0)" - echo " [-a i386 | **amd64** | armhf ]" + echo " [-a i386 | **amd64** | armhf | ppc64le]" echo " [-b **haproxy** ]" echo " [-c **~/.cache/image-create** | ]" echo " [-d **xenial**/**7** | trusty | ]" echo " [-e]" + echo " [-f]" echo " [-h]" echo " [-i **ubuntu-minimal** | fedora | centos | rhel ]" echo " [-l ]" @@ -43,6 +44,7 @@ usage() { echo " '-c' is the path to the cache directory (default: ~/.cache/image-create)" echo " '-d' distribution release id (default on ubuntu: xenial)" echo " '-e' enable complete mandatory access control systems when available (default: permissive)" + echo " '-f' disable tmpfs for build" echo " '-h' display this help message" echo " '-i' is the base OS (default: ubuntu)" echo " '-l' is output logfile (default: none)" @@ -85,12 +87,13 @@ dib_enable_tracing= AMP_LOGFILE="" -while getopts "a:b:c:d:ehi:l:no:pt:r:s:vw:x" opt; do +while getopts "a:b:c:d:efhi:l:no:pt:r:s:vw:x" opt; do case $opt in a) AMP_ARCH=$OPTARG if [ $AMP_ARCH != "i386" ] && \ [ $AMP_ARCH != "amd64" ] && \ + [ $AMP_ARCH != "ppc64le" ] && \ [ $AMP_ARCH != "armhf" ]; then echo "Error: Unsupported architecture " $AMP_ARCH " specified" exit 3 @@ -113,6 +116,9 @@ while getopts "a:b:c:d:ehi:l:no:pt:r:s:vw:x" opt; do e) AMP_ENABLE_FULL_MAC_SECURITY=1 ;; + f) + AMP_DISABLE_TMP_FS='--no-tmpfs' + ;; h) usage ;; @@ -138,7 +144,7 @@ while getopts "a:b:c:d:ehi:l:no:pt:r:s:vw:x" opt; do ;; o) AMP_OUTPUTFILENAME=$(readlink -f $OPTARG) - amp_dir=$(dirname $AMP_OUTPUTFILENAME) + amp_dir=$(dirname $AMP_OUTPUTFILENAME) if [ ! -d $amp_dir ]; then echo "Error: Directory $amp_dir does not exist" exit 3 @@ -215,6 +221,8 @@ AMP_PACKAGE_INSTALL=${AMP_PACKAGE_INSTALL:-0} AMP_ENABLE_FULL_MAC_SECURITY=${AMP_ENABLE_FULL_MAC_SECURITY:-0} +AMP_DISABLE_TMP_FS=${AMP_DISABLE_TMP_FS:-""} + if [ "$AMP_BASEOS" = "rhel" -o "$AMP_BASEOS" = "centos" -o "$AMP_BASEOS" = "fedora" ] && [ "$AMP_IMAGESIZE" -lt 3 ]; then echo "RHEL/centos based amphora requires an image size of at least 3GB" exit 1 @@ -288,7 +296,7 @@ if [ "$platform" = 'NAME="Ubuntu"' ]; then for pkg in $PKG_LIST; do if ! dpkg --get-selections | grep -q "^$pkg[[:space:]]*install$" >/dev/null; then echo "Required package " $pkg " is not installed. Exiting." - echo "Binary dependencies on this platform are: ${PKG_LIST}" + echo "Binary dependencies on this platform are: ${PKG_LIST}" exit 1 fi done @@ -308,7 +316,7 @@ elif [[ $platform =~ "SUSE" ]]; then for pkg in $PKG_LIST; do if ! rpm -q $pkg &> /dev/null; then echo "Required package " ${pkg/\*} " is not installed. Exiting." - echo "Binary dependencies on this platform are: ${PKG_LIST}" + echo "Binary dependencies on this platform are: ${PKG_LIST}" exit 1 fi done @@ -320,7 +328,7 @@ else for pkg in $PKG_LIST; do if ! rpm -qa $pkg ; then echo "Required package " ${pkg/\*} " is not installed. Exiting." - echo "Binary dependencies on this platform are: ${PKG_LIST}" + echo "Binary dependencies on this platform are: ${PKG_LIST}" exit 1 fi done @@ -405,7 +413,7 @@ if [ -n "$dib_enable_tracing" ]; then dib_trace_arg="-x" fi -disk-image-create $AMP_LOGFILE $dib_trace_arg -a $AMP_ARCH -o $AMP_OUTPUTFILENAME -t $AMP_IMAGETYPE --image-size $AMP_IMAGESIZE --image-cache $AMP_CACHEDIR $AMP_element_sequence +disk-image-create $AMP_LOGFILE $dib_trace_arg -a $AMP_ARCH -o $AMP_OUTPUTFILENAME -t $AMP_IMAGETYPE --image-size $AMP_IMAGESIZE --image-cache $AMP_CACHEDIR $AMP_DISABLE_TMP_FS $AMP_element_sequence popd > /dev/null # out of $TEMP rm -rf $TEMP diff --git a/elements/haproxy-octavia/pre-install.d/01-backports b/elements/haproxy-octavia/pre-install.d/01-backports index 570428e1e0..9613d446fb 100755 --- a/elements/haproxy-octavia/pre-install.d/01-backports +++ b/elements/haproxy-octavia/pre-install.d/01-backports @@ -7,11 +7,30 @@ set -o xtrace if [ "$DISTRO_NAME" == "ubuntu" ] && [ "$DIB_RELEASE" == "trusty" ]; then echo deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse > /etc/apt/sources.list.d/backports.list elif [ "$DISTRO_NAME" == "centos7" ]; then + case $ARCH in ## Change this to an environment variable from DIB?! + x86_64|amd64) + BASEURL=http://mirror.centos.org/\$contentdir/\$releasever/paas/\$basearch/openshift-origin/ + ;; + ppc64le) + # For ppc64le, the CentOS PaaS sig does not currently publish a repo + # even though it does build everything for that architecture. Until + # there is an official repo, the publish buildroot can be used. One + # down-side to doing this is that the build root contains *all* of the + # CentOS-base, CentOS-extras, and CentOS-updates content. To ensure + # *only* `haproxy18` is retrieved from this repo, the explicit limit + # for that package can be used. This should be fine for now since + # haproxy18's dependencies are available outside this repo. If things + # change, the includepkgs line can be expanded as needed. + BASEURL=https://cbs.centos.org/kojifiles/repos/paas7-openshift-multiarch-el7-build/latest/\$basearch/ + INCLUDEPKGS='includepkgs=haproxy*' + ;; + esac cat > /etc/yum.repos.d/CentOS-PaaS.repo <