Skip to content

feat: implement OSSFS storage backend in sandbox lifecycle#340

Merged
Pangjiping merged 11 commits intoalibaba:mainfrom
hittyt:feat/support-ossfs-api
Mar 16, 2026
Merged

feat: implement OSSFS storage backend in sandbox lifecycle#340
Pangjiping merged 11 commits intoalibaba:mainfrom
hittyt:feat/support-ossfs-api

Conversation

@hittyt
Copy link
Copy Markdown
Collaborator

@hittyt hittyt commented Mar 4, 2026

This PR implements the OSSFS storage backend for the sandbox lifecycle, as detailed in OSEP-0003.

Key features:

  • Docker Runtime Integration: Implemented mount management with reference counting and on-demand ossfs mounting.
  • Enhanced Validation: Added rigorous checks for OSS buckets, endpoints, and credentials.
  • Automatic Cleanup: Ensures OSSFS paths are unmounted when the last dependent sandbox is deleted.

Comment thread oseps/0003-volume-and-volumebinding-support.md Outdated
@jwx0925
Copy link
Copy Markdown
Collaborator

jwx0925 commented Mar 4, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a72893a549

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread server/src/services/docker.py Outdated
Comment thread server/src/services/docker.py Outdated
@hittyt hittyt force-pushed the feat/support-ossfs-api branch from a72893a to ce216ac Compare March 4, 2026 13:17
@Pangjiping
Copy link
Copy Markdown
Collaborator

Please rebase main to resolve pyproject.toml format error

@hittyt hittyt force-pushed the feat/support-ossfs-api branch from ce216ac to c12516d Compare March 4, 2026 13:27
@Pangjiping Pangjiping added feature New feature or request component/server labels Mar 5, 2026
@hittyt hittyt force-pushed the feat/support-ossfs-api branch from aaf4e73 to 25eb4ed Compare March 5, 2026 05:32
Comment thread sdks/sandbox/python/src/opensandbox/api/lifecycle/models/credential_ref.py Outdated
Comment thread server/src/services/docker.py Outdated
Comment thread server/src/services/docker.py Outdated
Comment thread server/src/services/validators.py
Comment thread server/src/services/docker.py Outdated
Comment thread server/src/services/validators.py Outdated
Comment thread server/src/services/validators.py Outdated
@hittyt hittyt requested a review from Pangjiping March 8, 2026 06:16
@hittyt hittyt force-pushed the feat/support-ossfs-api branch 2 times, most recently from 11e4b44 to 8338c4d Compare March 9, 2026 13:57
@jwx0925
Copy link
Copy Markdown
Collaborator

jwx0925 commented Mar 11, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8338c4d7cb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread server/src/services/docker.py
Comment thread server/src/services/docker.py Outdated
Comment thread server/src/services/docker.py
hittyt added 5 commits March 16, 2026 10:41
…vior

Move Docker OSSFS-specific logic into a dedicated module to reduce branching noise in the core provisioning flow, and align OSSFS request validation with schema-driven constraints and platform support boundaries. This also fixes server pyproject TOML parsing so validation/test tooling can run reliably.

Made-with: Cursor
Make OSSFS mount preparation transactional by rolling back already prepared mount keys when a later mount in the same batch fails. Add a regression test to prevent ref-count leaks in multi-volume partial-failure scenarios.

Made-with: Cursor
Remove endpoint-derived region/sigv4 auto-injection for OSSFS 1.0 so region semantics stay explicitly controlled by caller options. Add assertions to keep v1 command generation free of implicit region flags.

Made-with: Cursor
Install and expose both JDK 8 and JDK 17 in Java E2E so Gradle toolchain resolution does not depend on foojay auto-download in CI. Configure Gradle installation paths explicitly to avoid intermittent Java 8 provisioning failures.

Made-with: Cursor
- Widen try/except in _provision_sandbox to cover all post-OSSFS steps
  (volume binds, sidecar, container creation) so mounts are always
  released on failure.
- Two-pass startup restore: populate OSSFS ref counts for all containers
  before expiring any, preventing untracked-key skips during cleanup.
- Add fallback_mount_keys to _expire_sandbox so vanished containers
  (404) still release their cached refs.
- Retry expiration on transient Docker errors (non-404) with 30s delay,
  preserving fallback keys and original expiresAt timestamp.
- Guard against renew/retry race: revalidate expiration deadline before
  kill/remove to avoid terminating a renewed sandbox.
- Fix cross-platform test stability: pin os.name in OSSFS tests and
  correct patch paths to ossfs_mixin.

Made-with: Cursor
@hittyt hittyt force-pushed the feat/support-ossfs-api branch from 8338c4d to 9b621de Compare March 16, 2026 02:42
Copy link
Copy Markdown
Collaborator

@jwx0925 jwx0925 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Collaborator

@Pangjiping Pangjiping left a comment

Choose a reason for hiding this comment

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

LGTM

@Pangjiping Pangjiping merged commit 74d3dbb into alibaba:main Mar 16, 2026
15 checks passed
@hittyt hittyt deleted the feat/support-ossfs-api branch March 16, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/server feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants