|
All checks were successful
Comprehensive CI/CD Pipeline / Build and Test (push) Successful in 1m27s
Comprehensive CI/CD Pipeline / Security Audit (push) Successful in 41s
Comprehensive CI/CD Pipeline / Package Validation (push) Successful in 54s
Comprehensive CI/CD Pipeline / Status Report (push) Successful in 16s
|
||
|---|---|---|
| .forgejo/workflows | ||
| behave | ||
| bin | ||
| cache-plugins | ||
| cache-utils | ||
| cache.d | ||
| chroot.d | ||
| configs | ||
| deb_mock | ||
| debian | ||
| default-configs | ||
| dev | ||
| dev_notes | ||
| docs | ||
| examples | ||
| filesystem | ||
| include | ||
| mock | ||
| mounts | ||
| plugins | ||
| releng | ||
| scripts | ||
| templates | ||
| testing-farm | ||
| tests | ||
| .gitignore | ||
| .yamllint | ||
| BINARY_TEST_RESULTS.md | ||
| CI_SETUP_SUMMARY.md | ||
| config.yaml | ||
| DEBIAN_DEPENDENCY_ANALYSIS.md | ||
| Dockerfile.api | ||
| FEDORA_DEBIAN_PACKAGING_COMPARISON.md | ||
| koji-and-mock-alternative.md | ||
| LICENSE | ||
| Makefile | ||
| PACKAGING_STRATEGY.md | ||
| PROJECT_STATUS.md | ||
| pyproject.toml | ||
| pytest.ini | ||
| README.md | ||
| requirements-dev.txt | ||
| requirements.txt | ||
| run_tests.py | ||
| setup.py | ||
| STREAMLINED_CI_SETUP.md | ||
| test-config.yaml | ||
| test_api_simple.py | ||
| test_api_structure.py | ||
| test_sbuild_integration.py | ||
| tox.ini | ||
deb-mock
Overview
deb-mock is Debian's equivalent to Fedora's Mock - a chroot build environment manager that provides isolated, reproducible build environments for Debian packages. It's designed to work seamlessly with deb-bootc-compose and deb-orchestrator to create Debian's complete bootc ecosystem.
What deb-mock Does
Core Purpose
deb-mock is fundamentally a chroot environment manager - it doesn't build packages directly, but rather creates and manages isolated build environments where packages can be built safely. Think of it as the "sandbox creator" for Debian package building, providing clean, reproducible environments for each build.
Primary Functions
1. Build Environment Management
- Chroot Creation: Creates isolated chroot environments for builds
- Buildroot Management: Manages buildroot lifecycle (create, populate, cleanup)
- Package Installation: Installs build dependencies in the chroot
- Environment Isolation: Ensures builds don't interfere with host system
2. Build Process Orchestration
- Build Execution: Runs build commands within the chroot
- Dependency Resolution: Manages package dependencies for builds
- Result Collection: Collects build artifacts from the chroot
- Cleanup Management: Handles post-build cleanup and caching
3. Security & Isolation
- User Management: Manages UIDs/GIDs within the chroot
- Mount Management: Controls filesystem access and mounts
- Network Isolation: Provides network isolation during builds
- Resource Control: Limits resource usage within chroots
Architecture
Single-Process Architecture
deb-mock uses a single-process, multi-stage architecture with clear separation of concerns:
┌─────────────────────────────────────────────────────────────┐
│ deb-mock Process │
├─────────────────────────────────────────────────────────────┤
│ Configuration │ Buildroot │ Package │ Command │
│ Manager │ Manager │ Manager │ Executor │
├─────────────────────────────────────────────────────────────┤
│ Plugin System │ Mount │ UID │ State │
│ │ Manager │ Manager │ Manager │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────┐
│ Chroot │
│ Environment │
└─────────────────┘
Core Components
1. Main Entry Point (deb_mock/core.py)
The command-line interface that orchestrates all operations:
- Command Parsing: Handles user commands and arguments
- Configuration Loading: Loads and validates configuration
- Buildroot Management: Creates and manages build environments
- Command Execution: Executes build commands in chroots
2. Buildroot Manager (deb_mock/chroot.py)
The core component that manages chroot environments:
- Chroot Lifecycle: Creates, populates, and destroys chroots
- Package Management: Installs and manages packages in chroots
- Plugin Integration: Coordinates plugin execution
- State Management: Tracks buildroot state and progress
3. Package Manager (deb_mock/package_manager.py)
Handles package installation and dependency resolution:
- Package Installation: Installs packages in chroots
- Dependency Resolution: Resolves package dependencies
- Repository Management: Manages package repositories
- Fallback Support: Provides fallback to alternative package managers
Integration with deb-bootc-compose and deb-orchestrator
The deb-ecosystem Workflow
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ deb-bootc- │ │ deb-orchestrator│ │ deb-mock │
│ compose │ │ Build System │ │ Build Environment│
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
│ 1. "I need packages" │ │
│──────────────────────▶│ │
│ │ │
│ │ 2. "Build this .deb" │
│ │──────────────────────▶│
│ │ │
│ │ 3. "Environment ready"│
│ │◀──────────────────────│
│ │ │
│ │ 4. "Build complete" │
│ │◀──────────────────────│
│ │ │
│ 5. "Packages ready" │ │
│◀──────────────────────│ │
How deb-mock Fits
- deb-orchestrator requests a build environment for package building
- deb-mock creates an isolated chroot environment
- deb-mock installs build dependencies in the chroot
- deb-orchestrator executes build commands in the deb-mock environment
- deb-mock provides build results back to deb-orchestrator
Development Status
Current Phase
- Status: Foundation development
- Phase: Phase 1 (Weeks 1-8 of parallel development)
- Timeline: Parallel development with deb-bootc-compose and deb-orchestrator
Development Goals
- Basic chroot management system
- Package installation using apt/dpkg
- Basic environment isolation
- Simple plugin framework
- YAML-based configuration system
Success Criteria
- Can create isolated chroot environments
- Can install packages in chroots
- Basic isolation working
- Simple plugin system functional
- Configuration system working
Technology Stack
Primary Language
- Python: For rapid development and Debian tooling integration
Key Dependencies
- debootstrap: For creating base chroot environments
- schroot: For chroot management and isolation
- sbuild: For package building within chroots
- apt/dpkg: For package management within chroots
Integration Points
- deb-orchestrator: REST API for build environment requests
- deb-bootc-compose: Direct integration for specific build operations
- Debian build tools: Integration with sbuild, schroot, debootstrap
- Package repositories: Debian package sources and results
Getting Started
Prerequisites
- Python 3.9+ installed
- Debian build tools (debootstrap, schroot, sbuild)
- Basic understanding of Debian packaging and chroot environments
Development Setup
# Navigate to the project directory
cd parallel_projects/deb-mock
# Install Python dependencies
pip install -r requirements.txt
# Run basic tests
python -m pytest tests/
# Run the CLI
python -m deb_mock.cli --help
Configuration
Configuration is handled through YAML files. See config.yaml for examples.
Key Differences from Fedora's Mock
Package Management
- Mock: Uses RPM, DNF/YUM
- deb-mock: Uses DEB, apt/dpkg
Build Tools
- Mock: Integrates with rpmbuild
- deb-mock: Integrates with sbuild, debuild
Repository Structure
- Mock: RPM repositories with metadata
- deb-mock: Debian package pools with Sources/Packages files
Configuration
- Mock: Python .cfg files
- deb-mock: YAML configuration files
Contributing
This project is part of Debian's bootc ecosystem development. Contributions are welcome!
Development Guidelines
- Follow Python best practices and PEP 8
- Write comprehensive tests for all functionality
- Document all public APIs and interfaces
- Ensure compatibility with Debian's development standards
Contact
- Project: Part of deb-bootc-compose ecosystem
- Goal: Create Debian's equivalent to Fedora's Mock build environment manager
- Timeline: Phase 1 development (Weeks 1-8)
License
[License information to be added]
Note: This is a development project. The project is currently in early development and not ready for production use. It's being developed in parallel with deb-bootc-compose and deb-orchestrator to create Debian's complete bootc ecosystem.