Skip to contentSkip to conversation

Jobs based on custom runners: add CentOS Stream 8

PATCH Applied Cleber Rosa 3 participants 4 messages Nov 11, 2021 – Nov 12, 2021

lore
Share & tools
lore
#0 lore raw

v2 cover Jobs based on custom runners: add CentOS Stream 8

This adds a new custom runner, showing an example of how other entities can add their own custom jobs to the GitLab CI pipeline.

The runner (the machine and job) is to be managed by Red Hat, and adds, at the very least, bare metal x86_64 KVM testing capabilities to the QEMU pipeline. This brings extra coverage for some unittests, and the ability to run the Avocado tests that depend on KVM.

The runner is already completely set up and registered to the
https://gitlab.com/qemu-project/qemu project instance. Jobs will be triggered according to the same rules for the jobs s390x and aarch64 jobs running on QEMU project's custom runners, that is, pushes to the staging branch of the "qemu-project" project, or by setting a specific variable.

Still, the job is set with mode "allow failures", so it should not disrupt the existing pipeline. Once its reliability is proved (rules and service levels are to be determined), it can be "upgraded" to a "gating" condition.

Even though the formal method of tracking machine/job maintainers have not been formalized, it should be known that the contacts/admins for this machine and job are:

- Willian Rampazzo
<[email protected]>
willianr on #qemu

- Cleber Rosa
<[email protected]>
clebergnu on #qemu

One example of a job introduced here, running on the host reserved for this purpose can be seen at:

- https://gitlab.com/cleber.gnu/qemu/-/jobs/1773761640

Changes from v1[1]:

* Replaced "--disable-fdt" for "--enable-fdt", given that according to "TARGET_NEED_FDT=y" in "configs/targets/x86_64-softmmu.mak" it is required for x86_64-softmmu.

* Added libfdt-devel to list of package requirements (see previous point for reasoning).

* Removed patch 1 that contained a duplicate bug fix.

* Removed patches 2 and 3 that implemented a "feature probe" and "feature requirement" that would cancel tests if features were not present. That will be treated in a different patch series.

* Removed --disable-jemalloc and --disabletcmalloc according to 3b4da1329.

* Introduced "test-avocado" script with a list of vetted tests

* Do not install meson from CentOS Stream 8 PowerTools repo, instead meson from git submodule due to minimum version requirements.

* Sync with commit f68d21ab8eac56c4097a3d63a8c86689bb507911 (HEAD of c8s-stream-rhel branch) from CentOS repo at
https://git.centos.org/rpms/qemu-kvm/.

* Further separated distribution version and architecture specific files into separate sub directories.

* Added a gitlab CI rule and variable to allow other repos/users who have a CentOS Stream 8 x86_64 runner to trigger the job.

[1] https://lists.gnu.org/archive/html/qemu-devel/2021-06/msg02066.html

Cleber Rosa (1):
Jobs based on custom runners: add CentOS Stream 8

 .gitlab-ci.d/custom-runners.yml               |  29 +++
 docs/devel/ci-jobs.rst.inc                    |   7 +
 .../org.centos/stream/8/build-environment.yml |  51 +++++
 .../ci/org.centos/stream/8/x86_64/configure   | 208 ++++++++++++++++++
 .../org.centos/stream/8/x86_64/test-avocado   |  70 ++++++
 scripts/ci/org.centos/stream/README           |  17 ++
 scripts/ci/setup/build-environment.yml        |  38 ++++
 7 files changed, 420 insertions(+)
 create mode 100644 scripts/ci/org.centos/stream/8/build-environment.yml
 create mode 100755 scripts/ci/org.centos/stream/8/x86_64/configure
 create mode 100755 scripts/ci/org.centos/stream/8/x86_64/test-avocado
 create mode 100644 scripts/ci/org.centos/stream/README
Signature · 1 line
2.33.1
#1 lore raw

PATCH v2 1/1 Jobs based on custom runners: add CentOS Stream 8

This introduces three different parts of a job designed to run on a custom runner managed by Red Hat. The goals include:

a) propose a model for other organizations that want to onboard their own runners, with their specific platforms, build configuration and tests.

b) bring awareness to the differences between upstream QEMU and the version available under CentOS Stream, which is "A preview of upcoming Red Hat Enterprise Linux minor and major releases".

c) because of b), it should be easier to identify and reduce the gap between Red Hat's downstream and upstream QEMU.

The components of this custom job are:

I) OS build environment setup code:

