1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2024-10-26 07:55:06 +03:00
Commit Graph

38 Commits

Author SHA1 Message Date
Michal Privoznik
ee54658eb5 ci: Drop CentOS 8 Stream and switch F38 to 40, Ubuntu 20.04 to 22.04
There a lot happening here, but that's because otherwise lcitool
fails to regenerate files. Firstly, CentOS 8 is dropped as it's
unsupported now. Secondly, Fedora 40 is introduced and Fedora 38
is dropped. And lastly, Ubuntu 24.04 is introduced and Ubuntu
20.04 is dropped.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2024-05-02 15:38:30 +02:00
Daniel P. Berrangé
c647a8ba2a gitlab: stop using a venv when creating source/binary dist
The change to use 'python -m build' in

  commit 333c8bef2b
  Author: Erik Skultety <eskultet@redhat.com>
  Date:   Tue Jun 20 12:19:40 2023 +0200

    ci: Drop direct 'setup.py' usage

resulted in the CI jobs all downloading latest setuptools and
deps from pypi and running builds with them in a venv. IOW we
ceased testing against the setuptools/wheel packages provided
by the distro, which is the whole point of the CI.

Passing the '-n -x' flags to 'python -m build' tells it to stop
using a venv and not to check dependancies, thus letting it
use what we pre-installed in the container.

This doesn't work on CentOS Stream 8, however, so we revert to
using the old setup.py approach. This is a short term issue,
since Stream 8 is EOL at the end of May, so we'll be deleting
all the Stream 8 jobs across libvirt CI very soon.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-04-30 10:23:31 +01:00
Michal Privoznik
acd4f6701d ci: Switch native_git_build_job to c9s and resume api_coverage_job
Currently, there's just one native_git_build_job -
x86_64-centos-stream-8-git and this is a problem because that's
the job that api_coverage_job then uses. But CentOS Stream 8 has
too old lxml which then makes tests/test_api_coverage.py skip its
run. By switching to CentOS Stream 9 the test can run happily
again.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2024-02-27 16:11:10 +01:00
Daniel P. Berrangé
7fb6a2182c ci: refresh with latest 'lcitool manifest'
This refresh gets rid of the split jobs for prebuilt and local
container environments.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-01-19 12:56:32 +00:00
Peter Krempa
11da469020 ci: Install built module for testing insde an venv
Distros recently started to object to using 'pip' to install system-wide
packages to prevent breakage. We were hacking-around that by using
'pip install --break-system-packages', but it's straightforward to
simply create a venv with '--system-site-packages' and install it there.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2024-01-08 11:56:20 +01:00
Daniel P. Berrangé
697b7727d0 gitlab: unset CFLAGS for rpm build
Setting CFLAGS before invoking rpm-build causes replacement of the
CFLAGS that RPM wants to set for python. This causes the loss of
certain flags needed to turn on debug output and optimization.
Previously this wasn't a problem as something in setuptools appears
to have been adding -g anyway, but with the update to python 3.12
this now fully breaks. We should never have been setting CFLAGS
during the RPM build so we drop it unconditionally for all distros.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-09-21 16:48:42 +01:00
Erik Skultety
333c8bef2b ci: Drop direct 'setup.py' usage
With all the bits in place we can now drop the 'setup.py' invocations
with preferred alternatives.
This patch does a few things:
- we don't run plain install because that always spins up a new build
  process regardless of whether there are build artifacts literally from
  the previous command, so instead we install the built wheel directly

- when building, we build both the .whl binary and an sdist because
  we'll need the sdist for rpmbuild later in the CI job

- we don't capture the 'build' path as a job artifact anymore, because
  that now only contains egg metadata, all the build artifacts are
  created by Python's build module under 'dist' so we capture that one
  instead

- we always limit pytest to the 'tests' directory which was something
  'setup.py test' used to do as a precaution measure, but setup.py no
  longer has the logic (which is fine)

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2023-06-22 10:52:40 +02:00
Daniel P. Berrangé
62a4c1f395 ci: pass --break-system-packages on Debian Sid
Debian Sid python packages block users from installing packages using
pip unless using a venv. A venv has no benefit when we are running in
a throwaway container which has no need for software upgrades.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-04-19 11:32:03 +01:00
Peter Krempa
5b5cd3dacc ci: Expose built RPMs as artifacts
Expose the artifacts from the centos-stream-8/9 and fedora 35/36 jobs so
that the main libvirt integration testing project can consume them.

