Skip to content

Commit fdce605

Browse files
authored
Feat/2.3.0 (#1881)
2 parents f9d2254 + 99da63e commit fdce605

File tree

511 files changed

+22553
-8893
lines changed

Some content is hidden

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

511 files changed

+22553
-8893
lines changed

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# 默认:自动识别文本,统一用 LF 存库
2-
* text=auto eol=lf
2+
#* text=auto eol=lf
33

44
# 明确常见文本文件用 LF
55
*.py text eol=lf
@@ -31,4 +31,4 @@
3131
*.mp4 binary
3232
*.docx binary
3333
*.xlsx binary
34-
*.pptx binary
34+
*.pptx binary
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Build Linux Binaries (x86_64 & ARM)
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- "build.*"
8+
9+
jobs:
10+
build_pyc:
11+
name: Build for pyc files only
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
repository: dataelement/bisheng-telemetry-search
18+
token: ${{ secrets.CROSS_REPO_TOKEN }}
19+
path: bisheng-telemetry-search
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: '3.10'
25+
26+
- name: Build and Clean Artifacts
27+
working-directory: ./bisheng-telemetry-search/telemetry_search
28+
run: |
29+
# 执行构建
30+
python -m compileall -b .
31+
32+
# 在上传前彻底清理源代码和中间文件
33+
# 即使 build_all.py 做了清理,这里再次强制清理,防止 .c 文件泄露
34+
find . -name "*.py" -delete
35+
find . -name "__pycache__" -exec rm -rf {} +
36+
37+
# 准备输出
38+
mkdir ../../build_output
39+
cp -r ./* ../../build_output/
40+
41+
echo "Listing artifacts to be uploaded:"
42+
ls -R ../../build_output/
43+
44+
- name: Upload PYC Artifacts
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: telemetry_search
48+
path: ./build_output/*
49+
50+
deploy_to_sso_project:
51+
name: Deploy Artifacts to SSO Project
52+
needs: [ build_pyc ]
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Checkout SSO Project
56+
uses: actions/checkout@v4
57+
with:
58+
repository: dataelement/bisheng
59+
token: ${{ secrets.CROSS_REPO_TOKEN }}
60+
# 使用 ref 指定分支,而不是 base
61+
ref: feat/2.3.0
62+
path: bisheng
63+
# 确保拉取完整的历史以便正确提交
64+
fetch-depth: 0
65+
66+
- name: Download PYC Artifacts
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: telemetry_search
70+
path: ./telemetry_search
71+
72+
- name: Merge and Place Files
73+
run: |
74+
75+
find ./telemetry_search -name "*.py" -delete
76+
77+
# 移动到目标仓库目录
78+
cp -r ./telemetry_search ./bisheng/src/backend/bisheng/
79+
80+
echo "Final content of target directory:"
81+
ls -lh ./bisheng/src/backend/bisheng/telemetry_search
82+
83+
- name: Commit and Push changes
84+
working-directory: ./bisheng
85+
run: |
86+
git config --global user.name "github-actions[bot]"
87+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
88+
89+
git add .
90+
91+
# 检查是否有变更,有才提交
92+
if git diff --staged --quiet; then
93+
echo "No changes to commit"
94+
else
95+
git commit -m "chore: update telemetry_search build artifacts [skip ci]"
96+
git push origin feat/2.3.0
97+
fi

.gitignore

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,10 @@ __pycache__/
123123
*$py.class
124124
notebooks
125125

126-
# C extensions
127-
*.so
128-
129126
# Distribution / packaging
130127
.Python
131128
build/
132129
./third_party
133-
output/
134130
develop-eggs/
135131
config.dev.yaml
136132
downloads/
@@ -267,3 +263,4 @@ docker/mysql/data/*
267263
docker/office/bisheng/*.gz
268264

269265
CLAUDE.md
266+
!src/backend/bisheng/telemetry_search/**/*.pyc

docker/bisheng/config/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ database_url:
44
"mysql+pymysql://root:gAAAAABlp4b4c59FeVGF_OQRVf6NOUIGdxq8246EBD-b0hdK_jVKRs1x4PoAn0A6C5S6IiFKmWn0Nm5eBUWu-7jxcqw6TiVjQA==@mysql:3306/bisheng?charset=utf8mb4"
55

66
# 缓存配置 redis://[[username]:[password]]@localhost:6379/0
7+
# 如果设置了密码,需要参考MySQL密码的加密逻辑对密码进行加密。eg: redis://root:gAAAAABlp4b4c59FeVGF_OQRVf6NOUIGdxq8246EBD-b0hdK_jVKRs1x4PoAn0A6C5S6IiFKmWn0Nm5eBUWu-7jxcqw6TiVjQA==@redis:6379/0
78
# 普通模式:
89
redis_url: "redis://redis:6379/1"
910

docker/bisheng/entrypoint.sh

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,66 @@
11
#!/bin/bash
2+
set -xe
23

34
export PYTHONPATH="./"
45

56
start_mode=${1:-api}
67

7-
if [ $start_mode = "api" ]; then
8+
start_knowledge(){
9+
# 知识库解析的celery worker
10+
celery -A bisheng.worker.main worker -l info -c 20 -P threads -Q knowledge_celery -n knowledge@%h
11+
}
12+
13+
start_workflow(){
14+
# 工作流相关的celery worker
15+
celery -A bisheng.worker.main worker -l info -c 100 -P threads -Q workflow_celery -n workflow@%h
16+
}
17+
18+
start_beat(){
19+
# 定时任务调度
20+
celery -A bisheng.worker.main beat -l info
21+
}
22+
23+
start_linsight(){
24+
# 灵思后台任务worker
25+
python bisheng/linsight/worker.py --worker_num 4 --max_concurrency 5
26+
}
27+
start_default(){
28+
# 默认其他任务的执行worker,目前是定时统计埋点数据
29+
celery -A bisheng.worker.main worker -l info -c 100 -P threads -Q celery -n celery@%h
30+
}
31+
32+
if [ "$start_mode" = "api" ]; then
833
echo "Starting API server..."
934
uvicorn bisheng.main:app --host 0.0.0.0 --port 7860 --no-access-log --workers 8
10-
elif [ $start_mode = "worker" ]; then
11-
echo "Starting Celery worker..."
35+
elif [ "$start_mode" = "knowledge" ]; then
36+
echo "Starting Knowledge Celery worker..."
37+
start_knowledge
38+
elif [ "$start_mode" = "workflow" ]; then
39+
echo "Starting Workflow Celery worker..."
40+
start_workflow
41+
elif [ "$start_mode" = "beat" ]; then
42+
echo "Starting Celery beat..."
43+
start_beat
44+
elif [ "$start_mode" = "default" ]; then
45+
echo "Starting default celery worker..."
46+
start_default
47+
elif [ "$start_mode" = "linsight" ]; then
48+
echo "Starting LinSight worker..."
49+
start_linsight
50+
elif [ "$start_mode" = "worker" ]; then
51+
echo "Starting All worker..."
1252
# 处理知识库相关任务的worker
13-
nohup celery -A bisheng.worker.main worker -l info -c 20 -P threads -Q knowledge_celery -n knowledge@%h &
14-
# 工作流执行worker
15-
nohup celery -A bisheng.worker.main worker -l info -c 100 -P threads -Q workflow_celery -n workflow@%h &
53+
start_knowledge &
54+
# 处理工作流相关任务的worker
55+
start_workflow &
56+
# 处理linsight相关任务的worker
57+
start_linsight &
58+
# 默认其他任务的执行worker,目前是定时统计埋点数据
59+
start_default &
60+
start_beat
1661

17-
python bisheng/linsight/worker.py --worker_num 4 --max_concurrency 5
62+
echo "All workers started successfully."
1863
else
19-
echo "Invalid start mode. Use 'api' or 'worker'."
64+
echo "Invalid start mode. Use apiworker、knowledge、workflow、beat、default、linsight."
2065
exit 1
2166
fi

docker/docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ services:
4040

4141
backend:
4242
container_name: bisheng-backend
43-
image: dataelement/bisheng-backend:v2.3.0-beta4
43+
image: dataelement/bisheng-backend:v2.3.0
4444
ports:
4545
- "7860:7860"
4646
environment:
@@ -78,7 +78,7 @@ services:
7878

7979
backend_worker:
8080
container_name: bisheng-backend-worker
81-
image: dataelement/bisheng-backend:v2.3.0-beta4
81+
image: dataelement/bisheng-backend:v2.3.0
8282
environment:
8383
TZ: Asia/Shanghai
8484
BS_MILVUS_CONNECTION_ARGS: '{"host":"milvus","port":"19530","user":"","password":"","secure":false}'
@@ -109,7 +109,7 @@ services:
109109

110110
frontend:
111111
container_name: bisheng-frontend
112-
image: dataelement/bisheng-frontend:v2.3.0-beta4
112+
image: dataelement/bisheng-frontend:v2.3.0
113113
ports:
114114
- "3001:3001"
115115
environment:

src/backend/bisheng/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# from bisheng.processing.process import load_flow_from_json # noqa: E402
77

88
try:
9-
# 通过ci去自动修改
10-
__version__ = '2.3.0-beta4'
9+
# SetujuciGo to automatic modification
10+
__version__ = '2.3.0'
1111
except metadata.PackageNotFoundError:
1212
# Case where package metadata is not available.
1313
__version__ = ''

src/backend/bisheng/api/router.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
group_router, mark_router,
77
report_router, skillcenter_router, tag_router,
88
user_router, validate_router, variable_router, workflow_router,
9-
workstation_router, linsight_router, tool_router, invite_code_router)
9+
workstation_router, tool_router, invite_code_router)
1010
from bisheng.chat_session.api.router import router as session_router
1111
from bisheng.finetune.api.finetune import router as finetune_router
1212
from bisheng.finetune.api.server import router as server_router
@@ -17,6 +17,8 @@
1717
knowledge_router_rpc, workflow_router_rpc,
1818
filelib_router_rpc)
1919
from bisheng.share_link.api.router import router as share_link_router
20+
from bisheng.linsight.api.router import router as linsight_router
21+
from bisheng.telemetry_search.api.router import router as telemetry_search_router
2022

2123
router = APIRouter(prefix='/api/v1', )
2224
router.include_router(chat_router)
@@ -46,6 +48,7 @@
4648
router.include_router(invite_code_router)
4749
router.include_router(session_router)
4850
router.include_router(share_link_router)
51+
router.include_router(telemetry_search_router)
4952

5053
router_rpc = APIRouter(prefix='/api/v2', )
5154
router_rpc.include_router(knowledge_router_rpc)

0 commit comments

Comments
 (0)