Add comprehensive testing framework, performance monitoring, and plugin system
Some checks failed
Build Deb-Mock Package / build (push) Failing after 1m9s
Lint Code / Lint All Code (push) Failing after 1s
Test Deb-Mock Build / test (push) Failing after 35s

- Add complete pytest testing framework with conftest.py and test files
- Add performance monitoring and benchmarking capabilities
- Add plugin system with ccache plugin example
- Add comprehensive documentation (API, deployment, testing, etc.)
- Add Docker API wrapper for service deployment
- Add advanced configuration examples
- Remove old wget package file
- Update core modules with enhanced functionality
This commit is contained in:
robojerk 2025-08-19 20:49:32 -07:00
parent 4c0dcb2522
commit c51819c836
30 changed files with 11141 additions and 105 deletions

View file

@ -59,7 +59,57 @@ class Config:
# Parallel builds
self.parallel_jobs = kwargs.get("parallel_jobs", 4)
self.parallel_compression = kwargs.get("parallel_compression", True)
# Advanced parallel build support
self.parallel_builds = kwargs.get("parallel_builds", 2) # Number of parallel chroots
self.parallel_chroot_prefix = kwargs.get("parallel_chroot_prefix", "parallel")
self.parallel_build_timeout = kwargs.get("parallel_build_timeout", 3600) # seconds
self.parallel_build_cleanup = kwargs.get("parallel_build_cleanup", True)
# Advanced mount management
self.advanced_mounts = kwargs.get("advanced_mounts", {})
self.bind_mounts = kwargs.get("bind_mounts", [])
self.tmpfs_mounts = kwargs.get("tmpfs_mounts", [])
self.overlay_mounts = kwargs.get("overlay_mounts", [])
self.mount_options = kwargs.get("mount_options", {})
# Mount isolation and security
self.mount_proc = kwargs.get("mount_proc", True)
self.mount_sys = kwargs.get("mount_sys", True)
self.mount_dev = kwargs.get("mount_dev", True)
self.mount_devpts = kwargs.get("mount_devpts", True)
self.mount_tmp = kwargs.get("mount_tmp", True)
self.mount_home = kwargs.get("mount_home", False)
# Advanced chroot features
self.use_namespaces = kwargs.get("use_namespaces", False)
self.uid_mapping = kwargs.get("uid_mapping", None)
self.gid_mapping = kwargs.get("gid_mapping", None)
self.capabilities = kwargs.get("capabilities", [])
self.seccomp_profile = kwargs.get("seccomp_profile", None)
# UID/GID management
self.chroot_user = kwargs.get("chroot_user", "build")
self.chroot_group = kwargs.get("chroot_group", "build")
self.chroot_uid = kwargs.get("chroot_uid", 1000)
self.chroot_gid = kwargs.get("chroot_gid", 1000)
self.use_host_user = kwargs.get("use_host_user", False)
self.copy_host_users = kwargs.get("copy_host_users", [])
self.preserve_uid_gid = kwargs.get("preserve_uid_gid", True)
# Plugin system
self.plugins = kwargs.get("plugins", [])
self.plugin_conf = kwargs.get("plugin_conf", {})
self.plugin_dir = kwargs.get("plugin_dir", "/usr/share/deb-mock/plugins")
# Performance monitoring and optimization
self.enable_performance_monitoring = kwargs.get("enable_performance_monitoring", True)
self.performance_metrics_dir = kwargs.get("performance_metrics_dir", "./performance-metrics")
self.performance_retention_days = kwargs.get("performance_retention_days", 30)
self.performance_auto_optimization = kwargs.get("performance_auto_optimization", False)
self.performance_benchmark_iterations = kwargs.get("performance_benchmark_iterations", 3)
self.performance_reporting = kwargs.get("performance_reporting", True)
# Network and proxy
self.use_host_resolv = kwargs.get("use_host_resolv", True)
self.http_proxy = kwargs.get("http_proxy", None)
@ -124,10 +174,6 @@ class Config:
self.apt_command = kwargs.get("apt_command", "apt-get")
self.apt_install_command = kwargs.get("apt_install_command", "apt-get install -y")
# Plugin configuration
self.plugins = kwargs.get("plugins", {})
self.plugin_dir = kwargs.get("plugin_dir", "/usr/lib/deb-mock/plugins")
@classmethod
def from_file(cls, config_path: str) -> "Config":
"""Load configuration from a YAML file"""
@ -179,6 +225,42 @@ class Config:
"tmpfs_size": self.tmpfs_size,
"parallel_jobs": self.parallel_jobs,
"parallel_compression": self.parallel_compression,
"parallel_builds": self.parallel_builds,
"parallel_chroot_prefix": self.parallel_chroot_prefix,
"parallel_build_timeout": self.parallel_build_timeout,
"parallel_build_cleanup": self.parallel_build_cleanup,
"advanced_mounts": self.advanced_mounts,
"bind_mounts": self.bind_mounts,
"tmpfs_mounts": self.tmpfs_mounts,
"overlay_mounts": self.overlay_mounts,
"mount_options": self.mount_options,
"mount_proc": self.mount_proc,
"mount_sys": self.mount_sys,
"mount_dev": self.mount_dev,
"mount_devpts": self.mount_devpts,
"mount_tmp": self.mount_tmp,
"mount_home": self.mount_home,
"use_namespaces": self.use_namespaces,
"uid_mapping": self.uid_mapping,
"gid_mapping": self.gid_mapping,
"capabilities": self.capabilities,
"seccomp_profile": self.seccomp_profile,
"chroot_user": self.chroot_user,
"chroot_group": self.chroot_group,
"chroot_uid": self.chroot_uid,
"chroot_gid": self.chroot_gid,
"use_host_user": self.use_host_user,
"copy_host_users": self.copy_host_users,
"preserve_uid_gid": self.preserve_uid_gid,
"plugins": self.plugins,
"plugin_conf": self.plugin_conf,
"plugin_dir": self.plugin_dir,
"enable_performance_monitoring": self.enable_performance_monitoring,
"performance_metrics_dir": self.performance_metrics_dir,
"performance_retention_days": self.performance_retention_days,
"performance_auto_optimization": self.performance_auto_optimization,
"performance_benchmark_iterations": self.performance_benchmark_iterations,
"performance_reporting": self.performance_reporting,
"use_host_resolv": self.use_host_resolv,
"http_proxy": self.http_proxy,
"https_proxy": self.https_proxy,
@ -229,6 +311,7 @@ class Config:
# Check suite
valid_suites = [
"trixie", # Debian 13+ (trixie) - required for OSTree support
"bookworm",
"sid",
"bullseye",