[PATCH v2 1/2] automation: Switch ppc64le tests to PowerNV machine type

Shawn Anastasio posted 2 patches 2 years, 5 months ago
There is a newer version of this series
[PATCH v2 1/2] automation: Switch ppc64le tests to PowerNV machine type
Posted by Shawn Anastasio 2 years, 5 months ago
Run ppc64le tests with the PowerNV machine type (bare metal) instead of
the paravirtualized pseries machine. This requires a more modern version
of QEMU than is present in debian bullseye's repository, so update the
dockerfile to build QEMU from source.

Support for booting on pseries was broken by 74b725a64d80 ('xen/ppc:
Implement initial Radix MMU support') which resulted in CI failures. In
preparation for removing pseries support entirely, switch the CI
infrastructure to the PowerNV machine type.

Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
 .../build/debian/bullseye-ppc64le.dockerfile  | 37 ++++++++++++++++++-
 automation/gitlab-ci/test.yaml                |  2 +-
 2 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/automation/build/debian/bullseye-ppc64le.dockerfile b/automation/build/debian/bullseye-ppc64le.dockerfile
index 8fad26e903..15827bbcf4 100644
--- a/automation/build/debian/bullseye-ppc64le.dockerfile
+++ b/automation/build/debian/bullseye-ppc64le.dockerfile
@@ -1,4 +1,36 @@
+FROM debian:bullseye-slim AS builder
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV QEMU_TAG=stable-8.1
+ENV USER root
+
+# dependencies for qemu build
+RUN apt-get update && \
+    apt-get --quiet --yes install \
+        git \
+        build-essential \
+        python3-minimal \
+        python3-elementpath \
+        python3-pip \
+        ninja-build \
+        libglib2.0-dev \
+        libpixman-1-dev
+
+RUN mkdir /build
+WORKDIR /build
+
+# QEMU build from git
+RUN git clone --depth 1 --branch "${QEMU_TAG}" https://github.com/qemu/qemu && \
+    mkdir qemu/build && \
+    cd qemu/build && \
+    ../configure --target-list=ppc64-softmmu && \
+    ninja && \
+    ninja install
+
 FROM debian:bullseye-slim
+COPY --from=builder /usr/local/bin/qemu-system-ppc64 /usr/local/bin/qemu-system-ppc64
+COPY --from=builder /usr/local/share/qemu/skiboot.lid /usr/local/share/qemu/skiboot.lid
+
 LABEL maintainer.name="The Xen Project" \
       maintainer.email="xen-devel@lists.xenproject.org"
 
@@ -22,8 +54,9 @@ RUN apt-get update && \
         gcc-powerpc64le-linux-gnu \
         make \
         python3-minimal \
-        # for test phase
-        qemu-system-ppc \
+        # QEMU runtime dependencies
+        libglib2.0-0 \
+        libpixman-1-0 \
         && \
         apt-get autoremove -y && \
         apt-get clean && \
diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 9aa8deabea..9b26ccd907 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -457,6 +457,6 @@ qemu-smoke-riscv64-gcc:
 qemu-smoke-ppc64le-pseries-gcc:
   extends: .qemu-ppc64le
   script:
-    - ./automation/scripts/qemu-smoke-ppc64le.sh pseries-5.2 2>&1 | tee ${LOGFILE}
+    - ./automation/scripts/qemu-smoke-ppc64le.sh powernv9 2>&1 | tee ${LOGFILE}
   needs:
     - debian-bullseye-gcc-ppc64le-debug
-- 
2.30.2
Re: [PATCH v2 1/2] automation: Switch ppc64le tests to PowerNV machine type
Posted by Stefano Stabellini 2 years, 5 months ago
On Wed, 6 Sep 2023, Shawn Anastasio wrote:
> Run ppc64le tests with the PowerNV machine type (bare metal) instead of
> the paravirtualized pseries machine. This requires a more modern version
> of QEMU than is present in debian bullseye's repository, so update the
> dockerfile to build QEMU from source.
> 
> Support for booting on pseries was broken by 74b725a64d80 ('xen/ppc:
> Implement initial Radix MMU support') which resulted in CI failures. In
> preparation for removing pseries support entirely, switch the CI
> infrastructure to the PowerNV machine type.
> 
> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
> ---
>  .../build/debian/bullseye-ppc64le.dockerfile  | 37 ++++++++++++++++++-
>  automation/gitlab-ci/test.yaml                |  2 +-
>  2 files changed, 36 insertions(+), 3 deletions(-)
> 
> diff --git a/automation/build/debian/bullseye-ppc64le.dockerfile b/automation/build/debian/bullseye-ppc64le.dockerfile
> index 8fad26e903..15827bbcf4 100644
> --- a/automation/build/debian/bullseye-ppc64le.dockerfile
> +++ b/automation/build/debian/bullseye-ppc64le.dockerfile
> @@ -1,4 +1,36 @@
> +FROM debian:bullseye-slim AS builder
> +
> +ENV DEBIAN_FRONTEND=noninteractive
> +ENV QEMU_TAG=stable-8.1
> +ENV USER root
> +
> +# dependencies for qemu build
> +RUN apt-get update && \
> +    apt-get --quiet --yes install \
> +        git \
> +        build-essential \
> +        python3-minimal \
> +        python3-elementpath \
> +        python3-pip \
> +        ninja-build \
> +        libglib2.0-dev \
> +        libpixman-1-dev
> +
> +RUN mkdir /build
> +WORKDIR /build
> +
> +# QEMU build from git
> +RUN git clone --depth 1 --branch "${QEMU_TAG}" https://github.com/qemu/qemu && \
> +    mkdir qemu/build && \
> +    cd qemu/build && \
> +    ../configure --target-list=ppc64-softmmu && \
> +    ninja && \
> +    ninja install

It is totally find to build your QEMU but please use a test-artifact
instead, see automation/tests-artifacts/qemu-system-aarch64/ and
qemu-system-aarch64-6.0.0-arm64-export as an example.


>  FROM debian:bullseye-slim
> +COPY --from=builder /usr/local/bin/qemu-system-ppc64 /usr/local/bin/qemu-system-ppc64
> +COPY --from=builder /usr/local/share/qemu/skiboot.lid /usr/local/share/qemu/skiboot.lid
> +
>  LABEL maintainer.name="The Xen Project" \
>        maintainer.email="xen-devel@lists.xenproject.org"
>  
> @@ -22,8 +54,9 @@ RUN apt-get update && \
>          gcc-powerpc64le-linux-gnu \
>          make \
>          python3-minimal \
> -        # for test phase
> -        qemu-system-ppc \
> +        # QEMU runtime dependencies
> +        libglib2.0-0 \
> +        libpixman-1-0 \
>          && \
>          apt-get autoremove -y && \
>          apt-get clean && \
> diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
> index 9aa8deabea..9b26ccd907 100644
> --- a/automation/gitlab-ci/test.yaml
> +++ b/automation/gitlab-ci/test.yaml
> @@ -457,6 +457,6 @@ qemu-smoke-riscv64-gcc:
>  qemu-smoke-ppc64le-pseries-gcc:
>    extends: .qemu-ppc64le
>    script:
> -    - ./automation/scripts/qemu-smoke-ppc64le.sh pseries-5.2 2>&1 | tee ${LOGFILE}
> +    - ./automation/scripts/qemu-smoke-ppc64le.sh powernv9 2>&1 | tee ${LOGFILE}
>    needs:
>      - debian-bullseye-gcc-ppc64le-debug
> -- 
> 2.30.2
>
Re: [PATCH v2 1/2] automation: Switch ppc64le tests to PowerNV machine type
Posted by Shawn Anastasio 2 years, 5 months ago
On 9/6/23 7:41 PM, Stefano Stabellini wrote:
> On Wed, 6 Sep 2023, Shawn Anastasio wrote:
>> Run ppc64le tests with the PowerNV machine type (bare metal) instead of
>> the paravirtualized pseries machine. This requires a more modern version
>> of QEMU than is present in debian bullseye's repository, so update the
>> dockerfile to build QEMU from source.
>>
>> Support for booting on pseries was broken by 74b725a64d80 ('xen/ppc:
>> Implement initial Radix MMU support') which resulted in CI failures. In
>> preparation for removing pseries support entirely, switch the CI
>> infrastructure to the PowerNV machine type.
>>
>> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
>> ---
>>  .../build/debian/bullseye-ppc64le.dockerfile  | 37 ++++++++++++++++++-
>>  automation/gitlab-ci/test.yaml                |  2 +-
>>  2 files changed, 36 insertions(+), 3 deletions(-)
>>
>> diff --git a/automation/build/debian/bullseye-ppc64le.dockerfile b/automation/build/debian/bullseye-ppc64le.dockerfile
>> index 8fad26e903..15827bbcf4 100644
>> --- a/automation/build/debian/bullseye-ppc64le.dockerfile
>> +++ b/automation/build/debian/bullseye-ppc64le.dockerfile
>> @@ -1,4 +1,36 @@
>> +FROM debian:bullseye-slim AS builder
>> +
>> +ENV DEBIAN_FRONTEND=noninteractive
>> +ENV QEMU_TAG=stable-8.1
>> +ENV USER root
>> +
>> +# dependencies for qemu build
>> +RUN apt-get update && \
>> +    apt-get --quiet --yes install \
>> +        git \
>> +        build-essential \
>> +        python3-minimal \
>> +        python3-elementpath \
>> +        python3-pip \
>> +        ninja-build \
>> +        libglib2.0-dev \
>> +        libpixman-1-dev
>> +
>> +RUN mkdir /build
>> +WORKDIR /build
>> +
>> +# QEMU build from git
>> +RUN git clone --depth 1 --branch "${QEMU_TAG}" https://github.com/qemu/qemu && \
>> +    mkdir qemu/build && \
>> +    cd qemu/build && \
>> +    ../configure --target-list=ppc64-softmmu && \
>> +    ninja && \
>> +    ninja install
> 
> It is totally find to build your QEMU but please use a test-artifact
> instead, see automation/tests-artifacts/qemu-system-aarch64/ and
> qemu-system-aarch64-6.0.0-arm64-export as an example.

Thanks for letting me know -- I've submitted a v3 that uses this
technique to build the QEMU binary based on the aarch64 example you
provided.

Shawn
Re: [PATCH v2 1/2] automation: Switch ppc64le tests to PowerNV machine type
Posted by Stefano Stabellini 2 years, 5 months ago
On Fri, 8 Sep 2023, Shawn Anastasio wrote:
> On 9/6/23 7:41 PM, Stefano Stabellini wrote:
> > On Wed, 6 Sep 2023, Shawn Anastasio wrote:
> >> Run ppc64le tests with the PowerNV machine type (bare metal) instead of
> >> the paravirtualized pseries machine. This requires a more modern version
> >> of QEMU than is present in debian bullseye's repository, so update the
> >> dockerfile to build QEMU from source.
> >>
> >> Support for booting on pseries was broken by 74b725a64d80 ('xen/ppc:
> >> Implement initial Radix MMU support') which resulted in CI failures. In
> >> preparation for removing pseries support entirely, switch the CI
> >> infrastructure to the PowerNV machine type.
> >>
> >> Signed-off-by: Shawn Anastasio <sanastasio@raptorengineering.com>
> >> ---
> >>  .../build/debian/bullseye-ppc64le.dockerfile  | 37 ++++++++++++++++++-
> >>  automation/gitlab-ci/test.yaml                |  2 +-
> >>  2 files changed, 36 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/automation/build/debian/bullseye-ppc64le.dockerfile b/automation/build/debian/bullseye-ppc64le.dockerfile
> >> index 8fad26e903..15827bbcf4 100644
> >> --- a/automation/build/debian/bullseye-ppc64le.dockerfile
> >> +++ b/automation/build/debian/bullseye-ppc64le.dockerfile
> >> @@ -1,4 +1,36 @@
> >> +FROM debian:bullseye-slim AS builder
> >> +
> >> +ENV DEBIAN_FRONTEND=noninteractive
> >> +ENV QEMU_TAG=stable-8.1
> >> +ENV USER root
> >> +
> >> +# dependencies for qemu build
> >> +RUN apt-get update && \
> >> +    apt-get --quiet --yes install \
> >> +        git \
> >> +        build-essential \
> >> +        python3-minimal \
> >> +        python3-elementpath \
> >> +        python3-pip \
> >> +        ninja-build \
> >> +        libglib2.0-dev \
> >> +        libpixman-1-dev
> >> +
> >> +RUN mkdir /build
> >> +WORKDIR /build
> >> +
> >> +# QEMU build from git
> >> +RUN git clone --depth 1 --branch "${QEMU_TAG}" https://github.com/qemu/qemu && \
> >> +    mkdir qemu/build && \
> >> +    cd qemu/build && \
> >> +    ../configure --target-list=ppc64-softmmu && \
> >> +    ninja && \
> >> +    ninja install
> > 
> > It is totally find to build your QEMU but please use a test-artifact
> > instead, see automation/tests-artifacts/qemu-system-aarch64/ and
> > qemu-system-aarch64-6.0.0-arm64-export as an example.
> 
> Thanks for letting me know -- I've submitted a v3 that uses this
> technique to build the QEMU binary based on the aarch64 example you
> provided.

I have already committed v3 :-)