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

46 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
Daniel P. Berrangé
e2a8524bc8 ci: refresh with lcitool manifest
This pulls in the new wheel packages.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-04-25 10:22:46 +01:00
Daniel P. Berrangé
379ecce9f5 ci: add 'python3-wheel' as a dep
The 'python -m build' command creates a source dist and a binary
wheel. To be able run this command without creating a new venv
and downloading from pypi, we need to pre-install the 'wheel'
package.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-04-25 10:21:27 +01:00
Daniel P. Berrangé
5b4e4f9a90 ci: refresh with latest lcitool manifest
Fixes logic that caused some jobs to mistakenly not be run
when expected.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2024-04-25 09:53:22 +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
Peter Krempa
17d63413de ci: Update Fedora and Debian versions and regenerate
Update:
 Debian-10 -> Debian-12
 Fedora-37 -> Fedora-38
 Fedora-38 -> Fedora-39

Also the artifacts from the Fedora 39 job are needed for the integration
test suite in the main libvirt project.

For Debian 12 we need to start using
'pip install --break-system-packages' as a hack to work around
installation of the built package for testing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2024-01-08 11:21:12 +01:00
Erik Skultety
716a2f546d ci: lcitool: Maintain project package deps lists here
Each respective project that lcitool knows about and currently
maintains its list of package dependencies knows best what packages
they actually depend on. If a new dependency is currently needed,
first a change in lcitool is necessary before GitLab jobs and
containers can be updated. Provided a mapping already exists in
lcitool (which can quickly be added as an override via mappings.yml
         temporarily) we speed up the whole CI update process by
one step.

Note that starting this commit lcitool must be invoked as
    '$ lcitool -d/--data-dir ci/lcitool ...'
to pick up the project dependency list correctly.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2023-08-21 11:54:09 +02: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
Erik Skultety
10f0ad6cef ci: Refresh with latest lcitool changes
- bump OpenSUSE Leap 15.4 -> 15.5
- add python3-build dependency (PEP-517)
- add python3-venv dependency (PEP-517)

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2023-06-21 18:03:14 +02:00
Erik Skultety
fc7022b972 ci: Drop Fedora 36 target
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2023-05-03 09:09:53 +02:00
Erik Skultety
4994b96883 ci: Add Fedora 38 target
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2023-05-03 09:09:53 +02:00
Erik Skultety
f3092b0448 ci: Replace OpenSUSE Leap 15.4 target with Leap 15 name
We now refer to the latest Leap 15.X simply as Leap 15 in lcitool.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2023-05-03 09:09:53 +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
Daniel P. Berrangé
664c347534 ci: mark bleeding edge distros as non-gating
Fedora Rawhide, Debian Sid and OpenSUSE Tumbleweed are all liable to
have sporadic failures due to being bleeding edge distros. Thus they
should not gate contributor changes that are otherwise correct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-04-19 10:25:34 +01:00
Daniel P. Berrangé
6e1351b4c0 ci: regenerated with lcitool manifest
This replaces OpenSUSE Leap 15.3 with 15.4

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-04-19 10:23:57 +01:00
Erik Skultety
d75be36877 ci: manifest: Define RPM artifacts for regular CentOS Stream 8 build
Commit 7360326 missed the fact that artifacts were only defined for the
libvirt Git type of libvirt-python build (git is cloned, libvirt is
built and then libvirt-python) based on the
'native_git_build_job_prebuilt_env' job template whereas libvirt CI
expects the RPM artifacts to come from a job based on the
'native_build_job' template instead.

Note that this patch is a hotfix to something which requires a proper
cleanup to stay consistent with the way we're handling the same thing
in libvirt-perl.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2023-01-06 15:58:57 +01:00
Erik Skultety
7360326272 ci: manifest: Define artifacts cache
After commit 6e0d4d53 we lost RPM artifacts cache breaking the whole
integration CI. The reason for that is that we manually defined the
artifacts cache in gitlab.yml instead of manifest.yml. Naturally with
the next lcitool update, gitlab.yml got overwritten according to
manifest.yml which didn't define any artifacts cache.

Fixes: 6e0d4d53d5

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2023-01-05 08:33:02 +01:00
Erik Skultety
68ee981379 ci: manifest: Replace 'expiry' with 'expire_in'
'expiry' isn't a keyword in lcitool anymore, the only reason why
everything has kept working despite lcitool updates is that lcitool
sets 'expire_in' to 2 days by default.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
2023-01-05 08:28:12 +01:00
Erik Skultety
6e0d4d53d5 ci: Refresh and add Fedora 37 target
Signed-off-by: Erik Skultety <eskultet@redhat.com>
2023-01-04 15:06:09 +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
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é
e78e2bae31 ci: remove obsolete refresh script and documentation
We now use lcitool's manifest feature to generate files.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-09-02 17:53:58 +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é
cf3c20bb4f ci: define a CI manifest file
This is to be used with 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é
3475abfa54 containers: refresh containers with latest libvirt-ci
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-05-25 13:07:58 +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
Ján Tomko
fa69ccf212 ci: refresh containers for nose->pytest switch
Matches libvirt-ci commit facd5d855c97bf5b127ff9bf245c8fdf514dd916

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-04-07 17:10:36 +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
Ján Tomko
8e1398f31f ci: refresh dockerfiles
Refresh to match libvirt-ci commit 94c25bde639eb31ff2071fb6abfd3d5c777f4ab2

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-04-06 20:28:14 +02:00
Daniel P. Berrangé
d2dff0b775 ci: refresh containers for CentOS-8 PowerTools repo rename
A recent CentOS-8 update renamed the "PowerTools" repo to "powertools"
and since dnf is case sensitive wrt repo names, this broke ability to
build new containers.

The refresh fixes the repo name and pulls in other misc improvements
to containers.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-12-15 10:44:30 +00: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é
d91aadf443 gitlab: refresh containers with lcitool for fully minimized base
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é
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
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