feat: add dev container with all Pulp services for AI agents#1062
Merged
Conversation
Adds a self-contained development container (dev-container/) that runs PostgreSQL 16, Redis, and all three Pulp services (api, content, worker) managed by supervisord. Includes helper scripts for patch management, service restarts, and testing. A GitHub Action builds and pushes the image to GHCR on every branch push. The /workspace volume follows alcove conventions for shared access between the Skiff container and the dev environment. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Reviewer's GuideAdds a new UBI9-based dev container image that runs PostgreSQL, Redis, and all three Pulp services under supervisord, plus CI automation to build/push the image and helper scripts and docs for patching, restarting, and testing within the container. Sequence diagram for dev container startup and service initializationsequenceDiagram
actor Developer
participant DockerEngine
participant DevContainer
participant Entrypoint as entrypoint_sh
participant Postgres as PostgreSQL16
participant Redis
participant Pulpcore as pulpcore_manager
participant Supervisor as supervisord
Developer->>DockerEngine: docker run hosted-pulp-dev-env
DockerEngine->>DevContainer: Start container with entrypoint
DevContainer->>Entrypoint: Execute /entrypoint.sh
Entrypoint->>Postgres: pg_ctl start
loop Wait for PostgreSQL
Entrypoint->>Postgres: pg_isready
Postgres-->>Entrypoint: ready when accepting connections
end
Entrypoint->>Postgres: Create user pulp (if missing)
Entrypoint->>Postgres: Create database pulp (if missing)
Entrypoint->>Redis: Start redis-server (daemon)
Entrypoint->>DevContainer: Check /workspace/pulp-service
alt Dev source present
Entrypoint->>DevContainer: pip install -e /workspace/pulp-service/pulp_service
end
Entrypoint->>Pulpcore: pulpcore-manager migrate --noinput
Entrypoint->>Pulpcore: reset-admin-password (PULP_DEFAULT_ADMIN_PASSWORD)
Entrypoint->>Postgres: pg_ctl stop
Entrypoint->>Redis: redis-cli shutdown
Entrypoint->>Supervisor: Start supervisord -n -c /etc/supervisord.conf
Supervisor->>Postgres: Manage PostgreSQL program
Supervisor->>Redis: Manage Redis program
Supervisor->>DevContainer: Start pulp-api, pulp-content, pulp-worker
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- The entrypoint script manually starts/stops PostgreSQL and Redis before handing over to supervisord, while supervisord is also configured to manage those same processes; consider running migrations against the supervisord-managed services (e.g., by starting supervisord first, then using
supervisorctlor a one-shot command) to avoid duplicated process management and potential race conditions.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The entrypoint script manually starts/stops PostgreSQL and Redis before handing over to supervisord, while supervisord is also configured to manage those same processes; consider running migrations against the supervisord-managed services (e.g., by starting supervisord first, then using `supervisorctl` or a one-shot command) to avoid duplicated process management and potential race conditions.
## Individual Comments
### Comment 1
<location path="dev-container/settings.py" line_range="6-13" />
<code_context>
+DOMAIN_ENABLED = True
+SECRET_KEY = "dev-secret-key-not-for-production"
+
+DATABASES = {
+ "default": {
+ "ENGINE": "django.db.backends.postgresql",
+ "NAME": "pulp",
+ "USER": "pulp",
+ "PASSWORD": "",
+ "HOST": "localhost",
+ "PORT": "5432",
+ }
+}
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Align the database password configuration with how the PostgreSQL role is created, or make it explicit that trust auth is used.
The entrypoint creates the `pulp` DB role with a password (`CREATE USER pulp WITH SUPERUSER PASSWORD 'pulp'`), but this config sets `
Suggested implementation:
```python
DOMAIN_ENABLED = True
SECRET_KEY = "dev-secret-key-not-for-production"
# NOTE: The dev container entrypoint creates the 'pulp' PostgreSQL role with password 'pulp':
# CREATE USER pulp WITH SUPERUSER PASSWORD 'pulp';
# This database configuration is for development only and assumes that setup.
DATABASES = {
```
```python
"USER": "pulp",
"PASSWORD": "pulp",
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Comment on lines
+6
to
+13
| DATABASES = { | ||
| "default": { | ||
| "ENGINE": "django.db.backends.postgresql", | ||
| "NAME": "pulp", | ||
| "USER": "pulp", | ||
| "PASSWORD": "", | ||
| "HOST": "localhost", | ||
| "PORT": "5432", |
Contributor
There was a problem hiding this comment.
suggestion (bug_risk): Align the database password configuration with how the PostgreSQL role is created, or make it explicit that trust auth is used.
The entrypoint creates the pulp DB role with a password (CREATE USER pulp WITH SUPERUSER PASSWORD 'pulp'), but this config sets `
Suggested implementation:
DOMAIN_ENABLED = True
SECRET_KEY = "dev-secret-key-not-for-production"
# NOTE: The dev container entrypoint creates the 'pulp' PostgreSQL role with password 'pulp':
# CREATE USER pulp WITH SUPERUSER PASSWORD 'pulp';
# This database configuration is for development only and assumes that setup.
DATABASES = { "USER": "pulp",
"PASSWORD": "pulp",
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dev-container/) with PostgreSQL 16, Redis, and all three Pulp services (api, content, worker) managed by supervisordpulp-add-patch,pulp-remove-patch,pulp-restart,pulp-testghcr.io/<owner>/hosted-pulp-dev-env:<branch>on every push to any branch.CLAUDE.mddocuments all commands, services, and alcove/workspacevolume integrationTest plan
/pulp/api/v3/status/returns healthy status with all pluginspulp-add-patch/pulp-remove-patchscriptspulp-testwith mounted workspace/workspacevolume🤖 Generated with Claude Code
Summary by Sourcery
Add a self-contained development container image that runs all Pulp services with PostgreSQL and Redis for local development and AI agent integration.
New Features:
Enhancements:
Build:
CI:
Documentation: