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
16 changes: 14 additions & 2 deletions .github/workflows/docs-request-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ concurrency:
jobs:
# This workflow contains a single job called "build"
build:
if: github.event.pull_request.merged == true
if: github.event_name != 'pull_request' || github.event.pull_request.merged == true
# The type of runner that the job will run on
runs-on: ubuntu-latest
# work on CI script dir
Expand All @@ -42,6 +42,18 @@ jobs:
COMMIT_ID=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.event.pull_request.head.sha }}" || echo "${{ github.sha }}")
echo "Using Commit ID: $COMMIT_ID"
echo "$GITHUB_REF"
PR_ID=$(echo "$GITHUB_REF" | sed 's@refs/pull/\([0-9]\+\)/.*@\1@')
# Extract PR ID correctly for different scenarios
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
# For pull_request events, we can use the event payload
PR_ID="${{ github.event.pull_request.number }}"
else
# Try to extract PR ID from GITHUB_REF if it's in PR format
if [[ "$GITHUB_REF" =~ refs/pull/([0-9]+)/ ]]; then
PR_ID="${BASH_REMATCH[1]}"
else
# Generate a random value when no PR ID is found
PR_ID="random-$(date +%s)-$$"
fi
fi
echo "PR ID is $PR_ID"
./trigger-docs.sh "$COMMIT_ID" "${{ secrets.CI_SECRET }}" "${{ github.event.pull_request.head.repo.clone_url }}" "$PR_ID" "${{ secrets.CHECK_USER_NAME }}" "${{ secrets.CHECK_TOKEN }}"
Binary file modified assets/rock_wechat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const config = {
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/alibaba/ROCK/tree/master/docs/rock/',
'https://github.com/alibaba/ROCK/tree/master/docs/',
showLastUpdateTime: true,
sidebarItemsGenerator: async ({ defaultSidebarItemsGenerator, ...args }) => {
const sidebarItems = await defaultSidebarItemsGenerator(args);
Expand Down
110 changes: 109 additions & 1 deletion docs/i18n/zh-Hans/code.json
Original file line number Diff line number Diff line change
Expand Up @@ -360,5 +360,113 @@
"theme.tags.tagsPageTitle": {
"message": "标签",
"description": "The title of the tag list page"
},
"Get Started": {
"message": "快速入门"
},
"ABOUT ROCK": {
"message": "关于 ROCK"
},
"ROCK (Reinforcement Open Construction Kit) is": {
"message": "ROCK (Reinforcement Open Construction Kit) 是"
},
"an AI-powered reinforcement learning environment platform": {
"message": "一个由人工智能驱动的强化学习环境平台"
},
"that offers standardized infrastructure, intelligent model services, TPP access, and a rich set of built-in scenarios, enabling developers to rapidly conduct RL training tasks.": {
"message": ",该平台提供标准化的基础设施、智能模型服务、TPP 接入以及丰富的内置场景,使开发者能够快速开展强化学习训练任务。"
},
"AI Intelligence": {
"message": "AI 智能"
},
"Cloud Native": {
"message": "云原生"
},
"Standardization": {
"message": "标准化"
},
"CORE FEATURES": {
"message": "核心特性"
},
"Multi-Protocol Action Support": {
"message": "多协议动作支持"
},
"Supports multiple action protocols including GEM, Bash, and Chat.": {
"message": "支持多种动作协议,包括 GEM、Bash 和 Chat。"
},
"Sandbox Runtime": {
"message": "沙箱运行时"
},
"Stateful runtime environments with multiple isolation mechanisms to ensure consistency and security": {
"message": "具有多种隔离机制的有状态运行时环境,以确保一致性和安全性"
},
"Flexible Deployment": {
"message": "灵活部署"
},
"Supports different deployment methods for diverse environment and OS": {
"message": "支持针对不同环境和操作系统的多种部署方式"
},
"Unified SDK Interface": {
"message": "统一 SDK 接口"
},
"Clean Python SDK for Env and Sandbox interaction": {
"message": "简洁的 Python SDK,用于环境和沙箱交互"
},
"Layered Service Architecture": {
"message": "分层服务架构"
},
"Distributed Admin, Worker, and Rocklet architecture for scalable resource management": {
"message": "分布式 Admin、Worker 和 Rocklet 架构,实现可扩展的资源管理"
},
"Efficient Resource Management": {
"message": "高效资源管理"
},
"Automatic sandbox lifecycle management with configurable resource allocation": {
"message": "自动化的沙箱生命周期管理,支持可配置的资源分配"
},
"ROCK Open Source Community": {
"message": "ROCK 开源社区"
},
"Stars": {
"message": "星标"
},
"Contributors": {
"message": "贡献者"
},
"PRs": {
"message": "PRs"
},
"The two work together to form a complete closed loop for intelligent agent training.": {
"message": "两者协同工作,形成智能体训练的完整闭环。"
},
"We welcome contributions from the community!": {
"message": "我们欢迎社区的贡献!"
},
"how to get involved": {
"message": "如何参与"
},
"fork the repository and create a feature branch to make your changes; if applicable, add tests, and then submit a pull request.": {
"message": "fork 仓库并创建特性分支进行修改;如适用,添加测试,然后提交 pull request。"
},
"Please use the GitHub issue tracker to report bugs or suggest features.": {
"message": "请使用 GitHub issue 追踪器报告错误或建议新功能。"
},
"Follow existing code style and conventions. Please run tests before submitting pull requests.": {
"message": "遵循现有的代码风格和约定。请在提交 pull request 之前运行测试。"
},
"GitHub Repository": {
"message": "GitHub 仓库"
},
"WeChat": {
"message": "微信群"
},
"Follow us on X": {
"message": "关注我们的 X 账号"
},
"Home": {
"message": "首页"
},
"Docs": {
"message": "文档"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version.label": {
"message": "0.2.x",
"description": "The label for version current"
"description": "The label for version 0.2.x"
},
"sidebar.tutorialSidebar.category.Getting Started": {
"message": "快速上手",
Expand All @@ -23,4 +23,4 @@
"message": "Python SDK 参考",
"description": "The label for category 'Python SDK References' in sidebar 'tutorialSidebar'"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 3
---

# 安装
# 安装指南

本文档介绍如何使用 `uv` 和 `pip` 安装和设置 ROCK 开发环境。该项目是一个强化学习开放构建工具包,支持多种组件。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,10 @@ sidebar_position: 2

本指南将通过完整的示例演示如何使用 ROCK 创建和管理强化学习环境。ROCK (Reinforcement Open Construction Kit) 是一个全面的沙箱环境管理框架,主要用于强化学习和AI开发环境。

## 目录

- [快速上手](#快速上手)
- [目录](#目录)
- [1. 环境准备](#1-环境准备)
- [1.1 系统要求](#11-系统要求)
- [1.2 验证依赖安装](#12-验证依赖安装)
- [1.3 项目初始化](#13-项目初始化)
- [2. 激活虚拟环境](#2-激活虚拟环境)
- [3. 验证环境配置](#3-验证环境配置)
- [4. 启动 ROCK 服务](#4-启动-rock-服务)
- [5. 运行示例环境](#5-运行示例环境)
- [5.1 示例说明](#51-示例说明)
- [6. 分布式环境配置(可选)](#6-分布式环境配置可选)
- [7. MacOS 启动](#7-macos-启动)
- [8. 从Pip源启动](#8-从pip源启动)
- [总结](#总结)
- [下一步学习](#下一步学习)

## 1. 环境准备

我们推荐在 Linux 系统下启动 ROCK,能够尽量复用项目依赖,提升环境拉起速度。如果需要在 macOS 上尝试,可以参考 [MacOS 启动](#7-macos启动) 一节。
我们推荐在 Linux 系统下启动 ROCK,能够尽量复用项目依赖,提升环境拉起速度。如果需要在 macOS 上尝试,可以参考 [MacOS 启动](#7-macos-启动) 一节。

在开始之前,请确保您的系统已安装以下依赖项:

Expand Down Expand Up @@ -87,7 +69,7 @@ python -c "import sys; print('Base prefix:', sys.base_prefix)"

```bash
# 检查关键依赖
python -c "import rock; print("Hello ROCK")
python -c "import rock; print(\"Hello ROCK\")"
```


Expand Down Expand Up @@ -154,14 +136,14 @@ python examples/sokoban_demo.py
export ROCK_WORKER_ENV_TYPE=uv
```

在容器启动时,会安装对应的 uv 环境,细节可以参考 `rock/rocklet/docker_run_with_uv.sh` 脚本。
在容器启动时,会安装对应的 uv 环境,细节可以参考 `rock/rocklet/local_files/docker_run_with_uv.sh` 脚本。

> **注意**: 相比 Linux 系统,macOS 上的启动速度会较慢,且比较依赖网络环境,可以根据实际情况调整脚本。ROCK_WORKER_ENV_TYPE的细节可以参考 [Configuration Guide](../User%20Guides/configuration.md).


## 8. 从Pip源启动

如果从Pip源启动Admin Server,在参照[installation.md](./installation.md)安装完成ROCK后, 需要设置额外环境变量:
如果从Pip源启动Admin Server,在参照[安装指南](./installation.md)安装完成ROCK后, 需要设置额外环境变量:

```bash
export ROCK_WORKER_ENV_TYPE=pip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ bash examples/agentic_demo/run_agentic_pipeline_sokoban_sandbox_single_node.sh

为获得最佳兼容性,推荐使用 ROLL 官方提供的基础 Docker 镜像,因为它们已经预装了匹配的 CUDA、cuDNN 和其他基础库。

> [ROLL 官方镜像列表](https://alibaba.github.io/ROLL/docs/English/QuickStart/)
> [ROLL 官方镜像列表](https://alibaba.github.io/ROLL/zh-Hans/docs/Getting%20Started/Installation/image_address/)


#### 注意
Expand Down Expand Up @@ -142,7 +142,7 @@ bash examples/agentic_demo/run_agentic_pipeline_sokoban_sandbox_single_node.sh

### 3.1 在机器 A 上部署 ROCK 服务

在一台独立的机器(或容器)上,参照[ROCK快速指南](https://rock.io.alibaba-inc.com/docs/rock/CN/quickstart)部署并启动 ROCK 服务。
在一台独立的机器(或容器)上,参照[ROCK快速指南](./quickstart.md)部署并启动 ROCK 服务。

> **重要提示**
> 启动服务后,请记下ROCK服务的IP地址和端口,例如`http://192.168.1.10:8000`,后续步骤将需要这个地址。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,6 @@ sidebar_position: 2

本指南详细介绍如何使用 ROCK SDK 进行开发,包括沙箱环境管理和 GEM 环境交互。

## 目录

- [Python SDK 参考](#python-sdk-参考)
- [目录](#目录)
- [1. 概述](#1-概述)
- [2. Sandbox SDK](#2-sandbox-sdk)
- [2.1 基本沙箱操作](#21-基本沙箱操作)
- [3.2 沙箱组管理](#32-沙箱组管理)
- [相关文档](#相关文档)
- [3.3 配置示例](#33-配置示例)
- [4. GEM SDK](#4-gem-sdk)
- [4.1 Python SDK 方式](#41-python-sdk-方式)

## 1. 概述

ROCK SDK为开发者提供了便捷的Python接口来使用ROCK平台的功能,包括沙箱环境管理和GEM环境交互。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,6 @@ sidebar_position: 1

本指南详细介绍 ROCK 平台提供的核心 API 服务,包括沙箱环境管理和 GEM 环境交互。

## 目录

- [API 参考](#api-参考)
- [目录](#目录)
- [1. 概述](#1-概述)
- [2. Sandbox API](#2-sandbox-api)
- [沙箱管理接口](#沙箱管理接口)
- [命令执行接口](#命令执行接口)
- [文件操作接口](#文件操作接口)
- [3. GEM API](#3-gem-api)
- [相关文档](#相关文档)
- [4. HTTP API 使用示例](#4-http-api-使用示例)
- [4.1 Sandbox API 示例](#41-sandbox-api-示例)
- [启动沙箱](#启动沙箱)
- [异步启动沙箱](#异步启动沙箱)
- [执行命令](#执行命令)
- [创建会话](#创建会话)
- [在会话中执行命令](#在会话中执行命令)
- [上传文件](#上传文件)
- [停止沙箱](#停止沙箱)
- [4.2 GEM API 示例](#42-gem-api-示例)

## 1. 概述

ROCK平台提供两种核心API服务:
Expand Down Expand Up @@ -106,14 +84,6 @@ GEM环境交互功能:
4. **Close Environment** - 关闭GEM环境
- 释放GEM环境资源

## 相关文档

- [快速开始指南](../Getting%20Started/quickstart.md) - 了解如何快速开始使用 ROCK API
- [Python SDK 文档](./Python%20SDK%20References/python_sdk.md) - 学习如何使用 SDK 调用 API
- [配置指南](../User%20Guides/configuration.md) - 了解 API 相关的配置选项
- [安装指南](../Getting%20Started/installation.md) - 详细了解 ROCK 安装和配置


## 4. HTTP API 使用示例

### 4.1 Sandbox API 示例
Expand Down Expand Up @@ -214,4 +184,11 @@ curl -X POST 'http://localhost:8080/apis/v1/envs/gem/step' \
curl -X POST 'http://localhost:8080/apis/v1/envs/gem/close' \
-H 'Content-Type: application/json' \
-d '{"sandbox_id": "sandbox-12345"}'
```
```

## 相关文档

- [快速开始指南](../Getting%20Started/quickstart.md) - 了解如何快速开始使用 ROCK API
- [Python SDK 文档](./Python%20SDK%20References/python_sdk.md) - 学习如何使用 SDK 调用 API
- [配置指南](../User%20Guides/configuration.md) - 了解 API 相关的配置选项
- [安装指南](../Getting%20Started/installation.md) - 详细了解 ROCK 安装和配置
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ sidebar_position: 4

本指南详细介绍如何配置 ROCK 环境以满足不同的使用需求,包括本地开发、测试和生产部署。

## 目录

- [环境变量配置](#1-环境变量配置)
- [运行时环境](#11-运行时环境)
- [日志配置](#12-日志配置)
- [分布式部署要求](#2-分布式部署要求)

## 1. 环境变量配置

ROCK 支持通过环境变量配置关键参数。以下是主要的环境变量:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,6 @@ sidebar_position: 1

ROCK (Reinforcement Open Construction Kit) 是一个开源的强化学习环境开发框架,旨在简化强化学习环境的开发、部署和管理流程。

## 目录

- [概览](#概览)
- [目录](#目录)
- [什么是 ROCK](#什么是-rock)
- [ROCK 的核心功能](#rock-的核心功能)
- [ROCK 的价值](#rock-的价值)
- [了解更多](#了解更多)
- [相关文档](#相关文档)

## 什么是 ROCK

ROCK (Reinforcement Open Construction Kit) 是一个开源强化学习环境开发框架。通过使用 ROCK,开发者可以快速地开发强化学习环境,并结合其他强化学习训练框架,实现高效的强化学习训练。
Expand All @@ -35,14 +25,6 @@ ROCK 为不同角色的工程师提供了显著价值:
- **强化学习算法工程师**:ROCK 可以简化强化学习环境的开发流程,让工程师专注于算法实现
- **强化学习应用工程师**:ROCK 可以进行快速强化学习环境的大规模部署,提高应用开发效率

## 了解更多

- [快速开始指南](./Getting%20Started/quickstart.md) - 快速上手 ROCK
- [配置指南](./User%20Guides/configuration.md) - 详细了解 ROCK 的配置选项
- [API 文档](./References/api.md) - 查看 ROCK 提供的 API 接口
- [Python SDK 文档](./References/Python%20SDK%20References/python_sdk.md) - 学习如何使用 ROCK 的 Python SDK
- [安装指南](./Getting%20Started/installation.md) - 详细了解 ROCK 安装和配置

## 相关文档

如果您是第一次使用 ROCK,建议按以下顺序阅读文档:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version.label": {
"message": "1.0.x",
"description": "The label for version current"
"description": "The label for version 1.0.x"
},
"sidebar.tutorialSidebar.category.Getting Started": {
"message": "快速上手",
Expand All @@ -26,5 +26,9 @@
"sidebar.tutorialSidebar.category.sandbox-agent": {
"message": "Sandbox Agent参考",
"description": "The label for category 'Sandbox Agent References' in sidebar 'tutorialSidebar'"
},
"sidebar.tutorialSidebar.category.Python SDK References": {
"message": "Python SDK 参考",
"description": "The label for category 'Python SDK References' in sidebar 'tutorialSidebar'"
}
}
Loading
Loading