Skip to content

feat: add Alibaba Function Compute serverless runtime operator support #867

Open
insight-bit wants to merge 4 commits into
alibaba:masterfrom
insight-bit:fc-operator-clean
Open

feat: add Alibaba Function Compute serverless runtime operator support #867
insight-bit wants to merge 4 commits into
alibaba:masterfrom
insight-bit:fc-operator-clean

Conversation

@insight-bit
Copy link
Copy Markdown

No description provided.

@insight-bit insight-bit force-pushed the fc-operator-clean branch 3 times, most recently from 14f3475 to 1376ccd Compare April 21, 2026 13:29
…support

resolves alibaba#870

Add FC (Function Compute) Operator pattern support to ROCK framework.

Components:
- FCConfig: Service-level configuration (rock/config.py)
- FCDeploymentConfig: API-level sandbox configuration (rock/deployments/config.py)
- FCOperator: AbstractOperator implementation (rock/sandbox/operator/fc.py)
- FCDeployment: WebSocket session management (rock/deployments/fc.py)
- fc_rocklet: Container and Runtime deployment modes

Deployment modes:
- Container: custom-container runtime (recommended for production)
- Runtime: custom.debian12 runtime

Both configured with SESSION_EXCLUSIVE mode and x-rock-session-id header affinity.

Test coverage:
- test_fc_deployment.py: Config validation, lifecycle tests
- test_fc_e2e.py: E2E HTTP/WebSocket tests
- test_fc_rocklet_runtimes.py: Runtime config validation

Change-Id: I54e2de23c55d9b4c6641d6849330a300c3ad8632
Co-developed-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
insight-bit and others added 3 commits April 22, 2026 19:26
resolves alibaba#870

Remove unnecessary FCDeployment abstraction layer. FC now uses direct
Runtime management via FCOperator.

Architecture: SandboxManager -> FCOperator -> FCRuntime -> FCSessionManager

Changes:
- Remove FCDeployment class
- Add extended_params to FCDeploymentConfig
- Move FCOperator to fc/ folder
- Update tests

Change-Id: Ie7861a7ef4d0521b906158c1e62ec8bece3414b0
Co-developed-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
resolves alibaba#870

Move all FC-related configuration to Operator level:
- Create FCOperatorConfig in rock/sandbox/operator/fc/config.py
- Remove FCDeploymentConfig from rock/deployments/config.py
- FC uses Operator pattern, not Deployment pattern

Architecture:
  Deployment layer: DockerDeploymentConfig (for Docker/Ray/K8s)
  Operator layer: FCOperatorConfig (for FC)

Changes:
- FCOperatorConfig is Pydantic BaseModel, not DeploymentConfig
- SandboxManager and DeploymentManager updated to use FCOperatorConfig
- Tests updated to use FCOperatorConfig

Change-Id: Ide0e4e1d1a6d4a6d5f4a97a8b40235b35d3b443a
Co-developed-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
resolves alibaba#870

Move FC function deployment configs from deployments/fc_rocklet to
sandbox/operator/fc/runtime_example. This clarifies that:

- runtime_example is FC platform deployment reference, not ROCK Deployment
- FC-related code is now fully contained in sandbox/operator/fc/ directory

Directory structure after move:
  rock/sandbox/operator/fc/
  ├── __init__.py
  ├── config.py         # FCOperatorConfig
  ├── operator.py       # FCOperator
  └── runtime_example/  # FC function deployment reference
      ├── README.md
      ├── container/    # custom-container mode
      └── runtime/      # custom-runtime mode

Change-Id: I8533f60930d0d799b187adce09288e6e2dd951ca
Co-developed-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
"""FC session identifier (also serves as ROCK sandbox_id)."""

# FC connection settings
function_name: str | None = None
Copy link
Copy Markdown
Collaborator

@Generalwin Generalwin Apr 27, 2026

Choose a reason for hiding this comment

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

看上去是所有sandbox请求共用同一个fc 函数吗?那对于fc的实现来说,交付一个sandbox是交付的什么?函数、容器还是一个session?如果是session,是怎么保证多个sandbox之间的隔离的?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants