Skip to content

Commit 1b64e43

Browse files
authored
add(workshop): introduce UCAgent workshop demonstration environment
feat: introduce UCAgent workshop demonstration environment
2 parents 9c23d61 + f9cd678 commit 1b64e43

419 files changed

Lines changed: 133438 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/envbase.yaml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
paths:
77
- "docker/Dockerfile"
88
- "docker/Dockerfile.full"
9+
- "docker/Dockerfile.workshop"
10+
- "docker/start_demo.sh"
11+
- "workshop/data/**"
912
- ".github/workflows/envbase.yaml"
1013
workflow_run:
1114
workflows: [ "envbase" ]
@@ -84,4 +87,39 @@ jobs:
8487
${{ env.REGISTRY }}/${{ env.FULL_IMAGE_NAME }}:${{ env.IMAGE_TAG }}
8588
${{ env.REGISTRY }}/${{ env.FULL_IMAGE_NAME }}:latest
8689
cache-from: type=local,src=/tmp/.buildx-cache
87-
cache-to: type=local,dest=/tmp/.buildx-cache
90+
cache-to: type=local,dest=/tmp/.buildx-cache
91+
92+
build-and-push-workshop:
93+
runs-on: ubuntu-latest
94+
# Optional: depends on full image if we use it as base,
95+
# but here we use ucagent:latest which is built from main repo.
96+
# To be safe, we can run it after build-and-push-full if we want to ensure base layers are available
97+
needs: build-and-push-full
98+
permissions:
99+
contents: read
100+
packages: write
101+
102+
steps:
103+
- name: Checkout repository
104+
uses: actions/checkout@v4
105+
106+
- name: Set up Docker Buildx
107+
uses: docker/setup-buildx-action@v2
108+
109+
- name: Log in to GitHub Container Registry
110+
uses: docker/login-action@v2
111+
with:
112+
registry: ${{ env.REGISTRY }}
113+
username: ${{ github.actor }}
114+
password: ${{ secrets.GITHUB_TOKEN }}
115+
116+
- name: Build and push Workshop image
117+
uses: docker/build-push-action@v4
118+
with:
119+
context: .
120+
file: ./docker/Dockerfile.workshop
121+
platforms: linux/amd64,linux/arm64
122+
push: true
123+
tags: |
124+
${{ env.REGISTRY }}/xs-mlvp/workshop:latest
125+
${{ env.REGISTRY }}/xs-mlvp/workshop:${{ github.sha }}

docker/Dockerfile.workshop

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# UCAgent Workshop Docker Image
2+
ARG BASE_IMAGE=localhost/lucagent:latest
3+
FROM ${BASE_IMAGE}
4+
5+
# Set environment variables
6+
ENV SUMMIT_DATA_DIR=/workspace/UCAgent/summit_examples
7+
8+
# Copy workshop data to the expected location
9+
# Context should be the root of the tutorial-records repository
10+
COPY workshop/data/ ${SUMMIT_DATA_DIR}/
11+
12+
# Copy and setup startup script
13+
COPY workshop/start_demo.sh /workspace/UCAgent/start_demo.sh
14+
RUN chmod +x /workspace/UCAgent/start_demo.sh
15+
16+
# Expose ports for Web UI and Agents
17+
# 8800: Master Web UI
18+
# 8000, 8001: Agent Web Consoles
19+
# 8765, 8766: Agent CMD APIs
20+
# 8818, 8819: Agent Web Terminals
21+
EXPOSE 8800 8000 8001 8765 8766 8818 8819
22+
23+
# Set the startup script as the default command
24+
CMD ["/workspace/UCAgent/start_demo.sh"]

workshop/.env.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
OPENAI_API_KEY=your_api_key_here\nOPENAI_API_BASE=your_api_base_here\nOPENAI_MODEL=your_model_name_here

