No description
Find a file
robojerk 45c124637b
Some checks failed
Comprehensive CI/CD Pipeline / Build and Test (push) Failing after 2m1s
Comprehensive CI/CD Pipeline / Security Audit (push) Successful in 46s
Comprehensive CI/CD Pipeline / Package Validation (push) Successful in 1m7s
Comprehensive CI/CD Pipeline / Status Report (push) Has been skipped
builds, initial testing builds, packaging, ci workflow
2025-09-04 12:55:35 -07:00
.forgejo/workflows builds, initial testing builds, packaging, ci workflow 2025-09-04 12:55:35 -07:00
behave enhance: Add comprehensive .gitignore for deb-mock project 2025-08-18 23:37:49 -07:00
bin builds, initial testing builds, packaging, ci workflow 2025-09-04 12:55:35 -07:00
configs builds, initial testing builds, packaging, ci workflow 2025-09-04 12:55:35 -07:00
deb_mock api tests passed 2025-09-04 11:56:52 -07:00
debian builds, initial testing builds, packaging, ci workflow 2025-09-04 12:55:35 -07:00
dev_notes update documentation to reflect name change from deb-mock to mock 2025-08-04 01:19:49 +00:00
docs Add stable Python API and comprehensive environment management 2025-09-04 10:04:16 -07:00
examples Add stable Python API and comprehensive environment management 2025-09-04 10:04:16 -07:00
filesystem builds, initial testing builds, packaging, ci workflow 2025-09-04 12:55:35 -07:00
mock enhance: Add comprehensive .gitignore for deb-mock project 2025-08-18 23:37:49 -07:00
plugins builds, initial testing builds, packaging, ci workflow 2025-09-04 12:55:35 -07:00
releng enhance: Add comprehensive .gitignore for deb-mock project 2025-08-18 23:37:49 -07:00
scripts add Debian packaging and repository infrastructure 2025-08-03 23:38:25 +00:00
testing-farm enhance: Add comprehensive .gitignore for deb-mock project 2025-08-18 23:37:49 -07:00
tests api tests passed 2025-09-04 11:56:52 -07:00
.gitignore builds, initial testing builds, packaging, ci workflow 2025-09-04 12:55:35 -07:00
.yamllint add comprehensive linting: yamllint, flake8, black, isort, shellcheck, and markdownlint 2025-08-04 02:52:59 +00:00
BINARY_TEST_RESULTS.md builds, initial testing builds, packaging, ci workflow 2025-09-04 12:55:35 -07:00
CI_SETUP_SUMMARY.md builds, initial testing builds, packaging, ci workflow 2025-09-04 12:55:35 -07:00
config.yaml enhance: Add comprehensive .gitignore for deb-mock project 2025-08-18 23:37:49 -07:00
DEBIAN_DEPENDENCY_ANALYSIS.md builds, initial testing builds, packaging, ci workflow 2025-09-04 12:55:35 -07:00
Dockerfile.api Add comprehensive testing framework, performance monitoring, and plugin system 2025-08-19 20:49:32 -07:00
FEDORA_DEBIAN_PACKAGING_COMPARISON.md builds, initial testing builds, packaging, ci workflow 2025-09-04 12:55:35 -07:00
koji-and-mock-alternative.md initial commit 2025-08-03 22:16:04 +00:00
LICENSE enhance: Add comprehensive .gitignore for deb-mock project 2025-08-18 23:37:49 -07:00
Makefile builds, initial testing builds, packaging, ci workflow 2025-09-04 12:55:35 -07:00
PACKAGING_STRATEGY.md builds, initial testing builds, packaging, ci workflow 2025-09-04 12:55:35 -07:00
PROJECT_STATUS.md initial commit 2025-08-03 22:16:04 +00:00
pyproject.toml enhance: Add comprehensive .gitignore for deb-mock project 2025-08-18 23:37:49 -07:00
pytest.ini Add comprehensive testing framework, performance monitoring, and plugin system 2025-08-19 20:49:32 -07:00
README.md enhance: Add comprehensive .gitignore for deb-mock project 2025-08-18 23:37:49 -07:00
requirements-dev.txt initial commit 2025-08-03 22:16:04 +00:00
requirements.txt enhance: Add comprehensive .gitignore for deb-mock project 2025-08-18 23:37:49 -07:00
run_tests.py Add comprehensive testing framework, performance monitoring, and plugin system 2025-08-19 20:49:32 -07:00
setup.py enhance: Add comprehensive .gitignore for deb-mock project 2025-08-18 23:37:49 -07:00
STREAMLINED_CI_SETUP.md builds, initial testing builds, packaging, ci workflow 2025-09-04 12:55:35 -07:00
test-config.yaml Fix sbuild integration and clean up codebase 2025-08-04 04:34:32 +00:00
test_api_simple.py api tests passed 2025-09-04 11:56:52 -07:00
test_api_structure.py api tests passed 2025-09-04 11:56:52 -07:00
test_sbuild_integration.py Add comprehensive testing framework, performance monitoring, and plugin system 2025-08-19 20:49:32 -07:00
tox.ini enhance: Add comprehensive .gitignore for deb-mock project 2025-08-18 23:37:49 -07:00

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

  1. deb-orchestrator requests a build environment for package building
  2. deb-mock creates an isolated chroot environment
  3. deb-mock installs build dependencies in the chroot
  4. deb-orchestrator executes build commands in the deb-mock environment
  5. 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.