Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions Containerfile.iib-build-task
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ RUN curl -s -L https://github.com/operator-framework/operator-registry/releases/
tar -xzf oras.tar.gz && rm oras.tar.gz && ls -la && mv oras /usr/bin/oras && chmod +x /usr/bin/oras && \
chmod +x /usr/bin/opm-*

# Copy the multi-arch builder script
COPY task/iib-image-builder-oci-ta/multi-arch-builder.py /usr/local/bin/multi-arch-builder.py
RUN chmod +x /usr/local/bin/multi-arch-builder.py

ENTRYPOINT ["/usr/bin/bash"]
34 changes: 29 additions & 5 deletions task/iib-image-builder-oci-ta/iib-image-builder-oci-ta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ spec:
type: string
default: overlay
- name: PLATFORMS
description: Comma-separated list of platforms to build for (e.g., linux/amd64,linux/arm64,linux/ppc64le,linux/s390x)
description: Comma-separated list of platforms to build for (e.g., amd64,arm64,ppc64le,s390x)
type: string
default: "linux/amd64,linux/arm64,linux/ppc64le,linux/s390x"
default: "amd64,arm64,ppc64le,s390x"
- name: OPM_VERSION
description: OPM version to use for cache generation
type: string
Expand Down Expand Up @@ -75,8 +75,6 @@ spec:
description: Image reference of the built multi-arch image
- name: IMAGE_URL
description: Image repository and tag where the built image was pushed
- name: BUILD_RESULTS
description: JSON file containing detailed build results
volumes:
- name: shared
emptyDir: {}
Expand Down Expand Up @@ -174,6 +172,32 @@ spec:

echo "[$(date --utc -Ins)] Starting multi-architecture build with Python orchestration"

# Run the Python build script
python3 -u /usr/local/bin/multi-arch-builder.py \
--ca-bundle /mnt/trusted-ca/ca-bundle.crt \
--output /var/workdir/build-results.json

# Extract results for Tekton
if [ -f "/var/workdir/build-results.json" ]; then
# Extract digest
jq -r '.digest' /var/workdir/build-results.json > $(results.IMAGE_DIGEST.path)

# Extract image URL
jq -r '.image_name' /var/workdir/build-results.json > $(results.IMAGE_URL.path)

# Create image reference
IMAGE_NAME=$(jq -r '.image_name' /var/workdir/build-results.json)
DIGEST=$(jq -r '.digest' /var/workdir/build-results.json)
echo "${IMAGE_NAME}@${DIGEST}" > $(results.IMAGE_REF.path)

# Log build summary
echo "=== Build Summary ==="
echo "Image: $IMAGE_NAME"
echo "Digest: $DIGEST"
echo "Platforms: $(jq -r '.platforms | join(", ")' /var/workdir/build-results.json)"
echo "OPM Version: $(jq -r '.opm_version' /var/workdir/build-results.json)"
fi

echo "[$(date --utc -Ins)] Multi-architecture build completed"
volumeMounts:
- mountPath: /var/lib/containers
Expand All @@ -185,4 +209,4 @@ spec:
capabilities:
add:
- SETFCAP
runAsUser: 0
runAsUser: 0
Loading