-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat: subpath mounts #2871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: subpath mounts #2871
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for mounting specific subpaths within S3-backed volumes, enabling isolation of data and multi-tenancy use cases. When a subpath is specified, only that S3 prefix is accessible in the sandbox; otherwise, the entire volume is mounted.
- Adds optional
subpathfield to volume mount configurations across all SDKs - Implements subpath mounting logic in the Docker client using mount-s3's
--prefixflag - Provides example code demonstrating subpath usage for data isolation
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| libs/sdk-typescript/src/Volume.ts | Updated VolumeService documentation to describe subpath functionality |
| libs/sdk-python/src/daytona/common/volume.py | Added docstring documenting the subpath attribute for VolumeMount |
| libs/runner-api-client/src/models/dto-volume-dto.ts | Added subpath field to VolumeDTO TypeScript interface |
| libs/api-client/src/models/sandbox-volume.ts | Added subpath field with documentation to SandboxVolume interface |
| libs/api-client-python/daytona_api_client/models/sandbox_volume.py | Added subpath field to Python API client model |
| libs/api-client-python-async/daytona_api_client_async/models/sandbox_volume.py | Added subpath field to async Python API client model |
| libs/api-client-go/model_sandbox_volume.go | Implemented subpath field with getter/setter methods in Go client |
| libs/api-client-go/api/openapi.yaml | Added subpath field and examples to OpenAPI specification |
| examples/typescript/volumes/index.ts | Added example demonstrating subpath mounting for multi-tenancy |
| examples/python/volumes/volume.py | Added Python example showing subpath usage |
| examples/python/volumes/_async/volume.py | Added async Python example for subpath mounting |
| apps/runner/pkg/docker/volumes_mountpaths.go | Core implementation: generates unique mount points per volume+subpath and passes --prefix to mount-s3 |
| apps/runner/pkg/api/dto/volume.go | Added subpath field to runner API DTO |
| apps/runner/pkg/api/docs/swagger.yaml | Updated Swagger documentation with subpath field |
| apps/runner/pkg/api/docs/swagger.json | Updated JSON Swagger spec with subpath field |
| apps/runner/pkg/api/docs/docs.go | Updated generated Go docs with subpath field |
| apps/api/src/sandbox/runner-adapter/runnerAdapter.legacy.ts | Passes subpath from sandbox volumes to runner |
| apps/api/src/sandbox/dto/sandbox.dto.ts | Added subpath field with API documentation to SandboxVolume DTO |
| .devcontainer/Dockerfile | Installs mount-s3 1.20.0 to support the --prefix flag |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0d6873a to
ffc6061
Compare
Tpuljak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding the subpath example to https://www.daytona.io/docs/en/volumes/ as well
Signed-off-by: Vedran Jukic <[email protected]>
Signed-off-by: Vedran <[email protected]>
ffc6061 to
f2c156c
Compare
|
Subpath example is already included for both python and ts |
Signed-off-by: Vedran <[email protected]>
Signed-off-by: Vedran <[email protected]>
| RUN wget https://s3.amazonaws.com/mountpoint-s3-release/1.20.0/x86_64/mount-s3-1.20.0-x86_64.deb \ | ||
| && apt install -y ./mount-s3-1.20.0-x86_64.deb \ | ||
| && rm -f mount-s3-1.20.0-x86_64.deb | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails on arm arch so something like this should do it:
| RUN wget https://s3.amazonaws.com/mountpoint-s3-release/1.20.0/x86_64/mount-s3-1.20.0-x86_64.deb \ | |
| && apt install -y ./mount-s3-1.20.0-x86_64.deb \ | |
| && rm -f mount-s3-1.20.0-x86_64.deb | |
| RUN apt update && export DEBIAN_FRONTEND=noninteractive \ | |
| && apt -y install --no-install-recommends fuse libfuse2 \ | |
| && MOUNT_S3_ARCH=$([ "$TARGETARCH" = "amd64" ] && echo "x86_64" || echo "arm64") \ | |
| && wget [https://s3.amazonaws.com/mountpoint-s3-release/1.20.0/${MOUNT_S3_ARCH}/mount-s3-1.20.0-${MOUNT_S3_ARCH}.deb](https://s3.amazonaws.com/mountpoint-s3-release/1.20.0/$%7BMOUNT_S3_ARCH%7D/mount-s3-1.20.0-$%7BMOUNT_S3_ARCH%7D.deb) \ | |
| && apt install -y ./mount-s3-1.20.0-${MOUNT_S3_ARCH}.deb \ | |
| && rm -f mount-s3-1.20.0-${MOUNT_S3_ARCH}.deb``` |
Description
Volume subpath adds support for multiple subpaths from the same volume.
Documentation