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:
Replacing contexts (for example, images in the FROM statements of Containerfiles) via the build-contexts array parameter
Replacing the first FROM statement ((--)from in buildah)
A custom parameter and handler (runtime-stage-from) to replace the last FROM statement and emulate the OKD's BuildConfig behavior
The possibility to set requests and limits via parameters in the Build objects
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.
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:
(--)from
in buildah)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