Skip to content
Closed
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
18 changes: 16 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,20 @@ 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 }}"
2 changes: 1 addition & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ const config = {
// release note按照版本号倒排
return reverseReleaseNoteSidebars(filterHiddenSidebars);
},
lastVersion: '0.2.x',
lastVersion: '1.0.x',
includeCurrentVersion: false,
versions: convertVersionsArrayToObject(versions)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,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
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"version.label": {
"message": "1.0.x",
"description": "The label for version current"
},
"sidebar.tutorialSidebar.category.Getting Started": {
"message": "快速上手",
"description": "The label for category 'Getting Started' in sidebar 'tutorialSidebar'"
},
"sidebar.tutorialSidebar.category.User Guides": {
"message": "用户指南",
"description": "The label for category 'User Guides' in sidebar 'tutorialSidebar'"
},
"sidebar.tutorialSidebar.category.References": {
"message": "参考",
"description": "The label for category 'References' in sidebar 'tutorialSidebar'"
},
"sidebar.tutorialSidebar.category.Release Notes": {
"message": "版本说明",
"description": "The label for category 'Release Notes' in sidebar 'tutorialSidebar'"
},
"sidebar.tutorialSidebar.category.model-service": {
"message": "Model Service 参考",
"description": "The label for category 'Model Service References' in sidebar 'tutorialSidebar'"
},
"sidebar.tutorialSidebar.category.sandbox-agent": {
"message": "Sandbox Agent参考",
"description": "The label for category 'Sandbox Agent References' in sidebar 'tutorialSidebar'"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
---
sidebar_position: 3
---

# 安装

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

## 使用 uv(推荐)

### 快速安装所有依赖

```bash
# 安装所有依赖(包括可选依赖)
uv sync --all-extras

# 安装开发/测试依赖
uv sync --all-extras --all-groups
```

### 安装不同依赖组

#### 仅核心依赖
```bash
uv sync
```

#### 管理组件依赖
```bash
uv sync --extra admin
```

#### Rocklet 执行环境依赖
```bash
uv sync --extra rocklet
```

#### 所有依赖
```bash
uv sync --all-extras
```

#### 开发/测试依赖
```bash
uv sync --all-extras --group test
```

## 使用 pip

### 从 pip 源安装

#### 仅核心依赖
```bash
pip install rl-rock
```

#### 管理组件依赖
```bash
pip install "rl-rock[admin]"
```

#### Rocklet 执行环境依赖
```bash
pip install "rl-rock[rocklet]"
```

#### 构建器依赖
```bash
pip install "rl-rock[builder]"
```

#### 安装所有可选依赖
```bash
pip install "rl-rock[all]"
```

### 使用 pip 从源码安装

#### 仅核心依赖
```bash
pip install .
```

#### 管理组件依赖
```bash
pip install ".[admin]"
```

#### Rocklet 执行环境依赖
```bash
pip install ".[rocklet]"
```

#### 构建器依赖
```bash
pip install ".[builder]"
```

#### 安装所有可选依赖
```bash
pip install ".[all]"
```

## 可用入口点

该包提供以下命令行脚本:

- `rocklet`: ROCK 执行环境服务器 (rock.rocklet.server:main)
- `admin`: 管理服务器 (rock.admin.main:main)
- `envhub`: 环境中心服务器 (rock.envhub.server:main)
- `rock`: 主 ROCK 命令行接口 (rock.cli.main:main)

## 开发设置

### 使用 uv(推荐)

```bash
# 克隆并设置开发环境
git clone <repository>
cd ROCK
uv sync --all-extras --group test

# 运行测试
uv run pytest


### 使用 pip

```bash
# 开发模式安装所有可选依赖
pip install -e ".[all]"

# 分别安装
pip install -e .
pip install ".[admin]" ".[rocklet]" ".[builder]"
```

## 附加说明

- 项目配置为默认使用阿里云 PyPI 镜像: `https://mirrors.aliyun.com/pypi/simple/`
- 对于本地开发,运行测试需要 `test` 依赖组
Loading