Skip to content

Commit b4c116d

Browse files
世如claude
andcommitted
feat: add Alibaba FC3 serverless runtime provider support
Add comprehensive support for Alibaba Cloud Function Compute 3.0 (FC3) as a sandbox runtime provider, enabling serverless deployment of ROCK sandboxes with three deployment modes: - Custom Runtime: Lightweight Python runtime with bootstrap script - Custom Container: Full Docker container deployment - Hybrid Adapter: HTTP/WebSocket adapter for FC3 function integration Key components: - FC3 client with thread-safe CircuitBreaker for fault tolerance - WebSocket reconnection and retry mechanisms - Path traversal protection in server - Session affinity configuration (HEADER_FIELD mode) - Comprehensive test coverage (78 tests) Change-Id: I757e00577a16c6dbbec1f65e09dbd0159c3579a4 Co-developed-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0d29f9e commit b4c116d

File tree

19 files changed

+4457
-0
lines changed

19 files changed

+4457
-0
lines changed

rock-conf/rock-fc3.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# =============================================================================
2+
# ROCK Admin 运行时配置 - FC3 环境
3+
# =============================================================================
4+
#
5+
# 用途:ROCK Admin 服务启动时加载的运行时配置
6+
#
7+
# 使用方式:
8+
# rock admin start --env fc3
9+
# 或 export ROCK_CONFIG=rock-conf/rock-fc3.yml
10+
#
11+
# 注意:此文件不是函数部署配置,FC3 函数部署使用
12+
# rock/deployments/fc3_rocklet/*/s.yaml + s deploy
13+
#
14+
# =============================================================================
15+
16+
# Ray 配置(FC3 环境不使用 Ray)
17+
ray:
18+
runtime_env:
19+
working_dir: ./
20+
pip: ./requirements_sandbox_actor.txt
21+
namespace: "rock-sandbox-fc3"
22+
23+
# 预热配置(FC3 环境无本地镜像需预热)
24+
warmup:
25+
images: []

rock/actions/sandbox/request.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ class BashAction(BaseModel):
4444
class WriteFileRequest(BaseModel):
4545
content: str
4646
path: str
47+
encoding: str = "utf-8"
48+
"""Text encoding to use when writing the file. Defaults to utf-8."""
4749

4850

4951
class CloseBashSessionRequest(BaseModel):

0 commit comments

Comments
 (0)