Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[minor] Support ppc64le architecture #21

Open
wants to merge 29 commits into
base: stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6b71c61
[patch] travis clean
shajeena Feb 24, 2025
14f75ed
[patch] travis clean
shajeena Feb 24, 2025
781d991
[patch] travis clean
shajeena Feb 24, 2025
a887285
[patch] travis clean
shajeena Feb 24, 2025
c9df3a3
[patch] travis clean
shajeena Feb 24, 2025
ba16ed3
[patch] workflow clean
shajeena Feb 24, 2025
3c84fcc
[patch] workflow clean
shajeena Feb 24, 2025
8d46efe
[patch] workflow clean
shajeena Feb 24, 2025
5d62fa5
[patch] workflow clean
shajeena Feb 24, 2025
2a3ed6a
[patch] Support for ppc64le
shajeena Feb 24, 2025
761da22
[patch] Support for ppc64le
shajeena Feb 24, 2025
ef91516
[patch] Support for ppc64le
shajeena Feb 24, 2025
6c5a967
[patch] Support for ppc64le
shajeena Feb 24, 2025
1b5c6d5
[patch] Support for ppc64le
shajeena Feb 24, 2025
500d30a
[patch] Support for ppc64le
shajeena Feb 24, 2025
913c5f3
[patch] Support for ppc64le
shajeena Feb 25, 2025
603bd5d
[patch] Support for ppc64le
shajeena Feb 25, 2025
1e7e913
[patch] Support for ppc64le
shajeena Feb 25, 2025
ccc8dd2
[patch] Support for ppc64le
shajeena Feb 26, 2025
be5141a
[patch] Support for ppc64le
shajeena Feb 26, 2025
61c6f31
[patch] Support for ppc64le
shajeena Feb 26, 2025
3b65aeb
[patch] Support for ppc64le
shajeena Feb 26, 2025
81b2b5f
[patch] Support for ppc64le
shajeena Feb 26, 2025
55620b7
[patch] Support for ppc64le
shajeena Feb 28, 2025
0d4fe1e
[patch] Support for ppc64le
shajeena Mar 5, 2025
43b4b8d
Merge branch 'stable' into multiarch-power
durera Mar 5, 2025
8156e61
[patch] Support for ppc64le
shajeena Mar 5, 2025
fa543d5
Merge remote-tracking branch 'origin/multiarch-power' into multiarch-…
shajeena Mar 5, 2025
58d4cd5
[patch] Support for ppc64le
shajeena Mar 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 28 additions & 56 deletions .github/workflows/build-cli-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
tags-ignore: [ "**" ]
release:
types: [ published ]
env:
ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
QUAYIO_USERNAME: ${{ secrets.QUAYIO_USERNAME }}
QUAYIO_PASSWORD: ${{ secrets.QUAYIO_PASSWORD }}

jobs:
build-amd64:
Expand All @@ -27,23 +31,7 @@ jobs:
- name: Build the docker image (amd64)
run: |
echo "GITHUB_REF=$GITHUB_REF"
echo "GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME"

# Login to quay.io
docker login --username "${{ secrets.QUAYIO_USERNAME }}" --password "${{ secrets.QUAYIO_PASSWORD }}" quay.io

# Build the image
$GITHUB_WORKSPACE/build/bin/docker-build.sh -r quay.io/ibmmas/cli-base --target-platform amd64 -b image/cli-base

# Squash the image layers
python3 -m pip install docker-squash
docker-squash --load-image --tag quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-amd64 quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-amd64

# List available images
docker images

# Push the images
docker push quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-amd64
source $GITHUB_WORKSPACE/build/bin/build.sh amd64

build-s390x:
name: Build Image (s390x)
Expand All @@ -63,31 +51,31 @@ jobs:
source $GITHUB_WORKSPACE/build/bin/.functions.sh

- name: Build the docker image (s390x)
env:
ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
run: |
echo "GITHUB_REF=$GITHUB_REF"
echo "GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME"
source $GITHUB_WORKSPACE/build/bin/build.sh s390x

# Login to quay.io
docker login --username "${{ secrets.QUAYIO_USERNAME }}" --password "${{ secrets.QUAYIO_PASSWORD }}" quay.io

