The topic is intended to share and discuss about the multi arch testing tips on Travis CI.
Motivation
Want to run and test a software not only on intel x86_64, but also on mobile, IoT device (ARM 64-bit, 32-bit) and HPC (super computer, PowerPC).
What we want to condier wit low level language programming such as C, C++, Golang.
Intel, ARM, PowerPC, and etc.
64-bit or 32-bit
Little-endian or Big-endian
Current solution
x86_64: (Intel, 64-bit, Little-endian): Use os: linux
ppc64le (Power PC, 64-bit, Little-endian): Use os: linux-ppc64le
Other solutions:
Use multiarch project (QEMU) and the docker container image. [1][2]
Use setarch
command with Ubuntu arch packages. [3]
The other solutions can test most arches covering 32-bit, big-endian. But can improve the user experience on Travis CI.
Related issues on travis-ci/travis-ci
References
Anything else?
If Travis CI is using AWS internally, here is a good news to support ARM like os: linux-aarch64
New – EC2 Instances (A1) Powered by Arm-Based AWS Graviton Processors
1 Like
See https://github.com/skvark/opencv-python/issues/13 . It’s currently possible to cross-compile things and run tests on an emulator.
Thanks for the info.
I see that opencv-python is doing something.
install: |
# Build and package
set -x
build_wheel $REPO_DIR $PLAT
set +x
script: |
# Install and run tests
set -x
install_run $PLAT && rc=$? || rc=$?
set +x
#otherwise, Travis logic terminates prematurely
#https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817
trap ERR
test "$rc" -eq 0
before_cache: |
# Cleanup dirs to be cached
It has multibuild that enables the build of x86_64 and i686, as a submodule.
I found that recently Docker announced “docker buildx” to build multi arch images.
Docker is making it easier than ever to develop containers on, and for Arm servers and devices. Using the standard tooling and processes you are already familiar with you can start to build, push, pull, and run images of different architectures....
While qemu-user-static needs the compatible multi arch container images, “docker buildx” might build the general multi-arch container images.
As users do not have to be conscious about using qemu (it seems “moby/qemu” is used internally), they might be able to use it casually.
Finally Travis Ci started supporting a native ARM 64 with “arch: arm64” syntax! Thank you, Travis.
We’re excited to share that you can now test your open source software on multiple CPU architectures at Travis CI.
For the past few months, we’ve been working closely with the Travis CI community,...
Now I want to see current syntax “os: linux-ppc64le” for ppc64le has the alias “arch: ppc64le”.
It seems arch: ppc64le
also works instead of os: linux-ppc64le
.
Yesterday Travis announced supporting ppc64le (IBM Power) and s390x (IBM Z). Thank you Travis!
Last month, we introduced the capability to build open source software for multiple CPU architectures. Today, we’re excited to extend that capability beyond arm64 and amd64 to using the same Travis...
So, I created the example to run in following “native” environments in Travis. “native” means to run without QEMU emulation.
amd64 (x86_64 = Intel, 64-bit, Little-endian)
arm64 (aarch64 = ARM, 64-bit, Little-endian)
ppc64le (IBM, PowerPC, Little-endian)
s390x (IBM, Z / Linux One, Big-endian)
i686 (Intel, 32-bit, Little-endian)
arm32 (armv8l = ARM 32-bit, Little-endian)