]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/log
ceph-ci.git
3 months agocephadm/tests: Add tests for deb bundled dependencies
Kefu Chai [Tue, 21 Oct 2025 03:26:25 +0000 (11:26 +0800)]
cephadm/tests: Add tests for deb bundled dependencies

Add container definitions and test cases for building cephadm with
Debian package dependencies. The new test_cephadm_build_from_debs
function mirrors the existing RPM test structure, verifying that:

- Build succeeds when required Debian packages are installed
- Build fails when packages are missing
- Bundled packages are correctly identified as sourced from 'deb'
- All expected packages (Jinja2, MarkupSafe, PyYAML) are included
- The zipapp contains expected package directories

Test environments include Ubuntu 22.04 and 24.04 with and without
the required python3-jinja2, python3-yaml, and python3-markupsafe
packages.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
(cherry picked from commit f670dce5d0b819f2fb105339d8611509e81a0355)

3 months agocephadm/build: Add Debian package support for bundled dependencies
Kefu Chai [Tue, 14 Oct 2025 13:04:42 +0000 (21:04 +0800)]
cephadm/build: Add Debian package support for bundled dependencies

Extends the cephadm build script to support bundling dependencies from
Debian packages in addition to pip and RPM packages. This allows building
cephadm on Debian-based distributions using system packages.

Key changes:
- Add 'deb' to DependencyMode enum to enable Debian package mode
- Implement _setup_deb() to configure Debian dependency requirements
- Add _install_deb_deps() to orchestrate Debian package installation
- Add _gather_deb_package_dirs() to parse Debian package file listings
  and locate Python package directories (handles both site-packages and
  dist-packages directories used by Debian)
- Add _deps_from_deb() to extract Python dependencies from installed
  Debian packages using dpkg/apt-cache tools
- Fix variable reference bug in _install_deps() (deps.mode -> config.deps_mode)

The Debian implementation follows a similar pattern to the existing RPM
support, using dpkg-query and dpkg -L to locate installed packages and
their files, with special handling for Debian naming conventions
(e.g., PyYAML -> python3-yaml).

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
(cherry picked from commit 3ff9b0c24e33debe95a0a0c6b42da30be788871c)

3 months agocephadm: fix zip_root_entries population in version command
Kefu Chai [Mon, 10 Nov 2025 04:11:08 +0000 (12:11 +0800)]
cephadm: fix zip_root_entries population in version command

The 'cephadm version --verbose' command was returning an empty
zip_root_entries list because it relied on the private '_files'
attribute of zipimport.zipimporter, which is not reliably populated
across Python versions.

This commit fixes the issue by using the zipfile module to properly
read the archive contents via the loader.archive path. This ensures
that zip_root_entries is correctly populated with the root-level
directories in the zipapp.

This fix is necessary for the cephadm build tests to properly validate
that all expected packages and modules are included in the built zipapp.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
(cherry picked from commit 2c68c1496dbb7cd01bf783e31510940445040a34)

3 months agocephadm/tests: fix _dist_info function logic error
Kefu Chai [Mon, 10 Nov 2025 04:10:46 +0000 (12:10 +0800)]
cephadm/tests: fix _dist_info function logic error

The _dist_info helper function had a logic error where it was checking
if 'entry.startswith(entry)' instead of 'entry.startswith(name)'. This
caused the function to always evaluate incorrectly when checking for
.dist-info or .egg-info entries in the zipapp.

This bug was preventing the test assertions from properly validating
that package metadata directories are included in the built cephadm
zipapp.

Fixes a bug introduced in commit 31c8010faa4.

Signed-off-by: Kefu Chai <k.chai@proxmox.com>
(cherry picked from commit 2fadd34104652940844eb914ff3b0b53cb5ff190)