Skip to contentSkip to conversation

automation: add x86_64 test (linux argo)

PATCH Superseded [email protected] 4 participants 7 messages Oct 17, 2024 – Oct 18, 2024 Arm/Zynq architecture

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#1 lore raw

PATCH 1/3 automation: add linux 6.6.56 artifact

In reply to [email protected]

From: Victor Lira <[email protected]>

Add dockerfile for building container image that holds linux 6.6.56 bzImage for x86_64, using the same build process as the current 6.1.19 image

---
Cc: Doug Goldstein <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: [email protected]

---
 .../tests-artifacts/kernel/6.6.56.dockerfile  | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 automation/tests-artifacts/kernel/6.6.56.dockerfile
automation/tests-artifacts/kernel/6.6.56.dockerfile new file +54 -0
new file mode 100644
index 0000000000..5b6f2fe527
@@ -0,0 +1,54 @@
+# syntax=docker/dockerfile:1
+FROM --platform=linux/amd64 debian:bookworm
+LABEL maintainer.name="The Xen Project" \
+      maintainer.email="[email protected]"
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV LINUX_VERSION=6.6.56
+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 \
+        libelf-dev \
+        && \
+    apt-get autoremove -y && \
+    apt-get clean && \
+    rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/* && \
+    \
+    # Build the kernel
+    curl -fsSLO https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"$LINUX_VERSION".tar.xz && \
+    tar xvJf linux-"$LINUX_VERSION".tar.xz && \
+    cd linux-"$LINUX_VERSION" && \
+    make defconfig && \
+    make xen.config && \
+    scripts/config --enable BRIDGE && \
+    scripts/config --enable IGC && \
+    scripts/config --enable TUN && \
+    cp .config .config.orig && \
+    cat .config.orig | grep XEN | grep =m |sed 's/=m/=y/g' >> .config && \
+    make -j$(nproc) bzImage && \
+    cp arch/x86/boot/bzImage / && \
+    cd /build && \
+    rm -rf linux-"$LINUX_VERSION"* && \
+    \
+    # Clean up
+    apt-get --yes purge \
+        build-essential \
+        libssl-dev \
+        bc \
+        curl \
+        flex \
+        bison \
+        libelf-dev \
+        && \
+    apt-get autoremove -y

--
2.25.1

#0 lore raw

cover automation: add x86_64 test (linux argo)

From: Victor Lira <[email protected]>

Add x86_64 hardware test that creates a Xen Argo communication connection between two PVH domains.

To accomplish this, add new build artifacts for Linux and Argo, and update the xilinx x86_64 test script.

Victor Lira (3):
automation: add linux 6.6.56 artifact
automation: add linux argo test artifacts
automation: add x86_64 test (linux argo)

 automation/gitlab-ci/build.yaml               | 34 +++++++
 automation/gitlab-ci/test.yaml                | 10 ++
 .../scripts/xilinx-smoke-dom0-x86_64.sh       | 76 ++++++++++-----
 .../tests-artifacts/argo/6.6.56.dockerfile    | 95 +++++++++++++++++++
 .../tests-artifacts/kernel/6.6.56.dockerfile  | 54 +++++++++++
 5 files changed, 244 insertions(+), 25 deletions(-)
 create mode 100644 automation/tests-artifacts/argo/6.6.56.dockerfile
 create mode 100644 automation/tests-artifacts/kernel/6.6.56.dockerfile

--
2.25.1

#3 lore raw

PATCH 3/3 automation: add x86_64 test (linux argo)

From: Victor Lira <[email protected]>

Add x86_64 hardware test that creates a Xen Argo communication connection between two PVH domains. In the test, dom0 creates a domU and listens for messages sent by the domU through Argo.

To accomplish this, add Xen build jobs to export Linux and argo artifacts, and build Xen with CONFIG_ARGO=y.

Update the xilinx x86_64 test script to support the new test, and add "sync_console" to command line to avoid an issue with console messages being lost.

---
Cc: Doug Goldstein <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: [email protected]

---
 automation/gitlab-ci/build.yaml               | 34 +++++++++
 automation/gitlab-ci/test.yaml                | 10 +++
 .../scripts/xilinx-smoke-dom0-x86_64.sh       | 76 +++++++++++++------
 3 files changed, 95 insertions(+), 25 deletions(-)
automation/gitlab-ci/build.yaml +34 -0
index c2db69ecf8..827759fb7b 100644
@@ -326,6 +326,30 @@ kernel-6.1.19-export:
   tags:
     - x86_64
 
+kernel-6.6.56-export:
+  extends: .test-jobs-artifact-common
+  image: registry.gitlab.com/xen-project/xen/tests-artifacts/kernel:6.6.56
+  script:
+    - mkdir binaries && cp /bzImage binaries/bzImage
+  artifacts:
+    paths:
+      - binaries/bzImage
+  tags:
+    - x86_64
+
+argo-6.6.56-export:
+  extends: .test-jobs-artifact-common
+  image: registry.gitlab.com/xen-project/xen/tests-artifacts/argo:6.6.56
+  script:
+    - mkdir binaries && cp -ar /artifacts/* binaries
+  artifacts:
+    paths:
+      - binaries/xen-argo.ko
+      - binaries/lib/
+      - binaries/argo-exec
+  tags:
+    - x86_64
+
 # Jobs below this line
 
 # Build jobs needed for tests
@@ -341,6 +365,16 @@ alpine-3.18-gcc-debug:
     CONTAINER: alpine:3.18
     BUILD_QEMU_XEN: y
 
+alpine-3.18-gcc-debug-argo:
+  extends: .gcc-x86-64-build-debug
+  variables:
+    CONTAINER: alpine:3.18
+    EXTRA_XEN_CONFIG: |
+      CONFIG_EXPERT=y
+      CONFIG_UNSUPPORTED=y
+      CONFIG_ARGO=y
+    BUILD_QEMU_XEN: n
+
 debian-bookworm-gcc-debug:
   extends: .gcc-x86-64-build-debug
   variables:
automation/gitlab-ci/test.yaml +10 -0
index b27c2be174..849860627d 100644
@@ -192,6 +192,16 @@ xilinx-smoke-dom0-x86_64-gcc-debug:
     - *x86-64-test-needs
     - alpine-3.18-gcc-debug
 
+xilinx-smoke-dom0-x86_64-gcc-debug-argo:
+  extends: .xilinx-x86_64
+  script:
+    - ./automation/scripts/xilinx-smoke-dom0-x86_64.sh argo 2>&1 | tee ${LOGFILE}
+  needs:
+    - alpine-3.18-gcc-debug-argo
+    - kernel-6.6.56-export
+    - alpine-3.18-rootfs-export
+    - argo-6.6.56-export
+
 adl-smoke-x86-64-gcc-debug:
   extends: .adl-x86-64
   script:
automation/scripts/xilinx-smoke-dom0-x86_64.sh +51 -25

140 lines not on this page · raw message

--
2.25.1

#2 lore raw

PATCH 2/3 automation: add linux argo test artifacts

In reply to [email protected]

From: Victor Lira <[email protected]>

Add dockerfile for building container image that holds test binaries for Xen Argo test on Linux 6.6.56 x86_64

The build produces the following:

- xen-argo.ko       Linux kernel module
- lib/libargo*      Linux shared library
- argo-exec         Linux user test program

---
Cc: Doug Goldstein <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: [email protected]

---
 .../tests-artifacts/argo/6.6.56.dockerfile    | 95 +++++++++++++++++++
 1 file changed, 95 insertions(+)
 create mode 100644 automation/tests-artifacts/argo/6.6.56.dockerfile
automation/tests-artifacts/argo/6.6.56.dockerfile new file +95 -0
new file mode 100644
index 0000000000..a8e199ad3b
@@ -0,0 +1,95 @@
+# syntax=docker/dockerfile:1
+FROM --platform=linux/amd64 alpine:3.18
+LABEL maintainer.name="The Xen Project" \
+      maintainer.email="[email protected]"
+
+ENV LINUX_VERSION=6.6.56
+ENV USER root
+
+RUN mkdir /build /artifacts
+WORKDIR /build
+ENV BUILDDIR=/build/
+ENV COPYDIR=/artifacts/
+ENV ARGO_SHA="705a7a8a624b42e13e655d3042059b8a85cdf6a3"
+ENV ARGOEXEC_SHA="d900429f6640acc6f68a3d3a4c945d7da60625d8"
+
+RUN apk --no-cache add \
+  \
+  musl-dev  \
+  build-base \
+  libc6-compat \
+  linux-headers \
+  bash \
+  git \
+  curl \
+  flex \
+  bison \
+  elfutils-dev \
+  autoconf \
+  automake \
+  libtool && \
+  \
+  # Prepare Linux sources
+  curl -fsSLO https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"$LINUX_VERSION".tar.xz && \
+  tar xJf linux-"$LINUX_VERSION".tar.xz && \
+  cd linux-"$LINUX_VERSION" && \
+  make ARCH=x86 defconfig && \
+  make ARCH=x86 xen.config && \
+  ./scripts/config --enable BRIDGE && \
+  ./scripts/config --enable IGC && \
+  ./scripts/config --enable TUN && \
+  cp .config .config.orig && \
+  cat .config.orig | grep XEN | grep =m |sed 's/=m/=y/g' >> .config && \
+  make ARCH=x86 olddefconfig && \
+  make ARCH=x86 modules_prepare && \
+  \
+  # Build Linux kernel module for Xen Argo
+  cd "${BUILDDIR}" && \
+  git clone \
+      --depth=1 --branch=master \
+      https://github.com/OpenXT/linux-xen-argo.git && \
+  git -C "${BUILDDIR}/linux-xen-argo" switch --detach "${ARGO_SHA}" && \
+  make -C "linux-${LINUX_VERSION}" M="${BUILDDIR}/linux-xen-argo/argo-linux" \
+      CFLAGS_MODULE="-Wno-error" KBUILD_MODPOST_WARN=1 && \
+  cp "linux-xen-argo/argo-linux/xen-argo.ko" "${COPYDIR}/xen-argo.ko" && \
+  \
+  # Build Linux libargo shared library, applying fixes to build in Alpine
+  cd "${BUILDDIR}/linux-xen-argo/libargo" && \
+  sed -i "s|AM_INIT_AUTOMAKE|AC_CONFIG_AUX_DIR(.)\nAM_INIT_AUTOMAKE|" configure.ac && \
+  sed -i "s/__SOCKADDR_COMMON (sxenargo_)/sa_family_t sxenargo_family/" src/libargo.h && \
+  sed -i "s/__SOCKADDR_COMMON_SIZE/(sizeof (unsigned short int))/" src/libargo.h && \
+  autoreconf --install && \
+  ./configure  --prefix="${COPYDIR}" CPPFLAGS="-I${PWD}/../argo-linux/include" && \
+  make && \
+  make install && \
+  \
+  # Build Linux user program, modifying for xilinx argo test
+  cd "${BUILDDIR}" && \
+  wget "https://raw.githubusercontent.com/OpenXT/xenclient-oe/${ARGOEXEC_SHA}/recipes-openxt/argo-exec/argo-exec/argo-exec.c" && \
+  sed -i "s|#include <xen/xen.h>||" argo-exec.c && \
+  sed -i "s|ret = shuffle(s, fds\[0\], fds\[1\]);|ret = shuffle(s, 0, 1);|" argo-exec.c && \
+  gcc -I"${BUILDDIR}/linux-xen-argo/libargo/src" \
+      -I"${BUILDDIR}/linux-xen-argo/argo-linux/include" \
+      -L"${COPYDIR}/lib/" \
+      -o argo-exec argo-exec.c -largo && \
+  cp argo-exec "${COPYDIR}" && \
+  \
+  # Clean up
+  cd /build && \
+  rm -fr linux-"$LINUX_VERSION"* linux-xen-argo argo-exec.c && \
+  \
+  apk del \
+  \
+  musl-dev  \
+  build-base \
+  libc6-compat \
+  linux-headers \
+  bash \
+  git \
+  curl \
+  flex \
+  bison \
+  elfutils-dev \
+  autoconf \
+  automake \
+  libtool

--
2.25.1

#4 lore raw
In reply to [email protected]
Quoted 13 lines · On 17/10/2024 6:18 pm, [email protected] wrote:

From: Victor Lira <[email protected]>

Add x86_64 hardware test that creates a Xen Argo communication connection between two PVH domains.

To accomplish this, add new build artifacts for Linux and Argo, and update the xilinx x86_64 test script.

Victor Lira (3):
automation: add linux 6.6.56 artifact
automation: add linux argo test artifacts
automation: add x86_64 test (linux argo)

Quoted 8 lines
 automation/gitlab-ci/build.yaml               | 34 +++++++
 automation/gitlab-ci/test.yaml                | 10 ++
 .../scripts/xilinx-smoke-dom0-x86_64.sh       | 76 ++++++++++-----
 .../tests-artifacts/argo/6.6.56.dockerfile    | 95 +++++++++++++++++++
 .../tests-artifacts/kernel/6.6.56.dockerfile  | 54 +++++++++++
 5 files changed, 244 insertions(+), 25 deletions(-)
 create mode 100644 automation/tests-artifacts/argo/6.6.56.dockerfile
 create mode 100644 automation/tests-artifacts/kernel/6.6.56.dockerfile

I'm afraid that we need to stop doing this test-artefacts like this.

The *-export pattern is nonsense (wasting lots of runner network&disk and time just to copy data back into Github's artefact store), and the main reason why we're at ~2T of data total for Xen-project.

We need a project wide expires_in: setting, which will prune all of our not-most-recent content, and probably make most of that 2T disappear.

But, the test jobs stating what artefacts they want are perfectly capable of pulling artefacts from somewhere other than an earlier nop build job, meaning that we could get away with having one artefact shared by everything, not one artefact copied per user per pipeline into the artefact store.

I was thinking of experimenting with a separate top-level repo that does nothing but has a few manual runs to populate artefacts, and having the Xen tests pull artefacts from here rather than from earlier build jobs.

But, I've not had a chance to play yet, so I don't know for sure if this is a workable direction.

Alternatively, if anyone has a better idea, I'm all ears.  But, it is very clear that the *-export pattern is a giant bodge and there are better ways.

Other notes.  Your dockerfiles use syntax:1 but not heredocs, and they're also root containers.

Please follow the pattern in
https://lore.kernel.org/xen-devel/178560672106e37648304f5e597cc0b16c8db6db.1729170005.git.javi.merino@cloud.com/T/#u
or one of plenty other containers I've already converted in the past few months.

Please do not add a new build job just to get a new minor variation of Xen.  Just enable ARGO in general Xen build.

Although, given that you are now putting in testing from an unsupported feature, we really need to bump the suggestion to move it to at least Tech Preview.  (CC Dan/Chris).

~Andrew

#5 lore raw
Quoted 23 lines · Andrew Cooper
Quoted 13 lines · On 17/10/2024 6:18 pm, [email protected] wrote:

From: Victor Lira <[email protected]>

Add x86_64 hardware test that creates a Xen Argo communication connection between two PVH domains.

To accomplish this, add new build artifacts for Linux and Argo, and update the xilinx x86_64 test script.

Victor Lira (3):
automation: add linux 6.6.56 artifact
automation: add linux argo test artifacts
automation: add x86_64 test (linux argo)

Quoted 8 lines
 automation/gitlab-ci/build.yaml               | 34 +++++++
 automation/gitlab-ci/test.yaml                | 10 ++
 .../scripts/xilinx-smoke-dom0-x86_64.sh       | 76 ++++++++++-----
 .../tests-artifacts/argo/6.6.56.dockerfile    | 95 +++++++++++++++++++
 .../tests-artifacts/kernel/6.6.56.dockerfile  | 54 +++++++++++
 5 files changed, 244 insertions(+), 25 deletions(-)
 create mode 100644 automation/tests-artifacts/argo/6.6.56.dockerfile
 create mode 100644 automation/tests-artifacts/kernel/6.6.56.dockerfile
Quoted 8 lines

I'm afraid that we need to stop doing this test-artefacts like this.

The *-export pattern is nonsense (wasting lots of runner network&disk and time just to copy data back into Github's artefact store), and the main reason why we're at ~2T of data total for Xen-project.

We need a project wide expires_in: setting, which will prune all of our not-most-recent content, and probably make most of that 2T disappear.

I looked at this for an hour and couldn't find a way to do it unfortunately. expires_in can only be changed if you are an Admin of the Gitlab instance, meaning an Admin of gitlab.com.

However, there is a setting in each repository (not one global at the gitlab.com/xen-project level) called "Keep artifacts from most recent successful jobs" that can be disabled. I did it manually for my repo.

The big offender is patchew. I went and disabled "Keep artifacts from most recent successful jobs" but I didn't see any immediate changes in storage utilization. But it is expected to take time to propagate.

Quoted 21 lines

But, the test jobs stating what artefacts they want are perfectly capable of pulling artefacts from somewhere other than an earlier nop build job, meaning that we could get away with having one artefact shared by everything, not one artefact copied per user per pipeline into the artefact store.

I was thinking of experimenting with a separate top-level repo that does nothing but has a few manual runs to populate artefacts, and having the Xen tests pull artefacts from here rather than from earlier build jobs.

But, I've not had a chance to play yet, so I don't know for sure if this is a workable direction.

Alternatively, if anyone has a better idea, I'm all ears.  But, it is very clear that the *-export pattern is a giant bodge and there are better ways.

Other notes.  Your dockerfiles use syntax:1 but not heredocs, and they're also root containers.

Quoted 7 lines

Please follow the pattern in
https://lore.kernel.org/xen-devel/178560672106e37648304f5e597cc0b16c8db6db.1729170005.git.javi.merino@cloud.com/T/#u
or one of plenty other containers I've already converted in the past few months.

Please do not add a new build job just to get a new minor variation of Xen.  Just enable ARGO in general Xen build.

+1

#6 lore raw
In reply to Andrew Cooper
Quoted 3 lines · Andrew Cooper

I was thinking of experimenting with a separate top-level repo that does nothing but has a few manual runs to populate artefacts, and having the Xen tests pull artefacts from here rather than from earlier build jobs.

This sounds like a good idea. It may also help with rebuilding containers when needed?

Signature · 3 lines
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab