okd-project / okd-payload-pipeline

Apache License 2.0
14 stars 15 forks source link

Implement a multi-arch native Shipwright CustomBuildStrategy based on buildah #28

Closed aleskandro closed 1 year ago

aleskandro commented 1 year ago

This PR adds the implementation of a multi-arch native CustomBuildStrategy for Shipwright to build the multi-arch OKD payload on ISA-heterogeneous clusters with buildah and without cross-architecture emulation.

It is based on the Buildah sample from Shipwright. However, Shipwright BuildRuns are executed in Tekton TaskRuns, and a TaskRun cannot spawn multiple pods. The proposed ClusterBuildStrategy exploits the pipeline serviceAccount capability to manage the jobs/pods lifecycle and offloads the execution of the builds to multiple pods scheduled in nodes with different architectures. Those pods and their output artifacts are coordinated in the steps prepare-build and wait-manifests-complete through FIFO special files acting as inter-pod synchronization channels.

Other features improving the upstream Buildah ClusterBuildStrategy for the OKD payload building pipelines include:

Some works could be considered a workaround and might need an RFE to discuss with the Shipwright community.

Also, some steps currently download the kubectl tool, based on the Kubernetes version of the cluster where they run. An image including the kubectl cli might replace this.

The automatic replacement of the openshift/api in go.mod for specified component (OKD-68) is not taken into account in this PR. It could be a follow-up with other features to conclude the porting to Shipwright.

Refers OKD-71