[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v3 1/6] CI: add a Debian 13 riscv64 QTB container



The riscv64 QTB tests use QTB (QEMU Test Bench) Python package. QTB is part
of AMD's work on the 'safety' branch [1] of their QEMU fork and is not
upstream in QEMU yet. The tests also need pytest and qemu-system-riscv64.

Add debian:13-riscv64-qtb, a Debian Trixie container with those packages
and the QTB package installed from the python/ directory of AMD's QEMU
fork, at the commit pinned by QEMU_REPO/QEMU_COMMIT. Make it available to
containerize script as trixie-riscv64-qtb.

QTB depends on pexpect, ptyprocess, pygdbmi and qemu.qmp. Rather than
fetching them from PyPI, install them from the wheels vendored in the
python/wheels/ directory of the same fork commit, with pip --no-index.

[1] https://gitlab.com/xen-project/people/amd/qemu/-/tree/safety?ref_type=heads

Suggested-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
---
The CI jobs running the tests in this container come in a later patch.
---
Changes in v3:
- Move the container from test-artifacts to xen.git (automation/build/),
  renamed debian:13-riscv64-qtb.
- Install the QTB dependencies from the wheels vendored in the fork, with
  pip --no-index.
- Add pytest, drop jinja2, yaml and device-tree-compiler.
- Comment that the pinned commit is the tip of the safety branch.
- Reword the commit title and message.
---
 automation/build/debian/13-riscv64-qtb.dockerfile | 47 +++++++++++++++++++++++
 automation/scripts/containerize                   |  1 +
 2 files changed, 48 insertions(+)

diff --git a/automation/build/debian/13-riscv64-qtb.dockerfile 
b/automation/build/debian/13-riscv64-qtb.dockerfile
new file mode 100644
index 0000000000..34ca1f2b7d
--- /dev/null
+++ b/automation/build/debian/13-riscv64-qtb.dockerfile
@@ -0,0 +1,47 @@
+# syntax=docker/dockerfile:1
+FROM --platform=linux/amd64 debian:trixie-slim
+LABEL maintainer.name="The Xen Project"
+LABEL maintainer.email="xen-devel@xxxxxxxxxxxxxxxxxxxx"
+
+ENV DEBIAN_FRONTEND=noninteractive
+
+ARG QEMU_REPO=https://gitlab.com/xen-project/people/amd/qemu.git
+# Tip of the safety branch
+ARG QEMU_COMMIT=24cd7e5c0d7e4db8e651f091d0b9da2e7c58dbab
+
+RUN <<EOF
+#!/bin/bash
+    set -eu
+
+    useradd --create-home user
+
+    apt-get update
+
+    DEPS=(# Base environment
+        ca-certificates
+        git
+        python3-minimal
+        python3-pip
+        python3-pytest
+        python3-setuptools
+
+        # QEMU for the tests
+        qemu-system-riscv64
+    )
+
+    apt-get -y --no-install-recommends install "${DEPS[@]}"
+
+    # QTB framework
+    git init /tmp/qemu
+    git -C /tmp/qemu fetch --depth 1 "$QEMU_REPO" "$QEMU_COMMIT"
+    git -C /tmp/qemu checkout FETCH_HEAD
+
+    pip install --break-system-packages --no-index --no-build-isolation \
+                --find-links /tmp/qemu/python/wheels "/tmp/qemu/python[qtb]"
+
+    rm -rf /tmp/qemu
+    rm -rf /var/lib/apt/lists/*
+EOF
+
+USER user
+WORKDIR /build
diff --git a/automation/scripts/containerize b/automation/scripts/containerize
index feadd9e82f..cd078d48d9 100755
--- a/automation/scripts/containerize
+++ b/automation/scripts/containerize
@@ -33,6 +33,7 @@ case "_${CONTAINER}" in
     _trixie-ppc64le) CONTAINER="${BASE}/debian:13-ppc64le" ;;
     _bookworm-riscv64) CONTAINER="${BASE}/debian:12-riscv64" ;;
     _trixie-riscv64) CONTAINER="${BASE}/debian:13-riscv64" ;;
+    _trixie-riscv64-qtb) CONTAINER="${BASE}/debian:13-riscv64-qtb" ;;
     _bookworm-x86_64-gcc-ibt) CONTAINER="${BASE}/debian:12-x86_64-gcc-ibt" ;;
     _bookworm|_bookworm-x86_64) CONTAINER="${BASE}/debian:12-x86_64" ;;
     _trixie-x86_64|_) CONTAINER="${BASE}/debian:13-x86_64" ;;

-- 
2.56.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.