- additions to the existing "build-environment.yml" playbook that can be used to set up CentOS/EL 8 systems.

- a CentOS Stream 8 specific "build-environment.yml" playbook that adds to the generic one.

II) QEMU build configuration: a script that will produce binaries with
features as similar as possible to the ones built and packaged on CentOS stream 8.

III) Scripts that define the minimum amount of testing that the
binaries built with the given configuration (point II) under the given OS build environment (point I) should be subjected to.

IV) Job definition: GitLab CI jobs that will dispatch the build/test
jobs (see points #II and #III) to the machine specifically configured according to #I.

---
 .gitlab-ci.d/custom-runners.yml               |  29 +++
 docs/devel/ci-jobs.rst.inc                    |   7 +
 .../org.centos/stream/8/build-environment.yml |  51 +++++
 .../ci/org.centos/stream/8/x86_64/configure   | 208 ++++++++++++++++++
 .../org.centos/stream/8/x86_64/test-avocado   |  70 ++++++
 scripts/ci/org.centos/stream/README           |  17 ++
 scripts/ci/setup/build-environment.yml        |  38 ++++
 7 files changed, 420 insertions(+)
 create mode 100644 scripts/ci/org.centos/stream/8/build-environment.yml
 create mode 100755 scripts/ci/org.centos/stream/8/x86_64/configure
 create mode 100755 scripts/ci/org.centos/stream/8/x86_64/test-avocado
 create mode 100644 scripts/ci/org.centos/stream/README
.gitlab-ci.d/custom-runners.yml +29 -0
index a89a20da48..1f56297dfa 100644
@@ -248,3 +248,32 @@ ubuntu-20.04-aarch64-notcg:
  - ../configure --disable-libssh --disable-tcg
  - make --output-sync -j`nproc`
  - make --output-sync -j`nproc` check V=1
+
+centos-stream-8-x86_64:
+ allow_failure: true
+ needs: []
+ stage: build
+ tags:
+ - centos_stream_8
+ - x86_64
+ rules:
+ - if: '$CI_PROJECT_NAMESPACE == "qemu-project" && $CI_COMMIT_BRANCH =~ /^staging/'
+ - if: "$CENTOS_STREAM_8_x86_64_RUNNER_AVAILABLE"
+ artifacts:
+   name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
+   when: on_failure
+   expire_in: 7 days
+   paths:
+     - build/tests/results/latest/results.xml
+     - build/tests/results/latest/test-results
+   reports:
+     junit: build/tests/results/latest/results.xml
+ before_script:
+ - JOBS=$(expr $(nproc) + 1)
+ script:
+ - mkdir build
+ - cd build
+ - ../scripts/ci/org.centos/stream/8/x86_64/configure
+ - make -j"$JOBS"
+ - make NINJA=":" check
+ - ../scripts/ci/org.centos/stream/8/x86_64/test-avocado
docs/devel/ci-jobs.rst.inc +7 -0
index 277975e4ad..db3f571d5f 100644
@@ -49,3 +49,10 @@ S390X_RUNNER_AVAILABLE
 If you've got access to an IBM Z host that can be used as a gitlab-CI
 runner, you can set this variable to enable the tests that require this
 kind of host. The runner should be tagged with "s390x".
+
+CENTOS_STREAM_8_x86_64_RUNNER_AVAILABLE
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+If you've got access to a CentOS Stream 8 x86_64 host that can be
+used as a gitlab-CI runner, you can set this variable to enable the
+tests that require this kind of host. The runner should be tagged with
+both "centos_stream_8" and "x86_64".
scripts/ci/org.centos/stream/8/build-environment.yml new file +51 -0

51 lines not on this page · raw message

scripts/ci/org.centos/stream/8/x86_64/configure new file +208 -0

208 lines not on this page · raw message

scripts/ci/org.centos/stream/8/x86_64/test-avocado new file +70 -0

70 lines not on this page · raw message

scripts/ci/org.centos/stream/README new file +17 -0
new file mode 100644
index 0000000000..e3eadfe3ea
@@ -0,0 +1,17 @@
+This directory contains scripts for generating a build of QEMU that
+closely matches the CentOS Stream[1] builds of the qemu-kvm package.
+
+To have the environment ready to configure, build QEMU and run tests,
+please start with a CentOS Stream machine and:
+
+ * apply the generic "build-environment.yml" playbook located at
+   scripts/ci/setup
+
+ * apply the "build-environment.yml" in the directory following the
+   CentOS Stream version (such as "8").
+
+This currently only covers CentOS Stream 8 environments and
+packages[2].
+
+[1] https://www.centos.org/centos-stream/
+[2] https://git.centos.org/rpms/qemu-kvm/commits/c8s-stream-rhel
scripts/ci/setup/build-environment.yml +38 -0
index 581c1c75d1..599896cc5b 100644
@@ -114,3 +114,41 @@
       when:
         - ansible_facts['distribution'] == 'Ubuntu'
         - ansible_facts['distribution_version'] == '20.04'
+
+    - name: Install basic packages to build QEMU on EL8
+      dnf:
+        # This list of packages start with tests/docker/dockerfiles/centos8.docker
+        # but only include files that are common to all distro variants and present
+        # in the standard repos (no add-ons)
+        name:
+          - bzip2
+          - bzip2-devel
+          - dbus-daemon
+          - diffutils
+          - gcc
+          - gcc-c++
+          - genisoimage
+          - gettext
+          - git
+          - glib2-devel
+          - libaio-devel
+          - libepoxy-devel
+          - libgcrypt-devel
+          - lzo-devel
+          - make
+          - mesa-libEGL-devel
+          - nettle-devel
+          - nmap-ncat
+          - perl-Test-Harness
+          - pixman-devel
+          - python36
+          - rdma-core-devel
+          - spice-glib-devel
+          - spice-server
+          - systemtap-sdt-devel
+          - tar
+          - zlib-devel
+        state: present
+      when:
+        - ansible_facts['distribution_file_variety'] == 'RedHat'
+        - ansible_facts['distribution_version'] == '8'
Signature · 1 line
2.33.1
Reviewed-by Tested-by on v2 1/1
#2 lore raw
Quoted 38 lines · Cleber Rosa

This introduces three different parts of a job designed to run on a custom runner managed by Red Hat. The goals include:

a) propose a model for other organizations that want to onboard their own runners, with their specific platforms, build configuration and tests.

