From: Stefano Stabellini Date: Tue, 24 Nov 2020 21:08:20 +0000 (-0800) Subject: automation: add tests artifacts X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~1252 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e1681ce44cab50317fba33774b93c56c18fcae64;p=xen.git automation: add tests artifacts Some tests (soon to come) will require pre-built binaries to run, such as the Linux kernel binary. We don't want to rebuild the Linux kernel for each gitlab-ci run: these builds should not be added to the current list of build jobs. Instead, create additional containers that today are built and uploaded manually, but could be re-built automatically. The containers build the required binarires during the "docker build" step and store them inside the container itself. gitlab-ci will be able to fetch these pre-built binaries during the regular test runs, saving cycles. Add two tests artifacts containers: - one to build the Linux kernel ARM64 - one to create an Alpine Linux ARM64 rootfs for Dom0 Signed-off-by: Stefano Stabellini Acked-by: Wei Liu --- diff --git a/automation/tests-artifacts/Makefile b/automation/tests-artifacts/Makefile new file mode 100644 index 0000000000..8ca71b78ad --- /dev/null +++ b/automation/tests-artifacts/Makefile @@ -0,0 +1,19 @@ + +# the base of where these containers will appear +REGISTRY := registry.gitlab.com/xen-project/xen/tests-artifacts +CONTAINERS = $(subst .dockerfile,,$(wildcard */*.dockerfile)) + +help: + @echo "Containers to build and export tests artifacts." + @echo "To build one run 'make ARTIFACT/VERSION'. Available containers:" + @$(foreach file,$(sort $(CONTAINERS)),echo ${file};) + @echo "To push container builds, set the env var PUSH" + +%: %.dockerfile ## Builds containers + docker build -t $(REGISTRY)/$(@D):$(@F) -f $< $(> /etc/securetty && \ + echo "hvc0" >> /etc/securetty && \ + echo "ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100" >> /etc/inittab && \ + echo "hvc0::respawn:/sbin/getty -L hvc0 115200 vt100" >> /etc/inittab && \ + passwd -d "root" root && \ + \ + # Create rootfs + cd / && \ + tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var diff --git a/automation/tests-artifacts/kernel/5.9.9-arm64v8.dockerfile b/automation/tests-artifacts/kernel/5.9.9-arm64v8.dockerfile new file mode 100644 index 0000000000..053d65a345 --- /dev/null +++ b/automation/tests-artifacts/kernel/5.9.9-arm64v8.dockerfile @@ -0,0 +1,34 @@ +FROM arm64v8/debian:unstable +LABEL maintainer.name="The Xen Project" \ + maintainer.email="xen-devel@lists.xenproject.org" + +ENV DEBIAN_FRONTEND=noninteractive +ENV LINUX_VERSION=5.9.9 +ENV USER root + +RUN mkdir /build +WORKDIR /build + +# build depends +RUN apt-get update && \ + apt-get --quiet --yes install \ + build-essential \ + libssl-dev \ + bc \ + curl \ + flex \ + bison \ + && \ + \ + # Build the kernel + curl -fsSLO https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-"$LINUX_VERSION".tar.xz && \ + tar xvJf linux-"$LINUX_VERSION".tar.xz && \ + cd linux-"$LINUX_VERSION" && \ + make defconfig && \ + make -j$(nproc) Image.gz && \ + cp arch/arm64/boot/Image / && \ + cd /build && \ + rm -rf linux-"$LINUX_VERSION"* && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*