Skip to content

Instantly share code, notes, and snippets.

@detiber
Last active September 26, 2017 03:41
Show Gist options
  • Save detiber/db978de7a3d833adb36c0abb56ae9a52 to your computer and use it in GitHub Desktop.
Save detiber/db978de7a3d833adb36c0abb56ae9a52 to your computer and use it in GitHub Desktop.
Building and Testing OpenShift Origin for Alternative Arches

Building and Testing OpenShift Origin for Alternative Arches

Build/test tooling image

The official build/test tooling image (https://hub.docker.com/r/openshift/origin-release/) is used for providing a consistent and repeatable build and test environment for the OpenShift Origin CI/CD pipelines as well as for individual contributors as well. Currently the official image is x86_64 only, but you can find a pre-built manifest-list image that supports x86_64, ppc64le, and aarch64 here: https://hub.docker.com/r/openshiftmultiarch/origin-release/. The PR to update the official images for ppc64le and aarch64 can be found here: openshift/release#97

Using the openshiftmultiarch/origin-release image with hack/env

The hack/env script in the origin repository is used for invoking commands within the official origin-release image. It is possible to override which image is used by the tooling with the OS_BUILD_ENV_IMAGE environment variable. To override the default image and verify that you are running within an architecture specific image you could run:

git clone https://github.com/openshift/origin
cd origin
OS_BUILD_ENV_IMAGE=openshiftmultiarch/origin-release:golang-1.8 hack/env arch

Bootstrapping the origin-release image for the host architecture for local use

The following instructions assume x86_64/ppc64le/aarch64, using the CentOS paas7-openshift-multiarch-el7-build repository: http://cbs.centos.org/kojifiles/repos/paas7-openshift-multiarch-el7-build/latest/$basearch to provide required packages. For other architectures, an alternative source of packages is required. <base_os_image> refers to the base CentOS (or CentOS-like) image to start from, for x86_64 this is the standard centos:7 image. The upstream image name is used for the tag, so that the built image will be used for later steps without the need for overriding the image names.

export GOPATH=~/go
export PATH=${PATH}:${GOPATH}/bin
go get github.com/openshift/imagebuilder/cmd/imagebuilder
go get github.com/estesp/manifest-tool
git clone https://github.com/openshift/release
cd release/projects/origin-release/base
imagebuilder --from <base_os_image> -t openshift/origin-release:base
cd ../golang-1.8
imagebuilder -t openshift/origin-release:golang-1.8

Bootstrapping an alternative architecture image on a x86_64 host

The following instructions assume an x86_64 host running CentOS 7 or Red Hat Enterprise Linux 7

Prep steps:

yum install https://copr-be.cloud.fedoraproject.org/results/jdetiber/qemu-user-static/epel-7-x86_64/00601856-qemu-user-static/qemu-user-static-2.9.0-5.4.el7.x86_64.rpm
systemctl enable systemd-binfmt
systemctl start systemd-binfmt

After qemu-user-static is installed and the systemd-binfmt service has been started, you can then run the steps from the previous section, adding --mount /usr/bin/qemu-<arch>-static:/usr/bin/qemu-<arch>-static to the imagebuilder commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment