Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,57 @@
- 演示 `rock model-service start --type proxy --proxy-base-url` 用法


## Admin
## Admin

### 新功能

#### 任务调度器(Task Scheduler)
一个灵活的任务调度系统,用于管理 Ray Worker 节点上的周期性维护任务。

**内置任务:**
- **ImageCleanupTask**:使用 [docuum](https://github.com/stepchowfun/docuum) 进行 Docker 镜像清理,支持可配置的磁盘阈值

**配置示例:**
```yaml
scheduler:
enabled: true
worker_cache_ttl: 3600
tasks:
- task_class: "rock.admin.scheduler.tasks.image_cleanup_task.ImageCleanupTask"
enabled: true
interval_seconds: 3600
params:
threshold: "1T"
```

**可扩展性:**
通过继承 `BaseTask` 并实现 `run_action(runtime: RemoteSandboxRuntime)` 方法来创建自定义任务。

#### Entrypoints

- **新增**: 批量查询沙箱状态 API (`POST /sandboxes/batch`)
- 在单个请求中高效检索多个沙箱的状态信息
- 接受包含 `sandbox_ids` 列表的 `BatchSandboxStatusRequest` 请求
- 返回包含所有请求沙箱状态详情的 `BatchSandboxStatusResponse` 响应
- 支持可配置的最大数量限制(默认值来自 `batch_get_status_max_count` 配置)

- **新增**: 沙箱列表和过滤 API (`GET /sandboxes`)
- 使用灵活的查询参数查询和过滤沙箱
- 通过 `page` 和 `page_size` 参数支持分页
- 返回包含条目列表、总数和 `has_more` 标识的 `SandboxListResponse` 响应
- 支持按沙箱属性过滤(例如:部署类型、状态、自定义元数据等)
- 最大页面大小可通过 `batch_get_status_max_count` 配置

#### Sandbox

- 修改 Sandbox 日志格式:时间戳使用 ISO 8601 格式,默认时区为 Asia/Shanghai(亚洲/上海)
- 丰富 SandboxInfo:添加 create_time、start_time、stop_time
- 添加计费日志:当 sandbox 关闭时记录计费日志

---

### 增强

#### 性能优化
- 实现 get_status 接口逻辑与 Ray 的解耦:将 API 响应耗时从 1s 以上显著降低至 100ms 级别;支持新旧逻辑的动态在线切换。
- 将ray相关操作从sandbox manager中下沉至ray service。
53 changes: 53 additions & 0 deletions docs/versioned_docs/version-1.2.x/Release Notes/v1.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,56 @@ Practical examples demonstrating ROCK Agent integration with various AI framewor


## Admin

### New Features

#### Task Scheduler
A flexible task scheduling system for managing periodic maintenance tasks across Ray workers.

**Built-in Tasks:**
- **ImageCleanupTask**: Docker image cleanup using [docuum](https://github.com/stepchowfun/docuum) with configurable disk threshold

**Configuration Example:**
```yaml
scheduler:
enabled: true
worker_cache_ttl: 3600
tasks:
- task_class: "rock.admin.scheduler.tasks.image_cleanup_task.ImageCleanupTask"
enabled: true
interval_seconds: 3600
params:
threshold: "1T"
```

**Extensibility:**
Create custom tasks by extending `BaseTask` and implementing the `run_action(runtime: RemoteSandboxRuntime)` method.

#### Entrypoints

- **NEW**: Batch sandbox status query API (`POST /sandboxes/batch`)
- Efficiently retrieve status information for multiple sandboxes in a single request
- Accepts `BatchSandboxStatusRequest` with `sandbox_ids` list
- Returns `BatchSandboxStatusResponse` containing status details for all requested sandboxes
- Supports up to configurable maximum count (default from `batch_get_status_max_count`)

- **NEW**: Sandbox listing and filtering API (`GET /sandboxes`)
- Query and filter sandboxes with flexible query parameters
- Supports pagination via `page` and `page_size` parameters
- Returns `SandboxListResponse` with items, total count, and `has_more` indicator
- Enables filtering by sandbox attributes (e.g., deployment type, status, custom metadata)
- Maximum page size configurable via `batch_get_status_max_count`

#### Sandbox

- Modify Sandbox log format: use iso 8601 format for timestamp, default time zone is Asia/Shanghai
- Enrich SandboxInfo: add create_time, start_time, stop_time for metrics
- Add Billing log when sandbox is closed

---

### Enhancements

#### Performance Optimizations
- Decouple the `get_status` API logic from Ray, reducing API latency from 1s+ to 100ms+; support dynamically toggling between the new and legacy logic.
- Sink ray operations from sandbox manager into ray service.
Loading