Skip to content

Commit 79432ae

Browse files
committed
feat(core&ds): add data source management; refactor data science agent logic
1 parent 1e603db commit 79432ae

File tree

83 files changed

+6157
-986
lines changed

Some content is hidden

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

83 files changed

+6157
-986
lines changed

.all-contributorsrc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,26 @@
265265
"example",
266266
"doc"
267267
]
268+
},
269+
{
270+
"login": "yuluo1007",
271+
"name": "sidiluo",
272+
"avatar_url": "https://avatars.githubusercontent.com/u/16065149?v=4",
273+
"profile": "https://github.com/yuluo1007",
274+
"contributions": [
275+
"code"
276+
]
277+
},
278+
{
279+
"login": "AttanWu",
280+
"name": "Attan",
281+
"avatar_url": "https://avatars.githubusercontent.com/u/16112546?v=4",
282+
"profile": "https://github.com/AttanWu",
283+
"contributions": [
284+
"example",
285+
"code",
286+
"doc"
287+
]
268288
}
269289
],
270290
"contributorsPerLine": 7,
Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
name: Manual Build Alias Sandbox Image
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
platform:
7+
description: "Docker architecture platform (used for multi-arch builds)"
8+
required: true
9+
default: "linux/amd64"
10+
type: choice
11+
options:
12+
- linux/amd64
13+
- linux/arm64
14+
single_arch:
15+
description: "Single architecture build (forces amd64, no multi-arch manifest merge)"
16+
required: true
17+
default: "false"
18+
type: choice
19+
options:
20+
- "true"
21+
- "false"
22+
tag:
23+
description: "Custom image tag (default: current date)"
24+
required: false
25+
default: ""
26+
type: string
27+
28+
jobs:
29+
build:
30+
runs-on: ${{ matrix.os }}
31+
strategy:
32+
matrix:
33+
os: [ ubuntu-latest ]
34+
python-version: [ '3.10' ]
35+
environment: prod
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
with:
40+
submodules: recursive
41+
42+
- name: Set up Docker Buildx
43+
uses: docker/setup-buildx-action@v3
44+
45+
- name: Log in to DockerHub
46+
env:
47+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
48+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
49+
if: ${{ env.DOCKER_USERNAME != '' && env.DOCKER_PASSWORD != '' }}
50+
uses: docker/login-action@v3
51+
with:
52+
registry: docker.io
53+
username: ${{ env.DOCKER_USERNAME }}
54+
password: ${{ env.DOCKER_PASSWORD }}
55+
56+
- name: Log in to Aliyun ACR
57+
env:
58+
ALIYUN_ACR_USERNAME: ${{ secrets.ALIYUN_ACR_USERNAME }}
59+
ALIYUN_ACR_PASSWORD: ${{ secrets.ALIYUN_ACR_PASSWORD }}
60+
if: ${{ env.ALIYUN_ACR_USERNAME != '' && env.ALIYUN_ACR_PASSWORD != '' }}
61+
uses: docker/login-action@v3
62+
with:
63+
registry: agentscope-registry.ap-southeast-1.cr.aliyuncs.com
64+
username: ${{ env.ALIYUN_ACR_USERNAME }}
65+
password: ${{ env.ALIYUN_ACR_PASSWORD }}
66+
67+
- name: Set up Python ${{ matrix.python-version }}
68+
uses: actions/setup-python@v5
69+
with:
70+
python-version: ${{ matrix.python-version }}
71+
72+
- name: Cache pip dependencies
73+
uses: actions/cache@v4
74+
with:
75+
path: ~/.cache/pip
76+
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
77+
restore-keys: |
78+
${{ runner.os }}-pip-
79+
80+
- name: Update setuptools
81+
run: |
82+
pip install --upgrade pip
83+
pip install setuptools==78.1.1 wheel==0.45.1
84+
85+
- name: Set PYTHONPATH
86+
run: |
87+
echo "PYTHONPATH=$PYTHONPATH:${{ github.workspace }}/src" >> $GITHUB_ENV
88+
89+
- name: Install dependencies
90+
run: |
91+
export PIP_DEFAULT_TIMEOUT=300
92+
pip install agentscope-runtime loguru
93+
94+
- name: Run build script for all types
95+
working-directory: alias/src/alias/runtime/alias_sandbox
96+
env:
97+
AUTO_BUILD: "true"
98+
run: |
99+
TAG_INPUT="${{ github.event.inputs.tag }}"
100+
if [ -z "$TAG_INPUT" ]; then
101+
TAG_INPUT=$(date +%Y%m%d)
102+
fi
103+
PLATFORM_INPUT="${{ github.event.inputs.platform }}"
104+
SINGLE="${{ github.event.inputs.single_arch }}"
105+
if [ "$SINGLE" = "true" ]; then
106+
PLATFORM_INPUT="linux/amd64"
107+
fi
108+
IFS=',' read -ra TYPES <<< "alias"
109+
for TYPE in "${TYPES[@]}"; do
110+
runtime-sandbox-builder "$TYPE" --platform "$PLATFORM_INPUT" --dockerfile_path Dockerfile --extension alias_sandbox.py
111+
done
112+
113+
- name: Tag & Push Images
114+
working-directory: alias/src/alias/runtime/alias_sandbox
115+
env:
116+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
117+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
118+
ALIYUN_ACR_USERNAME: ${{ secrets.ALIYUN_ACR_USERNAME }}
119+
ALIYUN_ACR_PASSWORD: ${{ secrets.ALIYUN_ACR_PASSWORD }}
120+
run: |
121+
TAG_INPUT="${{ github.event.inputs.tag }}"
122+
if [ -z "$TAG_INPUT" ]; then
123+
TAG_INPUT=$(date +%Y%m%d)
124+
fi
125+
SINGLE="${{ github.event.inputs.single_arch }}"
126+
ARCH_TAG="${{ github.event.inputs.platform }}"
127+
if [ "$SINGLE" = "true" ]; then
128+
ARCH_TAG="linux/amd64"
129+
fi
130+
IFS=',' read -ra TYPES <<< "alias"
131+
for TYPE in "${TYPES[@]}"; do
132+
IMAGE_BASE=$(python -c "import alias_sandbox; from agentscope_runtime.sandbox.registry import SandboxRegistry; print(SandboxRegistry.get_image_by_type('$TYPE'))")
133+
IMAGE_NAME="${IMAGE_BASE%%:*}"
134+
if [ -n "$DOCKER_USERNAME" ] && [ -n "$DOCKER_PASSWORD" ]; then
135+
if [ "$SINGLE" = "true" ]; then
136+
docker tag "$IMAGE_BASE" "docker.io/${IMAGE_NAME}:${TAG_INPUT}"
137+
docker push "docker.io/${IMAGE_NAME}:${TAG_INPUT}"
138+
else
139+
ARCH_SUFFIX=$(echo "$ARCH_TAG" | tr '/' '-')
140+
docker tag "$IMAGE_BASE" "docker.io/${IMAGE_NAME}:${TAG_INPUT}-${ARCH_SUFFIX}"
141+
docker push "docker.io/${IMAGE_NAME}:${TAG_INPUT}-${ARCH_SUFFIX}"
142+
fi
143+
fi
144+
if [ -n "$ALIYUN_ACR_USERNAME" ] && [ -n "$ALIYUN_ACR_PASSWORD" ]; then
145+
REGISTRY="agentscope-registry.ap-southeast-1.cr.aliyuncs.com"
146+
if [ "$SINGLE" = "true" ]; then
147+
docker tag "$IMAGE_BASE" "${REGISTRY}/${IMAGE_NAME}:${TAG_INPUT}"
148+
docker push "${REGISTRY}/${IMAGE_NAME}:${TAG_INPUT}"
149+
else
150+
ARCH_SUFFIX=$(echo "$ARCH_TAG" | tr '/' '-')
151+
docker tag "$IMAGE_BASE" "${REGISTRY}/${IMAGE_NAME}:${TAG_INPUT}-${ARCH_SUFFIX}"
152+
docker push "${REGISTRY}/${IMAGE_NAME}:${TAG_INPUT}-${ARCH_SUFFIX}"
153+
fi
154+
fi
155+
done
156+
157+
- name: Create Multi-arch Manifest for DockerHub
158+
working-directory: alias/src/alias/runtime/alias_sandbox
159+
env:
160+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
161+
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
162+
if: ${{ github.event.inputs.single_arch == 'false' && env.DOCKER_USERNAME != '' && env.DOCKER_PASSWORD != '' }}
163+
run: |
164+
TAG_INPUT="${{ github.event.inputs.tag }}"
165+
if [ -z "$TAG_INPUT" ]; then
166+
TAG_INPUT=$(date +%Y%m%d)
167+
fi
168+
IFS=',' read -ra TYPES <<< "alias"
169+
for TYPE in "${TYPES[@]}"; do
170+
IMAGE_BASE=$(python -c "import alias_sandbox; from agentscope_runtime.sandbox.registry import SandboxRegistry; print(SandboxRegistry.get_image_by_type('$TYPE'))")
171+
IMAGE_NAME="${IMAGE_BASE%%:*}"
172+
AMD_TAG="docker.io/${IMAGE_NAME}:${TAG_INPUT}-linux-amd64"
173+
ARM_TAG="docker.io/${IMAGE_NAME}:${TAG_INPUT}-linux-arm64"
174+
COMMON_TAG="docker.io/${IMAGE_NAME}:${TAG_INPUT}"
175+
if docker manifest inspect "$AMD_TAG" >/dev/null 2>&1 && docker manifest inspect "$ARM_TAG" >/dev/null 2>&1; then
176+
docker manifest create "$COMMON_TAG" --amend "$AMD_TAG" --amend "$ARM_TAG"
177+
docker manifest push "$COMMON_TAG"
178+
else
179+
echo "Missing architecture image in DockerHub, skipping manifest creation."
180+
fi
181+
done
182+
183+
- name: Create Multi-arch Manifest for Aliyun ACR
184+
working-directory: alias/src/alias/runtime/alias_sandbox
185+
env:
186+
ALIYUN_ACR_USERNAME: ${{ secrets.ALIYUN_ACR_USERNAME }}
187+
ALIYUN_ACR_PASSWORD: ${{ secrets.ALIYUN_ACR_PASSWORD }}
188+
if: ${{ github.event.inputs.single_arch == 'false' && env.ALIYUN_ACR_USERNAME != '' && env.ALIYUN_ACR_PASSWORD != '' }}
189+
run: |
190+
TAG_INPUT="${{ github.event.inputs.tag }}"
191+
if [ -z "$TAG_INPUT" ]; then
192+
TAG_INPUT=$(date +%Y%m%d)
193+
fi
194+
REG="agentscope-registry.ap-southeast-1.cr.aliyuncs.com"
195+
IFS=',' read -ra TYPES <<< "alias"
196+
for TYPE in "${TYPES[@]}"; do
197+
IMAGE_BASE=$(python -c "import alias_sandbox; from agentscope_runtime.sandbox.registry import SandboxRegistry; print(SandboxRegistry.get_image_by_type('$TYPE'))")
198+
IMAGE_NAME="${IMAGE_BASE%%:*}"
199+
AMD_TAG="${REG}/${IMAGE_NAME}:${TAG_INPUT}-linux-amd64"
200+
ARM_TAG="${REG}/${IMAGE_NAME}:${TAG_INPUT}-linux-arm64"
201+
COMMON_TAG="${REG}/${IMAGE_NAME}:${TAG_INPUT}"
202+
if docker manifest inspect "$AMD_TAG" >/dev/null 2>&1 && docker manifest inspect "$ARM_TAG" >/dev/null 2>&1; then
203+
docker manifest create "$COMMON_TAG" --amend "$AMD_TAG" --amend "$ARM_TAG"
204+
docker manifest push "$COMMON_TAG"
205+
else
206+
echo "Missing architecture image in Aliyun ACR, skipping manifest creation."
207+
fi
208+
done

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ This project is licensed under the **Apache 2.0 License** – see the [LICENSE](
162162
## Contributors ✨
163163

164164
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
165-
[![All Contributors](https://img.shields.io/badge/all_contributors-25-orange.svg?style=flat-square)](#contributors-)
165+
[![All Contributors](https://img.shields.io/badge/all_contributors-27-orange.svg?style=flat-square)](#contributors-)
166166
<!-- ALL-CONTRIBUTORS-BADGE:END -->
167167

168168
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/emoji-key/)):
@@ -204,6 +204,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/e
204204
<td align="center" valign="top" width="14.28%"><a href="http://luyi256.github.io"><img src="https://avatars.githubusercontent.com/u/50238286?v=4?s=100" width="100px;" alt="LuYi"/><br /><sub><b>LuYi</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-samples/commits?author=luyi256" title="Code">💻</a> <a href="#example-luyi256" title="Examples">💡</a></td>
205205
<td align="center" valign="top" width="14.28%"><a href="https://github.com/1mycell"><img src="https://avatars.githubusercontent.com/u/143110833?v=4?s=100" width="100px;" alt="Wu Yue"/><br /><sub><b>Wu Yue</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-samples/commits?author=1mycell" title="Code">💻</a> <a href="#example-1mycell" title="Examples">💡</a></td>
206206
<td align="center" valign="top" width="14.28%"><a href="http://www.bruceluo.net"><img src="https://avatars.githubusercontent.com/u/7297307?v=4?s=100" width="100px;" alt="Zhiling (Bruce) Luo"/><br /><sub><b>Zhiling (Bruce) Luo</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-samples/commits?author=zhilingluo" title="Code">💻</a> <a href="#example-zhilingluo" title="Examples">💡</a> <a href="https://github.com/agentscope-ai/agentscope-samples/commits?author=zhilingluo" title="Documentation">📖</a></td>
207+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/yuluo1007"><img src="https://avatars.githubusercontent.com/u/16065149?v=4?s=100" width="100px;" alt="sidiluo"/><br /><sub><b>sidiluo</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-samples/commits?author=yuluo1007" title="Code">💻</a></td>
208+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/AttanWu"><img src="https://avatars.githubusercontent.com/u/16112546?v=4?s=100" width="100px;" alt="Attan"/><br /><sub><b>Attan</b></sub></a><br /><a href="#example-AttanWu" title="Examples">💡</a> <a href="https://github.com/agentscope-ai/agentscope-samples/commits?author=AttanWu" title="Code">💻</a> <a href="https://github.com/agentscope-ai/agentscope-samples/commits?author=AttanWu" title="Documentation">📖</a></td>
207209
</tr>
208210
</tbody>
209211
<tfoot>

README_zh.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
## 贡献者 ✨
171171

172172
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
173-
[![All Contributors](https://img.shields.io/badge/all_contributors-25-orange.svg?style=flat-square)](#contributors-)
173+
[![All Contributors](https://img.shields.io/badge/all_contributors-27-orange.svg?style=flat-square)](#contributors-)
174174
<!-- ALL-CONTRIBUTORS-BADGE:END -->
175175

176176
感谢这些优秀的贡献者们 ([表情符号说明](https://allcontributors.org/emoji-key/)):
@@ -212,6 +212,8 @@
212212
<td align="center" valign="top" width="14.28%"><a href="http://luyi256.github.io"><img src="https://avatars.githubusercontent.com/u/50238286?v=4?s=100" width="100px;" alt="LuYi"/><br /><sub><b>LuYi</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-samples/commits?author=luyi256" title="Code">💻</a> <a href="#example-luyi256" title="Examples">💡</a></td>
213213
<td align="center" valign="top" width="14.28%"><a href="https://github.com/1mycell"><img src="https://avatars.githubusercontent.com/u/143110833?v=4?s=100" width="100px;" alt="Wu Yue"/><br /><sub><b>Wu Yue</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-samples/commits?author=1mycell" title="Code">💻</a> <a href="#example-1mycell" title="Examples">💡</a></td>
214214
<td align="center" valign="top" width="14.28%"><a href="http://www.bruceluo.net"><img src="https://avatars.githubusercontent.com/u/7297307?v=4?s=100" width="100px;" alt="Zhiling (Bruce) Luo"/><br /><sub><b>Zhiling (Bruce) Luo</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-samples/commits?author=zhilingluo" title="Code">💻</a> <a href="#example-zhilingluo" title="Examples">💡</a> <a href="https://github.com/agentscope-ai/agentscope-samples/commits?author=zhilingluo" title="Documentation">📖</a></td>
215+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/yuluo1007"><img src="https://avatars.githubusercontent.com/u/16065149?v=4?s=100" width="100px;" alt="sidiluo"/><br /><sub><b>sidiluo</b></sub></a><br /><a href="https://github.com/agentscope-ai/agentscope-samples/commits?author=yuluo1007" title="Code">💻</a></td>
216+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/AttanWu"><img src="https://avatars.githubusercontent.com/u/16112546?v=4?s=100" width="100px;" alt="Attan"/><br /><sub><b>Attan</b></sub></a><br /><a href="#example-AttanWu" title="Examples">💡</a> <a href="https://github.com/agentscope-ai/agentscope-samples/commits?author=AttanWu" title="Code">💻</a> <a href="https://github.com/agentscope-ai/agentscope-samples/commits?author=AttanWu" title="Documentation">📖</a></td>
215217
</tr>
216218
</tbody>
217219
<tfoot>

alias/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
[![Runtime Docs](https://img.shields.io/badge/built--on-AgentScope%20Runtime-red)](https://runtime.agentscope.io/)
1818
[![Last Commit](https://img.shields.io/github/last-commit/agentscope-ai/agentscope-samples)](https://github.com/agentscope-ai/agentscope-samples)
1919

20+
<p align="center">
21+
<u>
22+
Unlock your unique experience at <a href="https://alias.agentscope.io/"> alias.agentscope.io</a>
23+
</u>
24+
</p>
25+
2026
</div>
2127

2228
[[中文README]](README_ZH.md)
@@ -282,7 +288,7 @@ The backend server will:
282288
- Create the initial superuser account (if not exists)
283289
- Start on `http://localhost:8000` (or the port specified in `.env`)
284290

285-
Verify the server is running by visiting `http://localhost:8000/api/v1/monitor/health`.
291+
Verify the server is running by visiting `http://localhost:8000/api/v1/health`.
286292

287293
#### Start the Frontend
288294

@@ -355,7 +361,7 @@ Once both servers are running:
355361
- **Frontend UI**: Open `http://localhost:5173` in your browser
356362
- **Backend API**: Available at `http://localhost:8000`
357363
- **API Documentation**: Available at `http://localhost:8000/docs` (Swagger UI) or `http://localhost:8000/api/v1/openapi.json` (OpenAPI JSON)
358-
- **Health Check**: `http://localhost:8000/api/v1/monitor/health`
364+
- **Health Check**: `http://localhost:8000/api/v1/health`
359365

360366
#### Default Login Credentials
361367

alias/README_ZH.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
[![Runtime Docs](https://img.shields.io/badge/built--on-AgentScope%20Runtime-red)](https://runtime.agentscope.io/)
1818
[![Last Commit](https://img.shields.io/github/last-commit/agentscope-ai/agentscope-samples)](https://github.com/agentscope-ai/agentscope-samples)
1919

20+
<p align="center">
21+
<u>
22+
开启你的独特体验: <a href="https://alias.agentscope.io/"> alias.agentscope.io</a>
23+
</u>
24+
</p>
25+
2026
</div>
2127

2228
[[English README]](README.md)
@@ -283,7 +289,7 @@ python -m uvicorn alias.server.main:app --host 0.0.0.0 --port 8000 --reload
283289
- 创建初始超级用户账户(如果不存在)
284290
-`http://localhost:8000` 启动(或 `.env` 中指定的端口)
285291

286-
通过访问 `http://localhost:8000/api/v1/monitor/health` 来验证服务器是否正在运行。
292+
通过访问 `http://localhost:8000/api/v1/health` 来验证服务器是否正在运行。
287293

288294
#### 启动前端
289295

@@ -356,7 +362,7 @@ bash script/start_memory_service.sh
356362
- **前端 UI**:在浏览器中打开 `http://localhost:5173`
357363
- **后端 API**:可在 `http://localhost:8000` 访问
358364
- **API 文档**:可在 `http://localhost:8000/docs` (Swagger UI) 或 `http://localhost:8000/api/v1/openapi.json` (OpenAPI JSON) 访问
359-
- **健康检查**`http://localhost:8000/api/v1/monitor/health`
365+
- **健康检查**`http://localhost:8000/api/v1/health`
360366

361367
#### 默认登录凭据
362368

alias/frontend/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<html lang="zh">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
5+
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>AgentScope</title>
7+
<title>Alias</title>
88
</head>
99
<body>
1010
<div id="root"></div>

alias/frontend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"preview": "vite preview --config vite.config.ts"
1010
},
1111
"dependencies": {
12-
"@agentscope-ai/chat": "1.1.17",
13-
"@agentscope-ai/design": "1.0.11",
12+
"@agentscope-ai/chat": "^1.1.44",
13+
"@agentscope-ai/design": "^1.0.20",
1414
"@ahooksjs/use-url-state": "^3.5.1",
1515
"@ant-design/pro-components": "^2.8.7",
1616
"@codemirror/lang-css": "^6.3.1",

0 commit comments

Comments
 (0)