From 65a11fd929d9e743c0320664c9599111c6425392 Mon Sep 17 00:00:00 2001 From: jiaoliao Date: Tue, 3 Feb 2026 10:34:01 +0000 Subject: [PATCH 1/3] add release note 120 --- .../version-1.2.x/Release Notes/v1.2.0.md | 54 ++++++++++++++++++- .../version-1.2.x/Release Notes/v1.2.0.md | 52 ++++++++++++++++++ 2 files changed, 105 insertions(+), 1 deletion(-) diff --git a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.2.x/Release Notes/v1.2.0.md b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.2.x/Release Notes/v1.2.0.md index 15b9fc92b..8d0cc7710 100644 --- a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.2.x/Release Notes/v1.2.0.md +++ b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.2.x/Release Notes/v1.2.0.md @@ -51,4 +51,56 @@ - 演示 `rock model-service start --type proxy --proxy-base-url` 用法 -## Admin \ No newline at end of file +## 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 级别;支持新旧逻辑的动态在线切换。 diff --git a/docs/versioned_docs/version-1.2.x/Release Notes/v1.2.0.md b/docs/versioned_docs/version-1.2.x/Release Notes/v1.2.0.md index 8c09e2b0c..a403d35bf 100644 --- a/docs/versioned_docs/version-1.2.x/Release Notes/v1.2.0.md +++ b/docs/versioned_docs/version-1.2.x/Release Notes/v1.2.0.md @@ -52,3 +52,55 @@ 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. From 91575824ac176639d532db8e40dd635ed0a8bb67 Mon Sep 17 00:00:00 2001 From: jiaoliao Date: Tue, 3 Feb 2026 10:55:42 +0000 Subject: [PATCH 2/3] Revert "add release note 120" This reverts commit 65a11fd929d9e743c0320664c9599111c6425392. --- .../version-1.2.x/Release Notes/v1.2.0.md | 54 +------------------ .../version-1.2.x/Release Notes/v1.2.0.md | 52 ------------------ 2 files changed, 1 insertion(+), 105 deletions(-) diff --git a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.2.x/Release Notes/v1.2.0.md b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.2.x/Release Notes/v1.2.0.md index 8d0cc7710..15b9fc92b 100644 --- a/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.2.x/Release Notes/v1.2.0.md +++ b/docs/i18n/zh-Hans/docusaurus-plugin-content-docs/version-1.2.x/Release Notes/v1.2.0.md @@ -51,56 +51,4 @@ - 演示 `rock model-service start --type proxy --proxy-base-url` 用法 -## 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 级别;支持新旧逻辑的动态在线切换。 +## Admin \ No newline at end of file diff --git a/docs/versioned_docs/version-1.2.x/Release Notes/v1.2.0.md b/docs/versioned_docs/version-1.2.x/Release Notes/v1.2.0.md index a403d35bf..8c09e2b0c 100644 --- a/docs/versioned_docs/version-1.2.x/Release Notes/v1.2.0.md +++ b/docs/versioned_docs/version-1.2.x/Release Notes/v1.2.0.md @@ -52,55 +52,3 @@ 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. From 9b6ae507724902d1410872e3b7e51cfdec0c90e9 Mon Sep 17 00:00:00 2001 From: jiaoliao Date: Thu, 5 Feb 2026 07:43:54 +0000 Subject: [PATCH 3/3] fix scheduler task file not found detection --- rock/admin/scheduler/task_base.py | 7 +++---- uv.lock | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/rock/admin/scheduler/task_base.py b/rock/admin/scheduler/task_base.py index cde082872..6fc7bdfac 100644 --- a/rock/admin/scheduler/task_base.py +++ b/rock/admin/scheduler/task_base.py @@ -151,10 +151,9 @@ async def single_run(self, runtime: RemoteSandboxRuntime, ip: str) -> dict: async def get_task_status(self, runtime: RemoteSandboxRuntime) -> TaskStatus | None: """Get task status from worker.""" - try: - await runtime.execute(Command(command=f"ls {self.status_file_path}", shell=True)) - except Exception: - logger.info(f"{self.status_file_path} not found") + check_file_resp = await runtime.execute(Command(command=f"ls {self.status_file_path}", shell=True)) + if check_file_resp.exit_code == 2: + logger.info(f"task status file not exist: {self.status_file_path}") return None response = await runtime.read_file(ReadFileRequest(path=self.status_file_path)) diff --git a/uv.lock b/uv.lock index fbef1e517..86b59acd9 100644 --- a/uv.lock +++ b/uv.lock @@ -4011,7 +4011,7 @@ wheels = [ [[package]] name = "rl-rock" -version = "1.0.2" +version = "1.2.1" source = { editable = "." } dependencies = [ { name = "anyio" },