Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5741bbf
Refactored compose environment for running local with full
suprjinx Sep 10, 2025
659f951
removed redundant compose files
suprjinx Sep 10, 2025
5685edc
Refactor local to single compose file (simple cluster)
suprjinx Sep 15, 2025
efdfdfb
updated "upload-package" to "setup-demo.sh", which includes former
suprjinx Sep 15, 2025
4e186fc
remove unused assets
suprjinx Sep 25, 2025
fbda7f1
Restore test configs for unit
suprjinx Sep 25, 2025
6863dfb
Fix remaining test failure (due to internal domains mismatch)
suprjinx Sep 25, 2025
bc7e4b6
fix setup script errors when cluster unavailable
suprjinx Sep 26, 2025
a7f2f90
Changes for running tests in devcontainer (only supported method)
suprjinx Sep 29, 2025
2a6f7ab
Signing service for demo cluster
suprjinx Sep 29, 2025
219d915
Restore db encryption key for demo
suprjinx Sep 30, 2025
2e85841
Added a new setting, "require_jwt_auth", for facilitating demo
suprjinx Oct 1, 2025
1d7037b
Readme tweaks
suprjinx Oct 1, 2025
614427e
Fixes for deb_signing and processing inserts with dictionaries
suprjinx Oct 2, 2025
1a92aa2
test fixes to match shared config
suprjinx Oct 2, 2025
a468117
Move docker/simple/ to /demo -- including files in /assets
suprjinx Oct 3, 2025
977eb4d
removed dupe test key material and updated gitignore/dockerignore
suprjinx Oct 3, 2025
7036d74
A few fixes to work with ansible tasks to setup demo
suprjinx Oct 3, 2025
7597fc1
Remove the setup-demo script, using ansible instead
suprjinx Oct 3, 2025
6d02d16
remove demo key material
suprjinx Oct 6, 2025
37a08ce
Gitignore the keymaterial generated by 'make setup-keys'
suprjinx Oct 6, 2025
8ec4a42
Simplify make tasks (just need 'demo') and move more stuff to ansible…
suprjinx Oct 6, 2025
8e1a0ad
Move the setup-keys steps to ansible
suprjinx Oct 6, 2025
e3bfe7b
README updates
suprjinx Oct 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ services:
DB_USER: pulp-manager
DB_PASSWORD: pulp-manager
JWT_SECRET: test_secret
PULP_MANAGER_CONFIG_PATH: /workspace/local_config.ini
PULP_SYNC_CONFIG_PATH: /workspace/local_pulp_config.yml
PULP_MANAGER_CONFIG_PATH: /workspace/demo/config.ini
PULP_SYNC_CONFIG_PATH: /workspace/demo/pulp-config.yml
Is_local: "true"
networks:
- pulp-devcontainer-net
Expand Down
50 changes: 50 additions & 0 deletions .devcontainer/test_config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[database]
user=pulp-manager
password=pulp-manager
host=mariadb
port=3306
db_name=pulp_manager

[auth]
method=ldap
use_ssl=false
ldap_servers=server:389
base_dn=ou=people,dc=pulpproject,dc=com
default_domain=pulpproject.com
jwt_algorithm=HS256
jwt_token_lifetime_mins=480
admin_group=pulpmaster-rw
require_jwt_auth=false

[pulp]
deb_signing_service=pulp_deb
banned_package_regex=bannedexample|another
internal_domains=pulp-primary,pulp-secondary
git_repo_config=https://github.com/example/repo-config.git
git_repo_config_dir=repo_config
password=password
internal_package_prefix=int_
package_name_replacement_pattern=
package_name_replacement_rule=
remote_tls_validation=true
use_https_for_sync=false

[redis]
host=redis-manager
port=6379
db=0
max_page_size=24

[remotes]
sock_connect_timeout=120.0
sock_read_timeout=600.0

[paging]
default_page_size=50
max_page_size=20000

[vault]
repo_secret_namespace=test-namespace
enabled=false
url=http://localhost:8200
vault_addr=http://localhost:8200
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
demo/assets/keys/gpg/
demo/assets/certs/
.claude/
.coverage
venv/
__pycache__/
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
__pycache__
venv

