Skip to content

Conversation

@hittyt
Copy link
Collaborator

@hittyt hittyt commented Jan 29, 2026

Summary

Introduce OSEP-0003 to define a runtime-neutral volume and volume binding model, clarifying access modes, backend constraints, permissions/ownership expectations, concurrency notes, and security/configuration details to make the proposal actionable.

Testing

  • Not run (only add docs)
  • Unit tests
  • Integration tests
  • e2e / manual verification

Breaking Changes

  • None
  • Yes (describe impact and migration path)

Checklist

  • Linked Issue or clearly described motivation need mount a local file directory #110
  • Added/updated docs (if needed)
  • Added/updated tests (if needed)
  • Security impact considered
  • Backward compatibility considered

Clarify access modes, backend constraints, permissions, and security/config
expectations to make the volume proposal more actionable.
@Pangjiping Pangjiping added documentation Improvements or additions to documentation feature New feature or request labels Jan 29, 2026
Clarify access modes, backend constraints, permissions, and security/config
expectations to make the volume proposal more actionable.
@hittyt hittyt force-pushed the docs/support-volume branch from c6a4481 to 788d974 Compare January 29, 2026 22:56
from opensandbox import SandboxClient
from opensandbox.models import ImageSpec, ResourceLimits

client = SandboxClient(api_key="YOUR_API_KEY")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no SandboxClient class in Python SDK。

## Proposal

Add two new optional fields to the Lifecycle API:
- `volumes[]`: defines reusable, runtime-neutral storage resources.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the sandbox, even though it only has a single container, still need to define volumes + volumeMounts—a more complex semantics that’s designed for multi-container setups?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simplified the core model to a single volume concept


- Full-featured storage orchestration (auto-provisioning, snapshots, backups).
- Object storage mounting (S3/OSS) in the initial MVP.
- Cross-sandbox sharing semantics beyond explicit volume bindings.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why doesn’t the volume design support data sharing within the sandbox? If the data source is centralized, then the need for sharing is inherent. Would supporting data sharing in volumes impact the implementation and future iterations?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimized the docs description

### Non-Goals

- Full-featured storage orchestration (auto-provisioning, snapshots, backups).
- Object storage mounting (S3/OSS) in the initial MVP.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, we should consider support s3/oss/gitfs firstly, which are popular backend in production.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this Non-Goal and plan to implement local/oss in the initial MVP

```yaml
volumes:
- name: workdir
backendType: local
Copy link
Collaborator

@Spground Spground Jan 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion backendType -> type for simplification

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactored to type

- name: workdir
backendType: local
backendRef: "/data/opensandbox/user-a"
parameters:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. These parameters maybe not enough for lifecycle management of volume, e.g credential to manage user's cloud resources(oss,s3,etc).
  2. These parameters vary by different backend type.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. We are not responsible for volume lifecycle management.
  2. Yep, parameters vary by different backend type, and this is by design

Clarify access modes, backend constraints, permissions, and security/config
expectations to make the volume proposal more actionable.
### API enum specifications
Enumerations are fixed and validated by the API:
- `accessMode`: use short forms `RW` (read/write) and `RO` (read-only). Examples in this document follow that convention.
- `backendType`: `local`, `pvc`, `nfs`. `local` refers to host path bind mounts in Docker and hostPath-equivalent mounts in Kubernetes, and must be documented explicitly to avoid ambiguity.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PVC is an implementation detail and should be transparent to users.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep PVC as an explicit option—many K8s users already manage PVCs and need to reference them directly.

volumes:
- name: workdir
backendType: local
backendRef: "/data/opensandbox/user-a"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need the backendRef param?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backendRef is the minimal, explicit pointer to the actual storage resource behind a volume. Without it, the runtime can’t deterministically locate what to mount.

  • For type=local, backendRef is the absolute host path to bind mount.
  • For type=pvc, it’s the PVC claimName.
  • For type=nfs, it’s server:/export/path.

We intentionally keep it required so behavior is predictable and validation is possible; auto‑provisioned or implicit backends would need a separate type or field.


OpenSandbox users running long-lived agents need artifacts (web pages, images, reports) to persist after a sandbox is terminated or restarted. Today, the API only supports transient filesystem operations via upload/download and provides no mount semantics; as a result, users must move large outputs out-of-band. This proposal adds first-class storage semantics while maintaining runtime portability and security boundaries.

### Goals
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should highlight the fact that we want to solve file persist problem. In another words, volume is NOT general storage solution( no block storage, no object storage, etc), so volume should be narrowed in file storage area.

Clarify the MVP scope (Docker local + OSS), align enums/examples/tests, and
refine OSS mount behavior and validation details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants