# pulp/pulpcore architecture

> Architecture diagram of the GitHub repository pulp/pulpcore, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pulp/pulpcore
- Repository: https://github.com/pulp/pulpcore

## Overview

Pulp is a content-repository management and distribution platform, with pulpcore providing shared repository, API, task, and content-serving services and plugins adding content types and workflows. The principal workflow is to create or mirror repositories, manage their content and versions, then publish and serve that content to consumers. The README also highlights multi-source management and promotion between repositories. Relationships below are limited to those shown in the README or source index; unsampled implementation details are not asserted.

Main entry points: [`pulpcore/app/viewsets/repository.py`](https://github.com/pulp/pulpcore/blob/main/pulpcore/app/viewsets/repository.py) (Repository API), [`pulpcore/app/models/repository.py`](https://github.com/pulp/pulpcore/blob/main/pulpcore/app/models/repository.py) (Repository state), [`pulp_file/app/tasks/publishing.py`](https://github.com/pulp/pulpcore/blob/main/pulp_file/app/tasks/publishing.py) (Publication), [`pulpcore/content/handler.py`](https://github.com/pulp/pulpcore/blob/main/pulpcore/content/handler.py) (Content handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_repo["Repository management"]
  node_api["Repository API<br/>[repository.py]"]
  node_serializers["API serializers<br/>[repository.py]"]
  node_repository[("Repository state<br/>[repository.py]")]
  node_contentmodels[("Content records<br/>[content.py]")]
  node_coremodels[("Core domain models<br/>[__init__.py]")]
end

subgraph group_workflow["Content workflows"]
  node_taskapi["Task execution<br/>[tasks.py]"]
  node_worker["Task workers<br/>[redis_worker.py]"]
  node_repotasks["Repository tasks<br/>[repository.py]"]
  node_sync["Remote synchronization<br/>[synchronizing.py]"]
  node_download["Remote downloads<br/>[http.py]"]
  node_publication["Publication<br/>[publishing.py]"]
  node_manifest["File manifests<br/>[manifest.py]"]
end

subgraph group_delivery["Content delivery"]
  node_contentapi["Consumer content requests<br/>[entrypoint.py]"]
  node_handler["Content handler<br/>[handler.py]"]
  node_storage["Domain storage"]
end

subgraph group_plugins["Plugin capabilities"]
  node_fileapi["File plugin API<br/>[viewsets.py]"]
  node_filemodels[("File content models<br/>[models.py]")]
  node_certguard["RHSM path checks<br/>[rhsm_check_path.py]"]
end

node_client(("Repository user"))
node_consumer(("Content consumer"))

node_client -->|"manages repositories"| node_api
node_api -->|"validates requests"| node_serializers
node_api -->|"queries state"| node_repository
node_api -->|"schedules tasks"| node_taskapi
node_api -.->|"dispatches tasks"| node_repotasks
node_repotasks -->|"updates state"| node_repository
node_worker -->|"executes queued work"| node_taskapi
node_fileapi -->|"uses content models"| node_filemodels
node_filemodels -.->|"supports publishing"| node_publication
node_sync -.->|"fetches remote content"| node_download
node_sync -.->|"adds mirrored content"| node_repository
node_publication -.->|"generates manifests"| node_manifest
node_publication -.->|"publishes repository content"| node_repository
node_consumer -->|"requests content"| node_contentapi
node_contentapi -.->|"routes requests"| node_handler
node_handler -->|"reads content"| node_storage
node_handler -.->|"serves content"| node_consumer
node_coremodels -->|"exports model types"| node_repository
node_certguard -.->|"guards RHSM paths"| node_contentapi

click node_api "https://github.com/pulp/pulpcore/blob/main/pulpcore/app/viewsets/repository.py"
click node_serializers "https://github.com/pulp/pulpcore/blob/main/pulpcore/app/serializers/repository.py"
click node_repository "https://github.com/pulp/pulpcore/blob/main/pulpcore/app/models/repository.py"
click node_contentmodels "https://github.com/pulp/pulpcore/blob/main/pulpcore/app/models/content.py"
click node_taskapi "https://github.com/pulp/pulpcore/blob/main/pulpcore/tasking/tasks.py"
click node_worker "https://github.com/pulp/pulpcore/blob/main/pulpcore/tasking/redis_worker.py"
click node_repotasks "https://github.com/pulp/pulpcore/blob/main/pulpcore/app/tasks/repository.py"
click node_sync "https://github.com/pulp/pulpcore/blob/main/pulp_file/app/tasks/synchronizing.py"
click node_download "https://github.com/pulp/pulpcore/blob/main/pulpcore/download/http.py"
click node_publication "https://github.com/pulp/pulpcore/blob/main/pulp_file/app/tasks/publishing.py"
click node_manifest "https://github.com/pulp/pulpcore/blob/main/pulp_file/manifest.py"
click node_contentapi "https://github.com/pulp/pulpcore/blob/main/pulpcore/content/entrypoint.py"
click node_handler "https://github.com/pulp/pulpcore/blob/main/pulpcore/content/handler.py"
click node_storage "https://github.com/pulp/pulpcore/blob/main/pulpcore/app/storage_backends.py"
click node_fileapi "https://github.com/pulp/pulpcore/blob/main/pulp_file/app/viewsets.py"
click node_filemodels "https://github.com/pulp/pulpcore/blob/main/pulp_file/app/models.py"
click node_certguard "https://github.com/pulp/pulpcore/blob/main/pulp_certguard/rhsm/rhsm_check_path.py"
click node_coremodels "https://github.com/pulp/pulpcore/blob/main/pulpcore/app/models/__init__.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_serializers,node_repository,node_contentmodels,node_coremodels,node_client toneBlue
class node_taskapi,node_worker,node_repotasks,node_sync,node_download,node_publication,node_manifest toneAmber
class node_contentapi,node_handler,node_storage toneMint
class node_fileapi,node_filemodels,node_certguard toneRose
class node_consumer toneIndigo
```

## Components

### Repository management

- [Repository API](https://github.com/pulp/pulpcore/blob/main/pulpcore/app/viewsets/repository.py): `pulpcore/app/viewsets/repository.py`
- [API serializers](https://github.com/pulp/pulpcore/blob/main/pulpcore/app/serializers/repository.py): `pulpcore/app/serializers/repository.py`
- [Repository state](https://github.com/pulp/pulpcore/blob/main/pulpcore/app/models/repository.py): `pulpcore/app/models/repository.py`
- [Content records](https://github.com/pulp/pulpcore/blob/main/pulpcore/app/models/content.py): `pulpcore/app/models/content.py`
- [Core domain models](https://github.com/pulp/pulpcore/blob/main/pulpcore/app/models/__init__.py): `pulpcore/app/models/__init__.py`

### Content workflows

- [Task execution](https://github.com/pulp/pulpcore/blob/main/pulpcore/tasking/tasks.py): `pulpcore/tasking/tasks.py`
- [Task workers](https://github.com/pulp/pulpcore/blob/main/pulpcore/tasking/redis_worker.py): `pulpcore/tasking/redis_worker.py`
- [Repository tasks](https://github.com/pulp/pulpcore/blob/main/pulpcore/app/tasks/repository.py): `pulpcore/app/tasks/repository.py`
- [Remote synchronization](https://github.com/pulp/pulpcore/blob/main/pulp_file/app/tasks/synchronizing.py): `pulp_file/app/tasks/synchronizing.py`
- [Remote downloads](https://github.com/pulp/pulpcore/blob/main/pulpcore/download/http.py): `pulpcore/download/http.py`
- [Publication](https://github.com/pulp/pulpcore/blob/main/pulp_file/app/tasks/publishing.py): `pulp_file/app/tasks/publishing.py`
- [File manifests](https://github.com/pulp/pulpcore/blob/main/pulp_file/manifest.py): `pulp_file/manifest.py`

### Content delivery

- [Consumer content requests](https://github.com/pulp/pulpcore/blob/main/pulpcore/content/entrypoint.py): `pulpcore/content/entrypoint.py`
- [Content handler](https://github.com/pulp/pulpcore/blob/main/pulpcore/content/handler.py): `pulpcore/content/handler.py`
- [Domain storage](https://github.com/pulp/pulpcore/blob/main/pulpcore/app/storage_backends.py): `pulpcore/app/storage_backends.py`

### Plugin capabilities

- [File plugin API](https://github.com/pulp/pulpcore/blob/main/pulp_file/app/viewsets.py): `pulp_file/app/viewsets.py`
- [File content models](https://github.com/pulp/pulpcore/blob/main/pulp_file/app/models.py): `pulp_file/app/models.py`
- [RHSM path checks](https://github.com/pulp/pulpcore/blob/main/pulp_certguard/rhsm/rhsm_check_path.py): `pulp_certguard/rhsm/rhsm_check_path.py`

### Other components

- **Repository user**
- **Content consumer**

## Connections

- Repository user → Repository API: manages repositories
- Repository API → API serializers: validates requests (evidence: `pulpcore/app/viewsets/repository.py`)
- Repository API → Repository state: queries state (evidence: `pulpcore/app/viewsets/repository.py`)
- Repository API → Task execution: schedules tasks (evidence: `pulpcore/app/viewsets/repository.py`)
- Repository API → Repository tasks: dispatches tasks
- Repository tasks → Repository state: updates state (evidence: `pulpcore/app/tasks/repository.py`)
- Task workers → Task execution: executes queued work (evidence: `pulpcore/tasking/redis_worker.py`)
- File plugin API → File content models: uses content models (evidence: `pulp_file/app/viewsets.py`)
- File content models → Publication: supports publishing
- Remote synchronization → Remote downloads: fetches remote content
- Remote synchronization → Repository state: adds mirrored content
- Publication → File manifests: generates manifests
- Publication → Repository state: publishes repository content
- Content consumer → Consumer content requests: requests content
- Consumer content requests → Content handler: routes requests
- Content handler → Domain storage: reads content (evidence: `pulpcore/content/handler.py`)
- Content handler → Content consumer: serves content
- Core domain models → Repository state: exports model types (evidence: `pulpcore/app/models/__init__.py`)
- RHSM path checks → Consumer content requests: guards RHSM paths