# Demo environment runtime files
demo/assets/certs/*
!demo/assets/certs/.gitkeep
demo/assets/keys/gpg/
demo/assets/keys/*.pem
demo/assets/keys/*.key

# Other runtime files
.coverage
.claude/
14 changes: 4 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ RUN mkdir -p /pulp_manager \
&& groupadd pulp_manager \
&& useradd -u 10001 pulp_manager -g pulp_manager -d /pulp_manager/ \
&& apt-get update \
&& apt-get install -y python3-venv netcat \
&& apt-get install -y python3-venv netcat-openbsd \
&& python3 -m venv /opt/venv

WORKDIR /pulp_manager
Expand All @@ -33,20 +33,14 @@ RUN /opt/venv/bin/pip install --upgrade pip \
FROM base as final

# Install runtime dependencies including Git and make
RUN apt-get update && apt-get install -y netcat git make python3-dev libsasl2-dev libldap2-dev libssl-dev default-libmysqlclient-dev build-essential && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y netcat-openbsd git make python3-dev libsasl2-dev libldap2-dev libssl-dev default-libmysqlclient-dev build-essential && rm -rf /var/lib/apt/lists/*

# Copy virtual environment from builder stage
COPY --from=builder /opt/venv /opt/venv
# Copy requirements file
COPY --from=builder /pulp_manager/requirements.txt ./
# Copy application code and other necessary files
COPY alembic.ini pylint.rc pytest.ini wait_db.sh *.yml ./
ADD alembic ./alembic/.
ADD Makefile .
ADD local_config.ini .
ADD local_pulp_config.yml ./local_pulp_config.yml
ADD pulp-manager.sh .
ADD pulp_manager ./pulp_manager/.
# Copy the entire project
COPY . .

# Ensure correct permissions
RUN chown -R pulp_manager:pulp_manager /pulp_manager \
Expand Down
55 changes: 29 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,59 +1,62 @@
.DEFAULT_GOAL:=all
.DEFAULT_GOAL:=h

ROOT_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
PKG_NAME := pulp_manager

.PHONY : all
all:
.PHONY : h help
h help:
@printf "%s\n" "Usage: make <target>"
@printf "\n%s\n" "Targets:"
@printf " %-22s%s\n" \
"h|help" "Print this help" \
"t|test" "Run all tests" \
"l|lint" "Run lint" \
"c|cover" "Run coverage for all tests" \
"venv" "Create virtualenv" \
"bdist" "Create wheel file" \
"clean" "Clean workspace" \
"h|help" "Print this help"
"run-pulp3" "Start Pulp 3 locally with Docker Compose"


.PHONY : h help
h help: all
"demo" "Run demo environment"

.PHONY : l lint
l lint: venv
@echo "# pylint"; \
./venv/bin/pylint --rcfile ./pylint.rc pulp_manager/

check-devcontainer:
@if [ -z "$$Is_local" ] && [ -z "$$DEVCONTAINER" ]; then \
echo "ERROR: Tests must be run in devcontainer environment!"; \
echo ""; \
echo "To run tests:"; \
echo " 1. Open VS Code"; \
echo " 2. Use Command Palette (Cmd/Ctrl+Shift+P)"; \
echo " 3. Select 'Dev Containers: Reopen in Container'"; \
echo " 4. Wait for container to build"; \
echo " 5. Run: make t"; \
echo ""; \
exit 1; \
fi

.PHONY : t test
t test: venv
t test: venv check-devcontainer
@./venv/bin/pytest -v

.PHONY : c cover
c cover: venv
c cover: venv check-devcontainer
@. venv/bin/activate; \
coverage erase; \
coverage run --source=. --omit=pulp_manager/tests/unit/mock_repository.py -m pytest -v && coverage report --fail-under=90; \
coverage html

.PHONY : venv
venv: requirements.txt
@python3 -m venv venv
@. venv/bin/activate; \
pip install --upgrade pip; \
pip install -r requirements.txt

run-pulp-manager: setup-network
@echo "Starting local Docker Compose environment..."
docker compose -f dockercompose-local.yml up --build

.PHONY : run-pulp3
run-pulp3: setup-network
@echo "Starting Pulp 3 locally with Docker Compose..."
docker compose -f ./dockercompose-pulp3.yml up --build

setup-network:
@echo "Creating or verifying network..."
docker network inspect pulp-net >/dev/null 2>&1 || \
docker network create pulp-net
@echo "Network setup completed."
.PHONY : demo
demo: venv
@echo "Setting up demo environment..."
@. venv/bin/activate && \
pip install -q ansible 'pulp-glue>=0.29.0' 'pulp-glue-deb>=0.3.0,<0.4' && \
ansible-galaxy collection install pulp.squeezer 2>&1 | grep -v 'Installing' && \
ansible-playbook -i localhost, demo/ansible/playbook.yml
39 changes: 26 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@

The Pulp Manager application is used to coordinate common Pulp
workflows and provide additional reporting capabilities about a
cluster of Pulp servers. It is designed to work with Pulp3.
cluster of Pulp servers. It is designed to work with Pulp3 servers in
a primary/secondary setup.

## About the Project
## Why Pulp Manager?

We recommend that Pulp be operated in a primary/secondary setup. There
is a single Pulp instance known as the Pulp Primary which syncs repos
from the Internet and can also have custom or internal packages
uploaded to it. Secondaries are then configured to sync these
snapshots and internal repos.
Pulp Manager provides centralized orchestration of a clustger of Pulp3
instances and is particularly usfeful for organizations with
multi-tiered or multi-zone deployments who need coordinated syncs
between primary and secondary servers.

Pulp3 doesn't provide a method to schedule the synchronisation of
repos, and in some repository types (deb) may require multiple steps
Expand All @@ -26,7 +26,8 @@ or Jenkins.

## Core Team

This project is maintained by G-Research. For details on our team and
This project originated at [G-Research](https://github.com/G-Research)
but is now owned by the Pulp project. For details on our team and
roles, please see the [MAINTAINERS.md](MAINTAINERS.md) file.

## Documentation Index
Expand Down Expand Up @@ -128,17 +129,22 @@ components:

## Quick Start

1. **Using DevContainers (Recommended)**
1. **For Development (running tests, exploring APIs, etc) **
```bash
# Open in VS Code and select "Reopen in Container"
# Or use the CLI:
# Open in VS Code and select action "Dev Containers: Reopen in Container"
# Or use the Dev Container CLI:
devcontainer up --workspace-folder .
```

From a terminal in the devcontainer, 'make t' will run the tests.


2. **Manual Setup**
2. **For Demo cluster, use the make target to setup a complete Docker Compose environment**
```bash
make run-pulp-manager
make demo
```

When startup is finished, `docker ps` will show you the components, and all APIs will be listening.

For detailed development setup, see the [Development
Info](#development-info) section.
Expand Down Expand Up @@ -168,6 +174,7 @@ default_domain=example.com
jwt_algorithm=HS256
jwt_token_lifetime_mins=480
admin_group=pulpmaster-rw
require_jwt_auth=true

[pulp]
deb_signing_service=pulp_deb
Expand All @@ -180,6 +187,7 @@ internal_package_prefix=corp_
package_name_replacement_pattern=
package_name_replacement_rule=
remote_tls_validation=true
use_https_for_sync=true

[redis]
host=redis
Expand Down Expand Up @@ -220,6 +228,9 @@ Defines authentication allowed against the API
- `jwt_token_lifetime_mins`: Number of minutes JWT is valid for
- `admin_group`: Directory group user must be a member of to carry out
priveldged actions agains the API
- `require_jwt_auth`: Boolean whether to require JWT authentication for
protected API endpoints. Set to false for local development environments
where authentication is not needed. Defaults to true

### pulp

Expand All @@ -239,6 +250,8 @@ Settings to apply to all pulp servers
the pulp repo config
- `remote_tls_validation`: Boolean whether to require TLS validation
of remote hosts
- `use_https_for_sync`: Boolean whether to use HTTPS for repository sync URLs.
Set to false for local HTTP-only development environments. Defaults to true.

### redis

Expand Down
Loading