ci: Switch the baremetal runner to be an x86 docker image.
authorEric Anholt <eric@anholt.net>
Wed, 13 May 2020 18:08:08 +0000 (11:08 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 18 May 2020 19:39:46 +0000 (19:39 +0000)
The runner is an x86 system, so running the ARM image meant doing
everything at runtime under qemu, and for the xz of the test rootfs that
was quite expensive.  Also, we can rebuild x86 images much faster than we
can rebuild arm images for container development, which will help unblock
some of the other feature parity work I have to do versus the old docker
system that cheza is using.

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5033>

.gitlab-ci.yml
.gitlab-ci/container/x86_cross_arm_test.sh [new file with mode: 0644]

index 6e1ff7d2b108bfce71bcfb4a494f4ec86046599d..33649095cba03b852837f5f3de6ab8a3c638b388 100644 (file)
@@ -186,6 +186,20 @@ arm_build:
   needs:
     - arm_build
 
+# x86 image with ARM rootfses for baremetal testing.
+x86_cross_arm_test:
+  extends: x86_build
+  variables:
+    FDO_DISTRIBUTION_TAG: &x86_cross_arm_test "2020-05-13"
+
+.use-x86_cross_arm_test:
+  variables:
+    TAG: *x86_cross_arm_test
+  image: "$CI_REGISTRY_IMAGE/debian/x86_cross_arm_test:$TAG"
+  needs:
+    - x86_cross_arm_test
+
+
 # Debian 10 based ARM test image
 arm_test:
   extends: arm_build
@@ -822,7 +836,7 @@ arm64_a630_gles31_options:
 arm64_a306_gles2:
   extends:
     - .baremetal-test
-    - .use-arm_build
+    - .use-x86_cross_arm_test
     - .freedreno-rules
   variables:
     BM_KERNEL: /lava-files/Image.gz
@@ -838,6 +852,8 @@ arm64_a306_gles2:
   script:
     - .gitlab-ci/bare-metal/fastboot.sh
   needs:
+    - x86_cross_arm_test
+    - arm_build
     - meson-arm64
   tags:
     - google-freedreno-db410c
diff --git a/.gitlab-ci/container/x86_cross_arm_test.sh b/.gitlab-ci/container/x86_cross_arm_test.sh
new file mode 100644 (file)
index 0000000..6ae96bf
--- /dev/null
@@ -0,0 +1,95 @@
+#!/bin/bash
+
+set -e
+set -o xtrace
+
+# etnaviv will eventually need armhf too.
+CROSS_ARCHITECTURES="arm64"
+
+for arch in $CROSS_ARCHITECTURES; do
+    dpkg --add-architecture $arch
+done
+
+############### Install packages for building
+apt-get install -y ca-certificates
+sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list
+echo 'deb https://deb.debian.org/debian buster-backports main' >/etc/apt/sources.list.d/backports.list
+apt-get update
+
+apt-get install -y --no-remove \
+        abootimg \
+        android-sdk-ext4-utils \
+        bc \
+        bison \
+        bzip2 \
+        ccache \
+        cmake \
+        cpio \
+        g++ \
+        debootstrap \
+        fastboot \
+        flex \
+        git \
+        meson \
+        netcat \
+        python3-distutils \
+        python3-minimal \
+        python3-serial \
+        python3.7 \
+        pkg-config \
+        procps \
+        unzip
+
+# Cross-build test deps
+for arch in $CROSS_ARCHITECTURES; do
+    apt-get install -y --no-remove \
+        crossbuild-essential-${arch} \
+        libdrm-dev:${arch} \
+        libegl1-mesa-dev:${arch} \
+        libelf-dev:${arch} \
+        libexpat1-dev:${arch} \
+        libffi-dev:${arch} \
+        libgbm-dev:${arch} \
+        libgles2-mesa-dev:${arch} \
+        libpng-dev:${arch} \
+        libstdc++6:${arch} \
+        libtinfo-dev:${arch} \
+        libegl1-mesa-dev:${arch} \
+        libvulkan-dev:${arch}
+
+    mkdir /var/cache/apt/archives/${arch}
+done
+
+. .gitlab-ci/container/container_pre_build.sh
+
+############### Create rootfs
+
+for arch in $CROSS_ARCHITECTURES; do
+  . .gitlab-ci/create-cross-file.sh $arch
+
+  DEBIAN_ARCH=$arch . .gitlab-ci/container/lava_arm.sh
+done
+
+############### Uninstall the build software
+
+ccache --show-stats
+
+apt-get purge -y \
+        bc \
+        bison \
+        bzip2 \
+        ccache \
+        cmake \
+        g++ \
+        flex \
+        git \
+        meson \
+        pkg-config \
+        python3-distutils \
+        procps
+
+for arch in $CROSS_ARCHITECTURES; do
+    apt-get purge -y ".*:${arch}"
+done
+
+apt-get autoremove -y --purge