b) bring awareness to the differences between upstream QEMU and the version available under CentOS Stream, which is "A preview of upcoming Red Hat Enterprise Linux minor and major releases".

c) because of b), it should be easier to identify and reduce the gap between Red Hat's downstream and upstream QEMU.

The components of this custom job are:

I) OS build environment setup code:

- additions to the existing "build-environment.yml" playbook that can be used to set up CentOS/EL 8 systems.

- a CentOS Stream 8 specific "build-environment.yml" playbook that adds to the generic one.

II) QEMU build configuration: a script that will produce binaries with
features as similar as possible to the ones built and packaged on CentOS stream 8.

III) Scripts that define the minimum amount of testing that the
binaries built with the given configuration (point II) under the given OS build environment (point I) should be subjected to.

IV) Job definition: GitLab CI jobs that will dispatch the build/test
jobs (see points #II and #III) to the machine specifically configured according to #I.

Quoted 14 lines
---
 .gitlab-ci.d/custom-runners.yml               |  29 +++
 docs/devel/ci-jobs.rst.inc                    |   7 +
 .../org.centos/stream/8/build-environment.yml |  51 +++++
 .../ci/org.centos/stream/8/x86_64/configure   | 208 ++++++++++++++++++
 .../org.centos/stream/8/x86_64/test-avocado   |  70 ++++++
 scripts/ci/org.centos/stream/README           |  17 ++
 scripts/ci/setup/build-environment.yml        |  38 ++++
 7 files changed, 420 insertions(+)
 create mode 100644 scripts/ci/org.centos/stream/8/build-environment.yml
 create mode 100755 scripts/ci/org.centos/stream/8/x86_64/configure
 create mode 100755 scripts/ci/org.centos/stream/8/x86_64/test-avocado
 create mode 100644 scripts/ci/org.centos/stream/README

Maybe it is too late, but just for the records:

CI job on a custom VM runner:
https://gitlab.com/willianrampazzo/qemu/-/jobs/1778451942

Applied
#3 lore raw
In reply to Cleber Rosa
Quoted 3 lines · Cleber Rosa

This adds a new custom runner, showing an example of how other entities can add their own custom jobs to the GitLab CI pipeline.

<snip>

Quoted 5 lines

One example of a job introduced here, running on the host reserved for this purpose can be seen at:

- https://gitlab.com/cleber.gnu/qemu/-/jobs/1773761640

As I'm not going to be able to test myself I'll just queue this and we can see it spring into live once merged ;-)

Queued to for-6.2/misc-fixes, thanks.

Signature · 1 line
Alex Bennée