Skip to content

Commit

Permalink
Added support for s390x and ppc64le via catalog source
Browse files Browse the repository at this point in the history
Co-authored-by: Rehan Khan <[email protected]>
Co-authored-by: Deepali Kushwah <[email protected]>
Signed-off-by: Rehan Khan <[email protected]>
  • Loading branch information
R3hankhan123 and Deepali Kushwah committed Nov 4, 2024
1 parent d40dba0 commit 0f0fb43
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 52 deletions.
63 changes: 22 additions & 41 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,48 +192,29 @@ jobs:
else
echo "VERSION=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Run make catalog (main)
if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }}
run: |
make catalog \
REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} \
VERSION=${{ env.VERSION }} \
IMAGE_TAG=${{ github.sha }} \
AUTHORINO_VERSION=${{ env.LATEST_AUTHORINO_GITREF }} \
CHANNELS=${{ inputs.channels }}
- name: Run make catalog (release)
if: ${{ github.ref_name != env.MAIN_BRANCH_NAME }}
run: |
make catalog \
REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} \
VERSION=${{ env.VERSION }} \
AUTHORINO_VERSION=${{ github.event.inputs.authorinoVersion }} \
CHANNELS=${{ inputs.channels }}
- name: Git diff
run: git diff
- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
- name: Install opm from OpenShift Mirror
uses: redhat-actions/openshift-tools-installer@v1
with:
image: ${{ env.OPERATOR_NAME }}-catalog
tags: ${{ env.IMG_TAGS }}
platforms: linux/amd64,linux/arm64
context: ./catalog
dockerfiles: |
./catalog/${{ env.OPERATOR_NAME }}-catalog.Dockerfile
- name: Push Image
if: ${{ !env.ACT }}
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
opm: "4.14.4"
- name: Set permissions for build script
run: chmod +x ./script/build_catalog.sh
- name: Login to Quay.io
uses: docker/login-action@v1
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}
registry: ${{ secrets.IMG_REGISTRY_HOST || 'quay.io' }}
username: ${{ secrets.IMG_REGISTRY_USERNAME }}
password: ${{ secrets.IMG_REGISTRY_TOKEN }}
- name: Print Image URL
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: build and push catalog (main)
if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }}
shell: bash
env:
TAG: ${{ env.IMG_TAGS }}
run: ./script/build_catalog.sh
- name: build and push catalog (release)
if: ${{ github.ref_name != env.MAIN_BRANCH_NAME }}
shell: bash
env:
TAG: ${{ env.IMG_TAGS }}
run: ./script/build_catalog.sh
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,6 @@ spec:
EOF
```

## Deploy authorino operator using operator-sdk
1. Install operator-sdk bin
```sh
make operator-sdk
```
2. Run operator-sdk bundle command
```
./bin/operator-sdk run bundle quay.io/kuadrant/authorino-operator-bundle:latest
```
Note: For s390x & ppc64le , use operator-sdk to install authorino-operator

## Requesting an Authorino instance

Once the Operator is up and running, you can request instances of Authorino by creating `Authorino` CRs. E.g.:
Expand Down
40 changes: 40 additions & 0 deletions script/build_catalog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env bash
# builds the OLM catalog index and pushes it to quay.io.
#
# To push to your own registry, override the IMG_REGISTRY_HOST , IMG_REGISTRY_ORG , OPERATOR_NAME and TAG env vars,
# i.e:
# IMG_REGISTRY_HOST=quay.io IMG_REGISTRY_ORG=yourusername OPERATOR_NAME=authorino-operator TAG=latest ./script/build_catalog.sh
#
# REQUIREMENTS:
# * a valid login session to a container registry.
# * `docker`
# * `opm`
#

# Iterate over tag list i.e. latest 8a17c81d5e9f04545753e5501dddc4a0ac2c7e03
IFS=' ' read -r -a tags <<< "$TAG"

for tag in "${tags[@]}"
do
# Build & push catalog images for each architecture using the tag
opm index add --build-tool docker --tag "${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-catalog:${tag}-amd64" --bundles "${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-bundle:${tag}" --binary-image "quay.io/operator-framework/opm:v1.28.0-amd64"
docker push ${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-catalog:${tag}-amd64

opm index add --build-tool docker --tag "${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-catalog:${tag}-ppc64le" --bundles "${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-bundle:${tag}" --binary-image "quay.io/operator-framework/opm:v1.28.0-ppc64le"
docker push ${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-catalog:${tag}-ppc64le

opm index add --build-tool docker --tag "${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-catalog:${tag}-arm64" --bundles "${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-bundle:${tag}" --binary-image "quay.io/operator-framework/opm:v1.28.0-arm64"
docker push ${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-catalog:${tag}-arm64

opm index add --build-tool docker --tag "${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-catalog:${tag}-s390x" --bundles "${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-bundle:${tag}" --binary-image "quay.io/operator-framework/opm:v1.28.0-s390x"
docker push ${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-catalog:${tag}-s390x

# Create a multi-architecture manifest
docker manifest create --amend ${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-catalog:${tag} \
${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-catalog:${tag}-amd64 \
${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-catalog:${tag}-arm64 \
${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-catalog:${tag}-ppc64le \
${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-catalog:${tag}-s390x

docker manifest push ${IMG_REGISTRY_HOST}/${IMG_REGISTRY_ORG}/${OPERATOR_NAME}-catalog:${tag}
done

0 comments on commit 0f0fb43

Please sign in to comment.