The new libvirt sub-rpm containing a python helper to access QMP
directly requires python environment which we didn't yet install in the
integration job.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2022-10-13 08:35:32 +00:00
Erik Skultety
d9b9517cc3 ci: Fix the stage of the api-coverage job
The 'extends' stanza supports a list, however there's a merge algorithm
in place where a subsequent list entry overwrites all conflicting
settings from the previous one - which is exactly what happened here as
the gitlab-build-{local,prebuilt}-env job template overwrote
api-coverage's stage to 'builds' whereas the original was
'sanity_checks'.

Fixes: 4733e2a2d1

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2022-10-03 11:41:24 +02:00
Daniel P. Berrangé
4733e2a2d1 ci: refresh with latest lcitool manifest
This refresh switches the CI for contributors to be triggered by merge
requests. Pushing to a branch in a fork will no longer run CI pipelines,
in order to avoid consuming CI minutes. To regain the original behaviour
contributors can opt-in to a pipeline on push

   git push <remote> -o ci.variable=RUN_PIPELINE=1

This variable can also be set globally on the repository, though this is
not recommended. Upstream repo pushes to branches will run CI.

The use of containers has changed in this update, with only the upstream
repo creating containers, in order to avoid consuming contributors'
limited storage quotas. A fork with existing container images may delete
them. Containers will be rebuilt upstream when pushing commits with CI
changes to the default branch. Any other scenario with CI changes will
simply install build pre-requisite packages in a throaway environment,
using the ci/buildenv/ scripts. These scripts may also be used on a
contributor's local machines.

With pipelines triggered by merge requests, it is also now possible to
workaround the inability of contributors to run pipelines if they have
run out of CI quota. A project member can trigger a pipeline from the
merge request, which will run in context of upstream, however, note
this should only be done after reviewing the code for any malicious
CI changes.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-09-30 12:24:31 -04:00
Daniel P. Berrangé
545cc70f2f gitlab: switch to using 'pip' for package installation
The distutils/setuptools 'install' command is deprecated in favour of
'pip', and with recent versiosn, using it will create a bad install
that triggers a traceback on all future use of setuptools:

