Skip to content

feat: support Alibaba Function Compute as sandbox runtime provider #644

@insight-bit

Description

@insight-bit

Background

ROCK currently supports multiple deployment modes including Docker, Ray, and K8s. Adding Alibaba Cloud Function Compute (FC3) as a sandbox runtime provider would enable serverless deployment of ROCK sandboxes, reducing operational overhead and enabling auto-scaling.

Feature Request

Add comprehensive support for Alibaba Cloud Function Compute 3.0 (FC3) as a sandbox runtime provider with three deployment modes:

  1. Custom Runtime: Lightweight Python runtime with bootstrap script
  2. Custom Container: Full Docker container deployment
  3. Hybrid Adapter: HTTP/WebSocket adapter for FC3 function integration

Key Components

FC3 Client

  • FC3Sandbox: Main sandbox client with session management
  • CircuitBreaker: Thread-safe fault tolerance with OPEN/CLOSED/HALF_OPEN states
  • WebSocket reconnection with exponential backoff retry
  • Custom exceptions for error handling

FC3 Rocklet

  • runtime/: Custom Runtime bootstrap and configuration
  • container/: Custom Container Dockerfile and configuration
  • adapter/: Hybrid Adapter HTTP/WebSocket server with path traversal protection

Tests

  • 126 test cases covering client, adapter, and runtime configurations

Benefits

  • Serverless: No infrastructure management required
  • Auto-scaling: Automatic scaling based on workload
  • Cost-effective: Pay-per-use pricing model
  • High availability: Built-in fault tolerance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions