Plugins Overview
Chantal’s plugin architecture enables support for different repository types.
What are Plugins?
Plugins extend Chantal to support different repository types like RPM, DEB/APT, PyPI, etc. Each repository type requires two types of plugins:
Sync Plugin - Downloads and stores packages from upstream
Publisher Plugin - Creates publishable repositories with correct metadata
Available Plugins
Plugin |
Type |
Status |
Description |
|---|---|---|---|
Sync + Publisher |
✅ Available |
DNF/YUM repositories (RHEL, CentOS, Fedora) |
|
Sync + Publisher |
✅ Available |
Debian/Ubuntu APT repositories |
|
Sync + Publisher |
✅ Available |
Kubernetes Helm chart repositories |
|
Sync + Publisher |
✅ Available |
Alpine Linux package repositories |
|
PyPI |
Sync + Publisher |
🚧 Planned |
Python Package Index |
npm |
Sync + Publisher |
🚧 Planned |
Node.js package repositories |
Plugin Architecture
┌─────────────────────────────────────────┐
│ CLI Commands │
│ (chantal repo sync, publish, etc.) │
└────────────────┬────────────────────────┘
│
┌────────────────▼────────────────────────┐
│ Plugin Manager │
│ - Plugin discovery │
│ - Plugin registration │
│ - Plugin execution │
└────────────────┬────────────────────────┘
│
┌────────┴────────┐
▼ ▼
┌───────────────┐ ┌───────────────┐
│ Sync Plugin │ │Publisher Plugin│
│ │ │ │
│ - Fetch │ │ - Hardlinks │
│ - Parse │ │ - Metadata │
│ - Filter │ │ - Compress │
│ - Download │ │ │
└───────────────┘ └───────────────┘
How Plugins Work
Sync Plugin Workflow
Fetch metadata from upstream (e.g.,
repomd.xmlfor RPM)Parse package list from metadata
Apply filters (architecture, patterns, etc.)
Download packages to content-addressed pool
Update database with package metadata
Publisher Plugin Workflow
Query database for packages in repository
Create directory structure for published repository
Create hardlinks from pool to published directory
Generate metadata specific to repository type
Compress metadata files
Plugin Types
RPM Plugin
For DNF/YUM-based distributions (RHEL, CentOS, Fedora, Rocky, Alma).
Features:
Repomd.xml/primary.xml.gz parsing
RPM-specific filtering
RHEL CDN support (client certificates)
Modular repository support (future)
APT/DEB Plugin
For Debian/Ubuntu-based distributions.
Features:
InRelease/Release parsing
Packages(.gz) parsing and generation
Multi-component and multi-architecture support
RFC822-format metadata
Mirror and filtered modes
Content-addressed storage for .deb files
PyPI Plugin (Planned)
For Python Package Index mirroring.
Planned features:
Simple Index API (PEP 503)
Wheel and source distribution support
JSON API generation
Requirements.txt filtering
Creating Custom Plugins
See Custom Plugins for detailed guide on creating your own plugins.
Quick example:
from chantal.plugins.base import SyncPlugin
class MyPlugin(SyncPlugin):
def sync(self, session, repository, config):
# Implement sync logic
pass
Plugin Configuration
Plugins are configured per-repository in YAML:
repositories:
- id: my-repo
type: rpm # Selects RPM plugin
feed: https://example.com/repo
# Plugin-specific options...
Plugin Registry
Plugins are registered in src/chantal/plugins/__init__.py:
SYNC_PLUGINS = {
'rpm': RpmSyncPlugin,
# Add new plugins here
}
PUBLISHER_PLUGINS = {
'rpm': RpmPublisher,
# Add new plugins here
}
Plugin Best Practices
Idempotent operations - Safe to run multiple times
Error handling - Handle network errors gracefully
Progress reporting - Report progress for long operations
Checksum verification - Always verify package integrity
Atomic updates - Use temporary directories
Cleanup - Remove temporary files on failure
Logging - Log operations and errors
Further Reading
RPM Plugin - RPM/DNF/YUM support
APT Plugin - Debian/Ubuntu APT support
Helm Plugin - Kubernetes Helm charts
Alpine APK Plugin - Alpine Linux packages
Custom Plugins - Creating your own plugins
Plugin System Architecture - Technical details