fix(deployment): Update archives directory mount paths in Presto Docker Compose project to match the CLP package Compose project (fixes #1496).#1500
Conversation
… Compose project to match CLP Package Compose (fixes y-scope#1496).
WalkthroughThe PR updates the Presto worker Docker Compose volume mounts to add explicit Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Init as init.py
participant Env as Environment
participant Compose as docker-compose
rect rgb(230,245,255)
Note over Init,Env: Initialization phase
Init->>Env: set CLP_STAGED_ARCHIVES_DIR=<staging_directory> (for S3)
Init->>Env: (no longer sets CLP_ARCHIVES_DIR for S3)
end
rect rgb(245,255,230)
Note over Env,Compose: Compose uses env vars for mounts
Env->>Compose: CLP_ARCHIVES_DIR or fallback "empty" -> mount /var/data/archives:ro
Env->>Compose: CLP_STAGED_ARCHIVES_DIR or fallback "empty" -> mount /var/data/staged-archives:ro
end
Note over Compose: presto-worker mounts resolved paths (or empty dummy volume)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related issues
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
||
| volumes: | ||
| coordinator-config: | ||
| empty: |
There was a problem hiding this comment.
This volume differs from the one used in the Package project, where a tmpfs mount with size 0 is configured.
In this case, the volume is mounted as read-only, so we don't need to account for any data written to the dummy empty volume.
There was a problem hiding this comment.
Perhaps we should add a comment for future editors?
There was a problem hiding this comment.
one moment. i think it's worth marking the volume as readonly to avoid mistakes
There was a problem hiding this comment.
actually the readonly attribute can only be applied when defining the mount, not in the volume definition. changing the definition to tmpfs like the Package project should just work, but it will take time to re-validate. i think it's fine to keep it simple as currently is, so long it works and has been validated
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
tools/deployment/presto-clp/docker-compose.yaml(1 hunks)tools/deployment/presto-clp/scripts/init.py(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: package-image
- GitHub Check: lint-check (ubuntu-24.04)
- GitHub Check: lint-check (macos-15)
🔇 Additional comments (2)
tools/deployment/presto-clp/scripts/init.py (1)
127-127: LGTM! Environment variable renamed to align with staging archives semantics.The change from
CLP_ARCHIVES_DIRtoCLP_STAGED_ARCHIVES_DIRcorrectly reflects that S3 storage uses staging directories rather than direct archive directories. This aligns with the docker-compose.yaml updates that mount this variable to/var/data/staged-archives.tools/deployment/presto-clp/docker-compose.yaml (1)
37-38: LGTM! Unified mount paths with safe defaults.The fixed mount paths (
/var/data/archivesand/var/data/staged-archives) with fallback to theemptyvolume provide a clean solution that:
- Standardizes paths to match CLP Package Compose conventions
- Allows the service to start even when environment variables are unset
- Uses read-only mounts appropriately for archive directories
|
|
||
| volumes: | ||
| coordinator-config: | ||
| empty: |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Consider a more descriptive volume name.
The volume name empty is functional but somewhat generic. Consider renaming it to something more descriptive like presto-empty-default or empty-fallback to clarify its purpose as a safe fallback volume.
🤖 Prompt for AI Agents
In tools/deployment/presto-clp/docker-compose.yaml around line 47 the Docker
volume is named `empty`, which is too generic; rename it to a more descriptive
name (e.g., `presto-empty-default` or `empty-fallback`) across the compose file
and any services that reference it so it clearly communicates its role as a safe
fallback volume, update the volumes: section and all volume mounts to use the
new name, and run a quick docker-compose config validation to ensure no
references were missed.
kirkrodrigues
left a comment
There was a problem hiding this comment.
All good except for the question I posted.
For the PR title, how about:
fix(deployment): Update `/var/data` mount paths in Presto Docker Compose project to match the CLP package Compose project (fixes #1496).
/var/data mount paths in Presto Docker Compose project to match CLP Package Compose (fixes #1496)./var/data mount paths in Presto Docker Compose project to match the CLP package Compose project (fixes #1496).
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
kirkrodrigues
left a comment
There was a problem hiding this comment.
Sorry, I confused myself before with the PR title. How about:
fix(deployment): Update archives directory mount paths in Presto Docker Compose project to match the CLP package Compose project (fixes #1496).
/var/data mount paths in Presto Docker Compose project to match the CLP package Compose project (fixes #1496).…er Compose project to match the CLP package Compose project (fixes y-scope#1496). (y-scope#1500)
Description
This change standardizes archive-related mount points in the Presto Docker Compose setup to align with the CLP Package Compose conventions.
/var/data/archives:rousing${CLP_ARCHIVES_DIR:-empty}./var/data/staged-archives:rousing${CLP_STAGED_ARCHIVES_DIR:-empty}.emptyvolume as a safe default so Compose can start even when env vars are unset.s3archive output storage, setCLP_STAGED_ARCHIVES_DIRbased on the configuredstaging_directory(previously setCLP_ARCHIVES_DIR).Checklist
breaking change.
Validation performed
fs output
clp, "Schema" todefaults3 output
clp-config.yml, also configure the archives output to use s3 output:Summary by CodeRabbit