Skip to content

Commit

Permalink
Issue 3950 - Fix issue with ppc64 builds
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Courliss <[email protected]>
  • Loading branch information
Ben Courliss committed Nov 21, 2023
1 parent 170dbfd commit e8fa668
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 59 deletions.
2 changes: 2 additions & 0 deletions .github/scripts/configure_versions_script.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eo pipefail

# Get current versions
ORIG_ANAX_IMAGE_VERSION=$(sed -n 's/export VERSION ?= //p' Makefile | cut -d '$' -f 1 | sed 's/ *$//g')
ORIG_CSS_IMAGE_VERSION=$(sed -n 's/CSS_IMAGE_VERSION ?= //p' Makefile | cut -d '$' -f 1 | sed 's/ *$//g')
Expand Down
26 changes: 0 additions & 26 deletions .github/scripts/docker_build_script.sh

This file was deleted.

26 changes: 0 additions & 26 deletions .github/scripts/docker_push_script.sh

This file was deleted.

2 changes: 2 additions & 0 deletions .github/scripts/package_push.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -eo pipefail

# Deal with Debian Package First
# Make the temp Dockerfile for the debs only tarball image
## Chose alpine:latest b/c of small size, tried FROM scratch but couldn't run container
Expand Down
53 changes: 50 additions & 3 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,18 +289,65 @@ jobs:
# Build Docker Images
- name: Build Docker Images
shell: bash
if: (matrix.architecture == 'amd64' || matrix.architecture == 'ppc64el' || matrix.architecture == 'arm64' || matrix.architecture == 's390x')
run: |
run: |
# Makes and pushes arch_cloud-sync-service and arch_edge-sync-service images
cd ${GOPATH}/src/github.com/${GITHUB_REPOSITORY}
./.github/scripts/docker_build_script.sh
if [[ ${arch} == 'amd64' || ${arch} == 'ppc64el' || ${arch} == 'arm64' || ${arch} == 's390x' ]]; then
make ess-docker-image
make css-docker-image
fi
# Makes and pushes amd64_agbot image
if [[ ${arch} == 'amd64' ]]; then
make agbot-image
fi
# Specify if we should use buildx for multiarch, github runner is amd64 so we only need this for arm and ppc
if [[ ${arch} == 'arm64' || ${arch} == 'ppc64el' || ${arch} == 's390x' ]]; then
export USE_DOCKER_BUILDX=true
fi
make anax-image # Makes and pushes arch_anax
make anax-k8s-image # Makes and pushes arch_anax_k8s
make auto-upgrade-cronjob-k8s-image # Makes and pushes arch_auto-upgrade-cronjob-k8s
# Outputs created docker images for viewing
echo "**************"
docker images
echo "**************"
# Push Docker Images to Dockerhub
- name: Push Docker Images
shell: bash
if: (matrix.architecture == 'amd64' || matrix.architecture == 'ppc64el' || matrix.architecture == 'arm64' || matrix.architecture == 's390x')
run: |
cd ${GOPATH}/src/github.com/${GITHUB_REPOSITORY}
./.github/scripts/docker_push_script.sh
# Names of the images created for each architecture
if [[ ${arch} == 'amd64' ]]; then
images=('amd64_agbot' 'amd64_anax' 'amd64_anax_k8s' 'amd64_auto-upgrade-cronjob_k8s' 'amd64_cloud-sync-service' 'amd64_edge-sync-service')
elif [[ ${arch} == 'ppc64el' ]]; then
images=('ppc64el_anax' 'ppc64el_anax_k8s' 'ppc64el_auto-upgrade-cronjob_k8s' 'ppc64el_edge-sync-service')
elif [[ ${arch} == 'arm64' ]]; then
images=('arm64_anax' 'arm64_anax_k8s' 'arm64_auto-upgrade-cronjob_k8s' 'arm64_edge-sync-service')
elif [[ ${arch} == 's390x' ]]; then
images=('s390x_anax' 's390x_anax_k8s' 's390x_auto-upgrade-cronjob_k8s' 's390x_edge-sync-service')
fi
# Push those images
for image in "${images[@]}"; do
if [[ ${GITHUB_REF} == 'refs/heads/master' ]]; then
docker push ${IMAGE_REPO}/${image}:testing
docker tag ${IMAGE_REPO}/${image}:testing ${GITHUB_CONTAINER_REGISTRY}/${image}:testing
docker push ${GITHUB_CONTAINER_REGISTRY}/${image}:testing
else
# append the branch name to testing tags for when we're building older versions of anax for testing
docker tag ${IMAGE_REPO}/${image}:testing ${IMAGE_REPO}/${image}:testing_${GH_BRANCH}
docker push ${IMAGE_REPO}/${image}:testing_${GH_BRANCH}
fi
done
# Build our mac packages on a macOS runner
mac-build:
Expand Down
4 changes: 3 additions & 1 deletion anax-in-container/Dockerfile.ubi.ppc64el
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ COPY EPEL.repo /etc/yum.repos.d
# Install docker cli, which requires tar / gunzip to unpack, then remove tar / gzip packages
# Create required directories
ARG REQUIRED_RPMS="openssl ca-certificates shadow-utils jq iptables vim-minimal psmisc procps-ng tar gzip"
RUN microdnf update -y --nodocs --setopt=install_weak_deps=0 --disableplugin=subscription-manager \
RUN microdnf clean all \
&& rm -rf /var/cache/dnf /var/cache/PackageKit \
&& microdnf update -y --nodocs --nobest --setopt=install_weak_deps=0 --disableplugin=subscription-manager \
&& microdnf install -y --nodocs --setopt=install_weak_deps=0 --disableplugin=subscription-manager ${REQUIRED_RPMS} \
&& curl -4fsSLO https://download.docker.com/linux/static/stable/ppc64le/docker-${DOCKER_VER}.tgz \
&& tar xzvf docker-${DOCKER_VER}.tgz --strip 1 -C /usr/bin docker/docker \
Expand Down
4 changes: 3 additions & 1 deletion anax-in-k8s/Dockerfile.ubi.auto-upgrade-cron.ppc64el
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ COPY EPEL.repo /etc/yum.repos.d
# Create required directories
# Create cronjobuser
ARG REQUIRED_RPMS="shadow-utils jq"
RUN microdnf update -y --nodocs --setopt=install_weak_deps=0 --disableplugin=subscription-manager \
RUN microdnf clean all \
&& rm -rf /var/cache/dnf /var/cache/PackageKit \
&& microdnf update -y --nodocs --nobest --setopt=install_weak_deps=0 --disableplugin=subscription-manager \
&& microdnf install -y --nodocs --setopt=install_weak_deps=0 --disableplugin=subscription-manager ${REQUIRED_RPMS} \
&& microdnf clean all --disableplugin=subscription-manager \
&& rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.* \
Expand Down
4 changes: 3 additions & 1 deletion anax-in-k8s/Dockerfile.ubi.ppc64el
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ COPY EPEL.repo /etc/yum.repos.d
# anax does not use iptables directly but the github.com/coreos/go-iptables/iptables dependency needs the directory structure
# Create required directories
ARG REQUIRED_RPMS="openssl ca-certificates shadow-utils jq iptables vim-minimal psmisc procps-ng"
RUN microdnf update -y --nodocs --setopt=install_weak_deps=0 --disableplugin=subscription-manager \
RUN microdnf clean all \
&& rm -rf /var/cache/dnf /var/cache/PackageKit \
&& microdnf update -y --nodocs --nobest --setopt=install_weak_deps=0 --disableplugin=subscription-manager \
&& microdnf install -y --nodocs --setopt=install_weak_deps=0 --disableplugin=subscription-manager ${REQUIRED_RPMS} \
&& microdnf clean all --disableplugin=subscription-manager \
&& rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.* \
Expand Down
4 changes: 3 additions & 1 deletion ess/image/edge-sync-service-ppc64el/Dockerfile.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ LABEL summary="Edge node Model Management System."
LABEL description="Provides the edge node side of the Model Management System to be used by the CLI service test tools when also testing object models."

# yum is not installed, use microdnf instead
RUN microdnf update -y --nodocs --setopt=install_weak_deps=0 --disableplugin=subscription-manager \
RUN microdnf clean all \
&& rm -rf /var/cache/dnf /var/cache/PackageKit \
&& microdnf update -y --nodocs --nobest --setopt=install_weak_deps=0 --disableplugin=subscription-manager \
&& microdnf install -y --nodocs openssl ca-certificates --setopt=install_weak_deps=0 --disableplugin=subscription-manager \
&& microdnf clean all --disableplugin=subscription-manager \
&& rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.* \
Expand Down

0 comments on commit e8fa668

Please sign in to comment.