# Before we build the s390x image we need to download some pre-build dependencies from Artifactory
wget --header="Authorization:Bearer $ARTIFACTORY_TOKEN" https://na.artifactory.swg-devops.com/artifactory/wiotp-generic-local/dependencies/rclone/rclone.tar.gz -O $GITHUB_WORKSPACE/image/cli-base/install/rclone.tar.gz
python3 $GITHUB_WORKSPACE/build/bin/python-collect-prebuilt-wheels.py --req-file $GITHUB_WORKSPACE/image/cli-base/install/requirements.txt --dest $GITHUB_WORKSPACE/image/cli-base/install/ --add-dependency cryptography

# Build the images
$GITHUB_WORKSPACE/build/bin/docker-build.sh -r quay.io/ibmmas/cli-base --target-platform s390x -b image/cli-base

# Squash the image layers
python3 -m pip install docker-squash
docker-squash --load-image --tag quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-s390x quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-s390x
build-ppc64lc:
name: Build Image (ppc64lc)
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[doc]') }}
steps:
- name: Checkout
uses: actions/checkout@v4
# Without this option, we don't get the tag information
with:
fetch-depth: 0

# List available images
docker images
- name: Initialise the build system
run: |
chmod u+x $GITHUB_WORKSPACE/build/bin/*.sh
$GITHUB_WORKSPACE/build/bin/initbuild.sh
source $GITHUB_WORKSPACE/build/bin/.functions.sh

# Push the images
docker push quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-s390x
- name: Build the docker image (ppc64lc)
run: |
echo "GITHUB_REF=$GITHUB_REF"
source $GITHUB_WORKSPACE/build/bin/build.sh ppc64le

build-arm64:
name: Build Image (arm64)
Expand All @@ -108,24 +96,7 @@ jobs:

- name: Build the docker image (arm64)
run: |
echo "GITHUB_REF=$GITHUB_REF"
echo "GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME"

# Login to quay.io
docker login --username "${{ secrets.QUAYIO_USERNAME }}" --password "${{ secrets.QUAYIO_PASSWORD }}" quay.io

# Build the image
$GITHUB_WORKSPACE/build/bin/docker-build.sh -r quay.io/ibmmas/cli-base --target-platform arm64 -b image/cli-base

# # Squash the image layers
python3 -m pip install docker-squash
docker-squash --load-image --tag quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-arm64 quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-arm64

# List available images
docker images

# Push the images
docker push quay.io/ibmmas/cli-base:${{ env.DOCKER_TAG }}-arm64
source $GITHUB_WORKSPACE/build/bin/build.sh arm64

build-manifest:
name: Build Manifest
Expand All @@ -134,6 +105,7 @@ jobs:
- build-amd64
- build-s390x
- build-arm64
- build-ppc64lc
if: ${{ !contains(github.event.head_commit.message, '[doc]') }}
steps:
- name: Checkout
Expand All @@ -157,7 +129,7 @@ jobs:
docker login --username "${{ secrets.QUAYIO_USERNAME }}" --password "${{ secrets.QUAYIO_PASSWORD }}" quay.io

# Publish the manifest
$GITHUB_WORKSPACE/build/bin/docker-manifest.sh -r quay.io/ibmmas/cli-base --target-platforms amd64,s390x,arm64
$GITHUB_WORKSPACE/build/bin/docker-manifest.sh -r quay.io/ibmmas/cli-base --target-platforms amd64,s390x,arm64,ppc64le

# Re-issue the manifest under an alias where needed
# https://github.com/docker/buildx/issues/1744#issuecomment-1896645786
Expand Down
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ This base container image allows us to build the CLI faster by separating the bu

Provides:

| content | amd64 | s390x | arm64 |
| --- | --- |------| ----|
| `python3` v3.9 | ✔️ | ✔️ | ✔️ |
| `ibmcloud` v2.30.0 | ✔️ | ✔️ | ✔️ |
| `aws` | ✔️ | ❌ | ✔️ |
| `helm` v3 | ✔️ | ✔️ | ✔️ |
| `mongosh` v2.3.3 | ✔️ | ✔️ | ✔️ |
| `mongodump` v100.10.0 | ✔️ | ✔️ | ✔️ |
| `oc` | ✔️ | ✔️ | ✔️ |
| `oc mirror` | ✔️ | ✔️ | ✔️ |
| `oc ibm-pak` v1.16.2 | ✔️ | ✔️ | ✔️ |
| `skopeo` | ✔️ | ✔️ | ✔️ |
| `nano` | ✔️ | ✔️ | ✔️ |
| `jq` | ✔️ | ✔️ | ✔️ |
| `yq` v4.44.5 | ✔️ | ✔️ | ✔️ |
| `tini` v0.19.0 | ✔️ | ✔️ | ✔️ |
| `rclone` | ✔️ | ✔️ | ✔️ |
| `rosa` | ✔️ | ❌ ️ | ✔️ |
| `boto3` | ✔️ | ✔️ | ✔️ |
| `argocd` | ✔️ | ✔️ | ✔️ |
| content | amd64 | s390x | arm64 | ppc64le |
| --- | --- |------| ----|----------------------------------------------|
| `python3` v3.9 | ✔️ | ✔️ | ✔️ | ✔️ |
| `ibmcloud` v2.30.0 | ✔️ | ✔️ | ✔️ | ✔️ |
| `aws` | ✔️ | ❌ | ✔️ | ❌ |
| `helm` v3 | ✔️ | ✔️ | ✔️ | ✔️ |
| `mongosh` v2.3.3 | ✔️ | ✔️ | ✔️ | ✔️ |
| `mongodump` v100.10.0 | ✔️ | ✔️ | ✔️ | ✔️ |
| `oc` | ✔️ | ✔️ | ✔️ | ✔️ |
| `oc mirror` | ✔️ | ✔️ | ✔️ | ✔️ |
| `oc ibm-pak` v1.16.2 | ✔️ | ✔️ | ✔️ | * Plug-in container-service is not supported |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this just needs to be the red X, or it will break the table formatting

| `skopeo` | ✔️ | ✔️ | ✔️ | ✔️ |
| `nano` | ✔️ | ✔️ | ✔️ | ✔️ |
| `jq` | ✔️ | ✔️ | ✔️ | ✔️ |
| `yq` v4.44.5 | ✔️ | ✔️ | ✔️ | ✔️ |
| `tini` v0.19.0 | ✔️ | ✔️ | ✔️ | ✔️ |
| `rclone` | ✔️ | ✔️ | ✔️ | ✔️ |
| `rosa` | ✔️ | ❌ ️ | ✔️ | ❌ |
| `boto3` | ✔️ | ✔️ | ✔️ | ✔️ |
| `argocd` | ✔️ | ✔️ | ✔️ | ✔️ |
27 changes: 27 additions & 0 deletions build/bin/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -e

TARGET_PLATFORM=$1
echo "GITHUB_REF=$GITHUB_REF"
echo "GITHUB_EVENT_NAME=$GITHUB_EVENT_NAME"

# Login to quay.io
docker login --username $QUAYIO_USERNAME --password $QUAYIO_PASSWORD quay.io
if [[ "$TARGET_PLATFORM" == "s390x" || "$TARGET_PLATFORM" == "ppc64le" ]]; then
# Before we build the s390x image we need to download some pre-build dependencies from Artifactory
echo "in ... $TARGET_PLATFORM"
wget --header="Authorization:Bearer $ARTIFACTORY_TOKEN" https://na.artifactory.swg-devops.com/artifactory/wiotp-generic-local/dependencies/rclone/$TARGET_PLATFORM/rclone.tar.gz -O $GITHUB_WORKSPACE/image/cli-base/install/rclone.tar.gz
python3 $GITHUB_WORKSPACE/build/bin/python-collect-prebuilt-wheels.py --req-file $GITHUB_WORKSPACE/image/cli-base/install/requirements.txt --dest $GITHUB_WORKSPACE/image/cli-base/install/ --add-dependency cryptography --target-platform $TARGET_PLATFORM
fi
# Build the image
$GITHUB_WORKSPACE/build/bin/docker-build.sh -r quay.io/ibmmas/cli-base --target-platform $TARGET_PLATFORM -b image/cli-base

# Squash the image layers
python3 -m pip install docker-squash
docker-squash --load-image --tag quay.io/ibmmas/cli-base:$DOCKER_TAG-$TARGET_PLATFORM quay.io/ibmmas/cli-base:$DOCKER_TAG-$TARGET_PLATFORM

# List available images
docker images

# Push the images
docker push quay.io/ibmmas/cli-base:$DOCKER_TAG-$TARGET_PLATFORM
Loading
Loading