ci: bare-metal: use nginx to get results from DUT

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2655
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5661>
This commit is contained in:
Christian Gmeiner 2020-06-10 14:44:17 +02:00 committed by Marge Bot
parent 101400d449
commit 096adbe369
7 changed files with 65 additions and 8 deletions

View File

@ -336,7 +336,7 @@ arm_test-base:
- .fdo.container-build@debian
- .container
variables:
FDO_DISTRIBUTION_TAG: &arm_test-base "2020-07-09-cache"
FDO_DISTRIBUTION_TAG: &arm_test-base "2020-07-18-nginx"
.use-arm_test-base:
extends:
@ -354,7 +354,7 @@ arm64_test:
extends:
- .use-arm_test-base
variables:
FDO_DISTRIBUTION_TAG: &arm64_test "2020-07-09-cache"
FDO_DISTRIBUTION_TAG: &arm64_test "2020-07-18-nginx"
.use-arm64_test:
variables:

View File

@ -45,6 +45,13 @@ if [ -z "$BM_ROOTFS" ]; then
exit 1
fi
if [ -z "$BM_WEBDAV_IP" -o -z "$BM_WEBDAV_PORT" ]; then
echo "BM_WEBDAV_IP and/or BM_WEBDAV_PORT is not set - no results will be uploaded from DUT!"
WEBDAV_CMDLINE=""
else
WEBDAV_CMDLINE="webdav=http://$BM_WEBDAV_IP:$BM_WEBDAV_PORT"
fi
set -ex
# Clear out any previous run's artifacts.
@ -72,9 +79,17 @@ abootimg \
--create artifacts/fastboot.img \
-k Image.gz-dtb \
-r rootfs.cpio.gz \
-c cmdline="$BM_CMDLINE"
-c cmdline="$BM_CMDLINE $WEBDAV_CMDLINE"
rm Image.gz-dtb
# Start nginx to get results from DUT
if [ -n "$WEBDAV_CMDLINE" ]; then
ln -s `pwd`/results /results
sed -i s/80/$BM_WEBDAV_PORT/g /etc/nginx/sites-enabled/default
sed -i s/www-data/root/g /etc/nginx/nginx.conf
nginx
fi
# Start watching serial, and power up the device.
if [ -n "$BM_SERIAL" ]; then
$BM/serial-buffer.py $BM_SERIAL | tee artifacts/serial-output.txt &

View File

@ -13,6 +13,18 @@ mount -t devpts devpts /dev/pts
echo "nameserver 8.8.8.8" > /etc/resolv.conf
if sh $BARE_METAL_TEST_SCRIPT; then
OK=1
else
OK=0
fi
# upload artifacts via webdav
WEBDAV=$(cat /proc/cmdline | tr " " "\n" | grep webdav | cut -d '=' -f 2 || true)
if [ -n "$WEBDAV" ]; then
find /results -type f -exec curl -T {} $WEBDAV/{} \;
fi
if [ $OK -eq 1 ]; then
echo "bare-metal result: pass"
else
echo "bare-metal result: fail"

View File

@ -0,0 +1,20 @@
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
location / {
dav_methods PUT;
dav_ext_methods PROPFIND OPTIONS;
dav_access user:rw group:rw all:r;
client_body_temp_path /tmp;
client_max_body_size 0;
create_full_put_path on;
root /results;
autoindex on;
}
}

View File

@ -24,6 +24,7 @@ apt-get install -y --no-remove \
flex \
git \
netcat \
nginx-full \
python3-distutils \
python3-minimal \
python3-serial \
@ -37,4 +38,8 @@ apt-get install -y --no-remove \
apt install -t buster-backports -y --no-remove \
meson
# setup nginx
sed -i '/gzip_/ s/#\ //g' /etc/nginx/nginx.conf
cp .gitlab-ci/bare-metal/nginx-default-site /etc/nginx/sites-enabled/default
. .gitlab-ci/container/container_post_build.sh

View File

@ -4,6 +4,7 @@ set -ex
apt-get -y install --no-install-recommends \
ca-certificates \
curl \
initramfs-tools \
libpng16-16 \
strace \

View File

@ -28,9 +28,8 @@ The boards need to be able to have a kernel/initramfs supplied by the
gitlab-runner system, since the initramfs is what contains the Mesa
testing payload.
The boards should have networking, so that (in a future iteration of
this code) we can extract the dEQP .xml results to artifacts on
gitlab.
The boards should have networking, so that we can extract the dEQP .xml
results to artifacts on gitlab.
Requirements (servo)
--------------------
@ -104,8 +103,8 @@ We need privileged mode and the /dev bind mount in order to get at the
serial console and fastboot USB devices (--device arguments don't
apply to devices that show up after container start, which is the case
with fastboot, and the servo serial devices are actually links to
/dev/pts). We use host network mode so that we can (in the future)
spin up a server to collect XML results for fastboot.
/dev/pts). We use host network mode so that we can spin up a nginx
server to collect XML results for fastboot.
Once you've added your boards, you're going to need to add a little
more customization in ``/etc/gitlab-runner/config.toml``. First, add
@ -119,5 +118,10 @@ required by your bare-metal script, something like::
name = "google-freedreno-db410c-1"
environment = ["BM_SERIAL=/dev/ttyDB410c8", "BM_POWERUP=google-power-up.sh 8", "BM_FASTBOOT_SERIAL=15e9e390"]
If you want to collect the results for fastboot you need to add the following
two board-specific environment variables ``BM_WEBDAV_IP`` and ``BM_WEBDAV_PORT``.
These represent the IP address of the docker host and the board specific port number
that gets used to start a nginx server.
Once you've updated your runners' configs, restart with ``sudo service
gitlab-runner restart``