workshop/README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# UCAgent Workshop Quick Start Guide
2+
3+
Welcome to the UCAgent Workshop! The code and environment for this workshop demonstration are available at the official repository: [https://github.com/XS-MLVP/tutorial-records](https://github.com/XS-MLVP/tutorial-records).
4+
5+
This guide will walk you through pulling the pre-built environment, launching the Web UI, and exploring the pre-configured digital circuit verification cases.
6+
7+
## 📦 Repository Overview
8+
9+
In this repository, you will find:
10+
11+
- **Pre-prepared Cases**: Classic verification examples along with their historical verification records.
12+
- **Docker Scripts**: The `Dockerfile` and `start_demo.sh` scripts, which our CI uses to automatically build and publish the workshop image.
13+
- **Environment Template**: A `.env.template` file for optional API configuration.
14+
15+
---
16+
17+
## 🚀 Quick Start (Viewing the Demo)
18+
19+
You **do not** need to build the Docker image yourself. The tutorial repository's CI has automatically built and published the image for you.
20+
21+
### 1. Pull the Docker Image
22+
23+
First, pull the latest workshop image to your local machine:
24+
25+
```bash
26+
docker pull ghcr.io/xs-mlvp/workshop:latest
27+
```
28+
29+
### 2. Launch the Demo Environment
30+
31+
Start the container using the following command. This will spin up the Master API server and load the pre-configured background agents:
32+
33+
```bash
34+
docker run -it --rm --network host ghcr.io/xs-mlvp/ucagent:workshop_demo
35+
```
36+
37+
_(Note: We use `--network host` so the container can easily map to your local ports and share your host's network settings.)_
38+
39+
### 3. Explore the Web UI
40+
41+
Once the terminal indicates that all services have started, open your web browser and navigate to:
42+
👉 **http://localhost:8800**
43+
44+
In this unified Master Web Interface, you can:
45+
46+
- **View Pre-loaded Tasks**: On the left-hand task panel, you will see the cases. Both should have a green **Online** status indicator.
47+
- **Review History**: Click the **API** connection button next to any task to jump into its real-time control center. Here, you can review previously generated code, stage verification logs, and Diff files without needing any LLM API keys.
48+
49+
---
50+
51+
## 🛠️ Advanced: Running Verifications Yourself (Optional)
52+
53+
The quick start above is perfect for exploring the UI and viewing the pre-generated results. However, if you wish to write custom prompts and have UCAgent actively generate new code and run verifications in real-time, you must configure your Large Language Model (LLM) credentials.
54+
55+
1. **Prepare your `.env` file**
56+
Copy the provided template and fill in your API credentials (e.g., OpenAI or a compatible interface):
57+
58+
```bash
59+
cp .env.template .env
60+
# Edit .env to add your OPENAI_API_KEY, OPENAI_API_BASE, and OPENAI_MODEL
61+
```
62+
63+
2. **Launch with API Access**
64+
Run the container again, this time attaching your `.env` file so the agents can connect to the LLM:
65+
```bash
66+
docker run -it --rm --network host --env-file .env ghcr.io/xs-mlvp/workshop:latest
67+
```
68+
69+
With your API keys successfully loaded, the Agents are now fully empowered to execute new automated verification workflows based on your commands!

workshop/README.zh.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# UCAgent Workshop 快速上手指南
2+
3+
欢迎来到 UCAgent Workshop!本次 Workshop 演示的代码和环境已经全部开源在官方仓库中:[https://github.com/XS-MLVP/tutorial-records](https://github.com/XS-MLVP/tutorial-records)
4+
5+
本指南将带你拉取预先构建好的环境、启动 Web UI,并探索我们为你准备好的数字电路芯片验证案例。
6+
7+
## 📦 仓库内容简介
8+
9+
在这个仓库中,包含了以下内容:
10+
11+
- **预置验证案例**:经典的数字电路验证案例(如exu_alu和 ifu_bpu),以及它们离线跑完的历史验证记录。
12+
- **Docker 脚本**`Dockerfile``start_demo.sh`,我们的 CI 流水线会自动使用它们来构建和发布本次 Workshop 的镜像。
13+
- **环境配置模板**`.env.template` 文件,用于你在后续环节配置自己的大模型 API。
14+
15+
---
16+
17+
## 🚀 快速开始(体验演示案例)
18+
19+
**不需要**从头开始构建 Docker 镜像,tutorial 仓库的 CI 已经自动帮你打包并发布好了。
20+
21+
### 1. 拉取镜像
22+
23+
首先,将最新的 Workshop 镜像拉取到你的本地电脑:
24+
25+
```bash
26+
docker pull ghcr.io/xs-mlvp/workshop:latest
27+
```
28+
29+
### 2. 启动演示环境
30+
31+
运行以下命令来启动容器。这会自动启动 Master API 服务,并在后台加载好我们为你准备的预置任务:
32+
33+
```bash
34+
docker run -it --rm --network host ghcr.io/xs-mlvp/workshop:latest
35+
```
36+
37+
_(注意:我们使用了 `--network host` 参数,这样容器可以直接映射并使用你宿主机的网络和端口。)_
38+
39+
### 3. 探索 Web UI
40+
41+
当终端提示服务启动完毕后,打开你的浏览器并访问:
42+
👉 **http://localhost:8800**
43+
44+
在这个统一管理的 Master Web 界面中,你可以:
45+
46+
- **查看预置任务**:在左侧的任务面板中,你会看到 `Adder``ALU754` 两个案例,它们应该都已经亮起了绿色的 **Online** 状态灯。
47+
- **复盘历史记录**:点击任意任务旁边的 **API** 按钮,即可进入该任务的实时控制台。在这里,你不需要配置任何大模型 Key,就可以直接查看 AI 之前生成的验证代码、日志以及阶段比对(Diff)。
48+
49+
---
50+
51+
## 🛠️ 进阶操作:亲自运行大模型验证(可选)
52+
53+
上述的基础体验步骤非常适合浏览 UI 和查看预生成的验证结果。但是,如果你想亲自向 AI 下发 Prompt,让 UCAgent 实时为你生成新的验证代码并执行测试,你就需要配置自己的大模型(LLM)API 凭证了。
54+
55+
1. **准备 `.env` 配置文件**
56+
复制我们提供的模板文件,填入你的 API Key 等信息(支持 OpenAI 或兼容接口):
57+
58+
```bash
59+
cp .env.template .env
60+
# 编辑 .env 文件,补全 OPENAI_API_KEY, OPENAI_API_BASE 和 OPENAI_MODEL
61+
```
62+
63+
2. **携带 API 权限启动**
64+
使用挂载了环境变量的命令重新运行容器,让内部的 Agent 连接到大模型网络:
65+
```bash
66+
docker run -it --rm --network host --env-file .env ghcr.io/xs-mlvp/ucagent:workshop_demo
67+
```
68+
69+
配置成功后,各个 Agent 就拥有了完整的执行能力,你可以开始下达新的指令,开启真正的自动化验证之旅了!

workshop/data/.ucagent/history

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 70e1f0bb23aabc541490f219c250875c2e97544c

0 commit comments

Comments
 (0)