Traceback (most recent call last):
  File "/builds/berrange/libvirt-python/setup.py", line 328, in <module>
    setup(name = 'libvirt-python',
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 154, in setup
    _install_setup_requires(attrs)
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 143, in _install_setup_requires
    dist = MinimalDistribution(attrs)
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 135, in __init__
    super().__init__(filtered)
  File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 456, in __init__
    for ep in metadata.entry_points(group='distutils.setup_keywords'):
  File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 1009, in entry_points
    return SelectableGroups.load(eps).select(**params)
  File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 459, in load
    ordered = sorted(eps, key=by_group)
  File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 1006, in <genexpr>
    eps = itertools.chain.from_iterable(
  File "/usr/lib64/python3.10/importlib/metadata/_itertools.py", line 16, in unique_everseen
    k = key(element)
  File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 941, in _normalized_name
    return self._name_from_stem(stem) or super()._normalized_name
  File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 622, in _normalized_name
    return Prepared.normalize(self.name)
  File "/usr/lib64/python3.10/importlib/metadata/__init__.py", line 871, in normalize
    return re.sub(r"[-_.]+", "-", name).lower().replace('-', '_')
  File "/usr/lib64/python3.10/re.py", line 209, in sub
    return _compile(pattern, flags).sub(repl, string, count)

This is certainly a bug in distutils/setuptools, but given the
'install' command is deprecated, instead of waiting for a fix,
just switch to the recommend 'pip install .' command.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-03-28 15:44:48 +01:00
Daniel P. Berrangé
c9950c1654 ci: refresh from lcitool manifest
This drops the CentOS 8 job and replaces Fedora 33 with 35.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-03-28 11:48:35 +01:00
Daniel P. Berrangé
d5d4676631 ci: re-generate containers/gitlab config from manifest
This uses the command "lcitool manifest ci/manifest.yml" to re-generate
all existing dockerfiles and gitlab CI config.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-09-02 17:53:58 +01:00
Daniel P. Berrangé
27f55b0130 gitlab: use custom docker:dind image
The current docker:dind container has broken default seccomp filter that
results in clone3 being blocked, which in turn breaks Fedora 35 rawhide.

This custom image has a workaround that causes the seccomp filter to
return ENOSYS for clone3 instad of EPERM, thus triggering glibc to
fallback to clone correctly.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-07-27 14:53:31 +01:00
Daniel P. Berrangé
4cf9e531e3 gitlab: don't set RPM variable on container job
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-25 13:07:47 +01:00
Daniel P. Berrangé
27bc9111b0 gitlab: add OpenSUSE Tumbleweed container and build
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-25 13:07:15 +01:00
Daniel P. Berrangé
8a0504da79 gitlab: introduce Fedora 34 container and build
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-25 11:05:49 +01:00
Daniel P. Berrangé
22f6a4f071 gitlab: rename opensuse-152 to opensuse-leap-152
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-25 11:04:49 +01:00
Daniel P. Berrangé
1a25fc35b6 gitlab: rename centos-stream to centos-stream-8
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-25 11:03:49 +01:00
Daniel P. Berrangé
418409301f gitlab: drop Fedora 32 container and build
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-25 11:02:42 +01:00
Daniel P. Berrangé
333af99d7d gitlab: drop centos-7 container and build
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-25 11:01:53 +01:00
Daniel P. Berrangé
38bb83e914 Don't run sanity checks by default
The sanity check scripts verify that the binding covers all APIs in the
libvirt library/headers being built against. This is primarily there for
libvirt maintainers to identify when there are gaps in API coverage.

This is not something downstream consumers of libvirt-python should be
running themselves, so we shouldn't added it to tests by default.

In addition if people are working on branches or submitting merge
requests for python changes, we shouldn't block their work for failed
API coverage sanity tests, if the python binding otherwise builds fine
and passes regular unit tests.

Thus, we introduce a new gitlab job "api-coverage" with some conditions:

 - If pushing to a branch, the job is treated as non-fatal
 - For regular scheduled builds, it is mandatory
 - Don't run in any other scenarios

This job uses the artifacts from the centos-8-git-build job and re-runs
the test suite, requesting the sanity tests to be run too.

This will achieve the result of letting us see missing API coverage
in nightly builds, without blocking other contributions.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-04-09 16:40:42 +01:00
Andrea Bolognani
ce6d4369ba ci: Move dco job to sanity_checks stage
If the DCO check fails we still want the pipeline to fail, but
that doesn't mean there's no value in running the other jobs to
get a better picture.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2021-04-07 13:56:24 +02:00
Andrea Bolognani
3a9f2eacf2 ci: Use 'extends' GitLab CI feature
This is the recommended way to use templates in job
definitions.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2021-04-07 13:56:24 +02:00
Ján Tomko
bded4a72c8 ci: drop openSUSE leap 15.1 in favor of 15.2
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-04-06 20:29:08 +02:00
Daniel P. Berrangé
0b10d9cba8 gitlab: replace "libvirt-" prefix with "ci-" in dockerfiles
This makes the dockerfile name match the output container name

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-12-01 16:52:33 +00:00
Daniel P. Berrangé
b37f39e4f7 gitlab: re-generate container images from lcitool
This introduces Fedora 33 and removes some redundant packages.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-12-01 16:52:31 +00:00
Daniel P. Berrangé
2110591acf gitlab: move dockerfiles into ci/containers sub-directory
This brings the repo into alignment with the main libvirt.git practice.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-12-01 16:17:35 +00:00
Daniel P. Berrangé
fb2123c28b Pass -Werror when building extension
This ensures we pick up warnings from new python headers or other
problems.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-11-12 13:36:46 +00:00
Daniel P. Berrangé
3a4d51e266 gitlab: optimize CI job dependencies
Allow more parallelization by giving explicit dependencies between jobs.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-10-06 12:34:38 +00:00
Daniel P. Berrangé
dc1dc11efe ci: refresh dockerfiles for changed libvirt build system
Libvirt changed from autotools to meson. All the containers need
refreshing and the CI recipes updated.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-08-04 12:23:26 +01:00
Andrea Bolognani
8c5879b44d ci: Test installation
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2020-05-22 18:35:19 +02:00
Andrea Bolognani
dc5edeb087 ci: Make job skips more flexible
Instead of hardcoding the names of the targets for which certain
steps should be skipped, use a separate variable to store that
information.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2020-05-22 18:29:22 +02:00
Daniel P. Berrangé
8cbcbf2a84 gitlab: add testing of the rpmbuild process
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-05-14 10:43:40 +01:00
Daniel P. Berrangé
ed74df4813 gitlab: fix typo s/perl/python/ in docker cached image name
Reported-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-05-01 17:09:13 +01:00
Daniel P. Berrangé
76a8346643 gitlab: introduce CI jobs testing git master & distro libvirt
The python build needs to validate two axis

 - A variety of libvirt versions
 - A variety of python versions

We get coverage for both these axis by running a build against the
distro provided libvirt packages. All that is then missing is a build
against the latest libvirt git master, which only needs to be run on
a single distro, for which CentOS 8 is picked as a stable long life
base.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-05-01 13:14:55 +01:00
Daniel P. Berrangé
51d434cf03 gitlab: add CI job for validating DCO signoff
This job uses the shared "check-dco" image to validate that all
commits on a branch in a developer's repo fork have a suitable
Signed-off-by statement present.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-04-30 16:24:52 +01:00