Skip to content

Commit a936189

Browse files
authored
remove ocistorage (#1297)
1 parent d54793e commit a936189

17 files changed

Lines changed: 30 additions & 760 deletions

.alcove/agents/planner-v2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ prompt: |
3131
pulp-worker (Celery/Redis)
3232
- Auth: X-RH-IDENTITY header → custom auth classes in app/authentication.py
3333
- Multi-tenancy: DomainOrg model maps org_id → Pulp domain
34-
- Storage: S3Boto3Storage (pulpcore built-in, with CloudFront patches), OCIStorage (OCI/ORAS)
34+
- Storage: S3Boto3Storage (pulpcore built-in, with CloudFront patches)
3535
- Formatter: black --line-length 100
3636
- Test runner: pytest pulp_service/pulp_service/tests/functional/
3737

.alcove/agents/pulp-developer/AGENT.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,12 @@ Additional ContextVars in middleware.py:
9292
- `x_quay_auth_var` — for Quay authentication context
9393
- `x_task_diagnostics_var` — for task profiling diagnostics
9494

95-
### Storage (app/storage.py)
96-
- `OCIStorage` (extends `BaseStorage`) — stores artifacts as OCI blobs in Quay.io via ORAS client
97-
- S3 via pulpcore's built-in `S3Boto3Storage` with CloudFront patches (no custom class in pulp-service)
95+
### Storage
96+
- S3 via pulpcore's built-in `S3Boto3Storage` with CloudFront patches
9897
- `CreateDomainView` clones storage settings from `template-domain-s3`
9998

99+
> **Decommissioned:** The custom `OCIStorage` backend (ORAS/Quay.io) has been removed.
100+
100101
### Custom viewsets (app/viewsets.py)
101102
- `FeatureContentGuardViewSet` — subscription-feature content guards
102103
- `VulnerabilityReport` — RPM/Python/Gem/npm scanning via osv.dev
@@ -126,6 +127,6 @@ Additional ContextVars in middleware.py:
126127
- Tests: `pulp_service/pulp_service/tests/functional/`
127128

128129
### Runtime patches (critical awareness)
129-
18 patches applied at Docker build time to modify pulpcore and upstream plugins.
130+
11 patches applied at Docker build time to modify pulpcore and upstream plugins.
130131
Any change touching patched areas must verify patch compatibility.
131-
Patches cover: OCI storage, CloudFront, registry API routing, ClamAV, attestation.
132+
Patches cover: CloudFront, registry API routing, ClamAV, attestation.

.alcove/agents/reviewer-security.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ prompt: |
3333
- **Multi-tenancy**: DomainOrg model maps org_id → Pulp domain. Each org's
3434
content is isolated via domain-based routing.
3535
- **Content guards**: Control access to content distribution endpoints.
36-
- **Storage backends**: S3Boto3Storage (pulpcore built-in, with CloudFront patches) and OCIStorage (OCI/ORAS)
36+
- **Storage backends**: S3Boto3Storage (pulpcore built-in, with CloudFront patches)
3737
handle artifact storage with pre-signed URLs.
3838
- **Workers**: Celery tasks run background operations (scanning, metrics).
3939
- **Middleware**: ContextVar carries org_id, user_id across request layers.

.alcove/agents/triage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ prompt: |
3131
pulp-service extends Pulpcore with Red Hat cloud-specific features:
3232
- Multi-tenant authentication via X-RH-IDENTITY header
3333
- Domain-based org isolation (DomainOrg model)
34-
- Custom S3/OCI storage backends
34+
- Custom S3 storage (via pulpcore's S3Boto3Storage with CloudFront patches)
3535
- Content guards, vulnerability reporting, OpenTelemetry observability
3636
- Three-service architecture: pulp-api, pulp-content, pulp-worker
3737

.alcove/agents/upgrade-deps/AGENT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ When the workflow finishes, `/workspace/pulp-service` has all changes applied in
7373

7474
```bash
7575
export PATH="$HOME/.swamp/bin:$PATH"
76-
for pkg in pulpcore pulp-container pulp-python pulp-rpm pulp-maven pulp-file pulp-npm oras django-storages; do
76+
for pkg in pulpcore pulp-container pulp-python pulp-rpm pulp-maven pulp-file pulp-npm django-storages; do
7777
swamp data get --workflow "pulp-upgrade-check" "result-${pkg}" 2>/dev/null | grep -E '"status":\s*"(conflicts|regen_verify_failed|failed)"' && echo "^^^ $pkg has unresolved patches"
7878
done
7979
```
@@ -94,7 +94,7 @@ First, uninstall all packages that have patches applied to them:
9494
curl -s -X POST http://$DEV_CONTAINER_HOST/exec \
9595
-H "Authorization: Bearer $DEV_TOKEN" \
9696
-H "Content-Type: application/json" \
97-
-d '{"cmd": "pip uninstall -y pulpcore pulp-python pulp-container pulp-rpm pulp-maven pulp-file pulp-npm django-storages oras", "timeout": 120}'
97+
-d '{"cmd": "pip uninstall -y pulpcore pulp-python pulp-container pulp-rpm pulp-maven pulp-file pulp-npm django-storages", "timeout": 120}'
9898
```
9999

100100
IMPORTANT: `pip uninstall` only removes files that pip installed. Files CREATED by patches (new files, not modifications) survive the uninstall. You MUST delete these manually before reinstalling.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Decommissioned the custom OCI storage backend (`OCIStorage`). Removed the `storage.py` module, `oras` dependency, and Docker build patches 0010, 0011, and 0028. Production deployments use S3 via pulpcore's built-in `S3Boto3Storage`.

CLAUDE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
pulp-service is a **Django REST Framework plugin for Pulpcore** that extends the Pulp content management platform with Red Hat cloud-specific features: multi-tenant authentication (X-RH-IDENTITY), custom S3/OCI storage backends, domain-based org isolation, content guards, vulnerability reporting, and OpenTelemetry observability.
7+
pulp-service is a **Django REST Framework plugin for Pulpcore** that extends the Pulp content management platform with Red Hat cloud-specific features: multi-tenant authentication (X-RH-IDENTITY), S3 storage (via pulpcore's built-in backend with CloudFront patches), domain-based org isolation, content guards, vulnerability reporting, and OpenTelemetry observability.
88

99
The plugin is registered via the `pulpcore.plugin` entry point in `pulp_service/setup.py`.
1010

1111
## Repository Layout
1212

1313
- `pulp_service/` — The Python package (all source code lives here)
14-
- `pulp_service/app/` — Core Django app: models, viewsets, serializers, middleware, auth, storage, tasks
14+
- `pulp_service/app/` — Core Django app: models, viewsets, serializers, middleware, auth, tasks
1515
- `pulp_service/tests/functional/` — Functional tests (pytest + pytest-django)
1616
- `setup.py`, `requirements.txt` — Package definition and dependencies
1717
- `images/` — Container build assets (startup scripts for pulp-api, pulp-content, pulp-worker; WSGI middleware)
@@ -66,7 +66,7 @@ WSGI middleware (`images/assets/log_middleware.py`) → Django middleware stack
6666
- **Authentication**: `X-RH-IDENTITY` header (base64-encoded JSON) → custom auth classes in `app/authentication.py`
6767
- **Multi-tenancy**: `DomainOrg` model maps org_id → Pulp domain; domain-based routing for content APIs
6868
- **Context variables**: `ContextVar` instances in `app/middleware.py` carry request-scoped data (org_id, user_id, request_path) across layers
69-
- **Storage backends**: `AIPCCStorageBackend` (S3) and `OCIStorageBackend` (OCI/ORAS) in `app/storage.py`
69+
- **Storage**: S3 via pulpcore's built-in `S3Boto3Storage` with CloudFront patches; domain creation clones settings from `template-domain-s3`
7070
- **Tasks**: Background work in `app/tasks/` (package scanning, domain metrics, RDS testing)
7171

7272
**Upstream plugins this extends**: pulpcore, pulp-python, pulp-container, pulp-rpm, pulp-npm, pulp-maven, pulp-hugging-face.
@@ -80,7 +80,7 @@ Uses **towncrier**. For any non-trivial change, create a file in `CHANGES/` name
8080
- **Ruff** formatter and linter, line length 120, targeting py311
8181
- 23 lint rule categories as "harness sensors" for agentic development (including security via flake8-bandit)
8282
- Complexity thresholds: max-complexity=10, max-branches=10, max-args=6, max-statements=40
83-
- Per-file exceptions: viewsets.py and rds_connection_tests.py (complexity rules), storage.py (hardcoded temp paths), tests (argument count, print, unused args, security), migrations (excluded entirely)
83+
- Per-file exceptions: viewsets.py and rds_connection_tests.py (complexity rules), tests (argument count, print, unused args, security), migrations (excluded entirely)
8484

8585
## Code Gotchas
8686

Dockerfile

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,22 +113,12 @@ RUN ln -s /usr/local/lib/pulp/bin/pulpcore-manager /usr/local/bin/pulpcore-manag
113113
RUN chmod 2775 /var/lib/pulp/{scripts,media,tmp,assets}
114114
RUN chown :root /var/lib/pulp/{scripts,media,tmp,assets}
115115

116-
COPY images/assets/patches/0010-Added-ability-to-return-a-URL-for-a-blob.patch /tmp/
117-
RUN patch -p1 -d /usr/local/lib/pulp/lib/python${PYTHON_VERSION}/site-packages < /tmp/0010-Added-ability-to-return-a-URL-for-a-blob.patch
118-
119-
COPY images/assets/patches/0011-ocistorage-backend-changes.patch /tmp/
120-
RUN patch -p1 -d /usr/local/lib/pulp/lib/python${PYTHON_VERSION}/site-packages < /tmp/0011-ocistorage-backend-changes.patch
121-
122116
COPY images/assets/patches/0018-Re-root-the-registry-API-at-api-pulp-v2.patch /tmp/
123117
RUN patch -p1 -d /usr/local/lib/pulp/lib/python${PYTHON_VERSION}/site-packages < /tmp/0018-Re-root-the-registry-API-at-api-pulp-v2.patch
124118

125119
COPY images/assets/patches/0022-Adds-authentication-to-the-mvn-deploy-api.patch /tmp/
126120
RUN patch -p1 -d /usr/local/lib/pulp/lib/python${PYTHON_VERSION}/site-packages < /tmp/0022-Adds-authentication-to-the-mvn-deploy-api.patch
127121

128-
COPY images/assets/patches/0028-OCIStorage-create-manifest.patch /tmp/
129-
RUN patch -p1 -d /usr/local/lib/pulp/lib/python${PYTHON_VERSION}/site-packages < /tmp/0028-OCIStorage-create-manifest.patch
130-
131-
132122
COPY images/assets/patches/0031-Replace-ResponseContentDisposition-in-cloudfront.patch /tmp/
133123
RUN patch -p1 -d /usr/local/lib/pulp/lib/python${PYTHON_VERSION}/site-packages < /tmp/0031-Replace-ResponseContentDisposition-in-cloudfront.patch
134124

docs/ARCHITECTURE.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ This index helps you quickly locate code for common development tasks.
3131
| **Authentication** | `pulp_service/pulp_service/app/authentication.py` | Custom auth backends (X.509, SAML) |
3232
| **Authorization** | `pulp_service/pulp_service/app/authorization.py` | Permission and access control logic |
3333
| **Middleware** | `pulp_service/pulp_service/app/middleware.py` | Django middleware (profiling, headers, metrics) |
34-
| **Storage** | `pulp_service/pulp_service/app/storage.py` | Custom S3 storage backends |
3534
| **Signals** | `pulp_service/pulp_service/app/signals.py` | Django signal handlers |
3635
| **Tasks** | `pulp_service/pulp_service/app/tasks/` | Celery background tasks |
3736
| **Content Server** | `pulp_service/pulp_service/app/content.py` | aiohttp middleware for pulp-content |
@@ -235,12 +234,11 @@ The `X-RH-IDENTITY` header contains base64-encoded JSON:
235234

236235
## Storage Backend
237236

238-
Custom S3 storage implementation in `pulp_service/pulp_service/app/storage.py`:
239-
*Plugin-specific - extends Django's S3Boto3Storage beyond upstream Pulpcore*
237+
Production deployments use pulpcore's built-in `S3Boto3Storage` with CloudFront patches applied at image build time (patch 0031). Domain creation and migration APIs clone storage settings from the `template-domain-s3` domain so callers never provide S3 credentials directly.
240238

241-
- **AIPCCStorageBackend** - Extends Django's S3Boto3Storage
242-
- **OCIStorageBackend** - OCI-specific storage with manifest handling
243-
- Supports multipart uploads and custom metadata
239+
### Decommissioned: OCI Storage
240+
241+
The custom `OCIStorage` backend (artifacts stored as OCI blobs in Quay.io via the ORAS client) has been **decommissioned**. It was previously implemented in `pulp_service/pulp_service/app/storage.py` with supporting Docker build patches (0010, 0011, 0028) and the `oras` Python dependency. All OCI storage support has been removed from pulp-service; existing domains must use S3 storage. The separate `oci-storage-backup-setup` repository is unaffected and remains available for backup-related workflows.
244242

245243
## Database Models
246244

@@ -325,7 +323,7 @@ Background tasks using Celery (in `pulp_service/pulp_service/app/tasks/`):
325323
- ⬆️ `PULP_DB_ENCRYPTION_KEY=/etc/pulp/keys/database_fields.symmetric.key` - DB field encryption
326324
- ⬆️ `PULP_CACHE_ENABLED=true` - Enable Redis caching
327325
- ⬆️ `PULP_REDIS_PORT=6379` - Redis port
328-
- ⬆️ `PULP_STORAGES__default__BACKEND` - Storage backend class (🔧 set to plugin AIPCCStorageBackend)
326+
- ⬆️ `PULP_STORAGES__default__BACKEND` - Storage backend class (S3Boto3Storage)
329327
- ⬆️ `PULP_STORAGES__default__OPTIONS__default_acl` - S3 ACL setting
330328
- ⬆️ `PULP_STORAGES__default__OPTIONS__signature_version=s3v4` - S3 signature version
331329
- ⬆️ `PULP_STORAGES__default__OPTIONS__addressing_style=path` - S3 addressing style
@@ -678,7 +676,6 @@ This service is a Django plugin built on top of Pulp (Python-based repository ma
678676
- Extends core models with plugin-specific models (RHCertGuardPermission, PushRepository, RHServiceAccount)
679677
- Overrides authentication backends (RHServiceAccountCertAuthentication, RHSamlAuthentication)
680678
- Adds custom middleware (ProfilerMiddleware, RhEdgeHostMiddleware, ActiveConnectionsMetricMiddleware)
681-
- Extends storage backends (AIPCCStorageBackend, OCIStorageBackend)
682679
- Adds custom viewsets for Red Hat-specific functionality
683680
- Implements multi-domain support for tenant isolation
684681

@@ -714,7 +711,6 @@ This service is a Django plugin built on top of Pulp (Python-based repository ma
714711
- Tag management
715712

716713
**Plugin Integration:**
717-
- Custom storage backend (OCIStorageBackend) with manifest handling
718714
- Token authentication disabled (PULP_TOKEN_AUTH_DISABLED=true)
719715
- Certificate-based access control (RHCertGuardPermission)
720716
- Multi-tenant container registries with domain isolation

images/assets/patches/0010-Added-ability-to-return-a-URL-for-a-blob.patch

Lines changed: 0 additions & 134 deletions
This file was deleted.

0 commit comments

Comments
 (0)