Skip to content

Commit 23754ba

Browse files
committed
doc
1 parent 081a843 commit 23754ba

File tree

5 files changed

+158
-38
lines changed

5 files changed

+158
-38
lines changed

deploy/docker/docker-compose-milvus.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ services:
181181
depends_on:
182182
aiproxy_pg:
183183
condition: service_healthy
184-
ports:
185-
- '3002:3000'
186184
networks:
187185
- fastgpt
188186
environment:
@@ -204,8 +202,8 @@ services:
204202
timeout: 5s
205203
retries: 10
206204
aiproxy_pg:
207-
# image: pgvector/pgvector:0.8.0-pg15 # docker hub
208-
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.8.0-pg15 # 阿里云
205+
image: pgvector/pgvector:0.8.0-pg15 # docker hub
206+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.8.0-pg15 # 阿里云
209207
restart: unless-stopped
210208
container_name: aiproxy_pg
211209
volumes:

deploy/docker/docker-compose-pgvector.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ services:
2828
# image: mongo:4.4.29 # cpu不支持AVX时候使用
2929
container_name: mongo
3030
restart: always
31-
ports:
32-
- 27017:27017
31+
# ports:
32+
# - 27017:27017
3333
networks:
3434
- fastgpt
3535
command: mongod --keyFile /data/mongodb.key --replSet rs0
@@ -138,8 +138,6 @@ services:
138138
depends_on:
139139
aiproxy_pg:
140140
condition: service_healthy
141-
ports:
142-
- '3002:3000'
143141
networks:
144142
- fastgpt
145143
environment:
@@ -161,8 +159,8 @@ services:
161159
timeout: 5s
162160
retries: 10
163161
aiproxy_pg:
164-
# image: pgvector/pgvector:0.8.0-pg15 # docker hub
165-
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.8.0-pg15 # 阿里云
162+
image: pgvector/pgvector:0.8.0-pg15 # docker hub
163+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.8.0-pg15 # 阿里云
166164
restart: unless-stopped
167165
container_name: aiproxy_pg
168166
volumes:

deploy/docker/docker-compose-zilliz.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ services:
119119
depends_on:
120120
aiproxy_pg:
121121
condition: service_healthy
122-
ports:
123-
- '3002:3000'
124122
networks:
125123
- fastgpt
126124
environment:
@@ -142,8 +140,8 @@ services:
142140
timeout: 5s
143141
retries: 10
144142
aiproxy_pg:
145-
# image: pgvector/pgvector:0.8.0-pg15 # docker hub
146-
image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.8.0-pg15 # 阿里云
143+
image: pgvector/pgvector:0.8.0-pg15 # docker hub
144+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.8.0-pg15 # 阿里云
147145
restart: unless-stopped
148146
container_name: aiproxy_pg
149147
volumes:

docSite/content/zh-cn/docs/development/upgrading/490.md

Lines changed: 133 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,138 @@ weight: 801
1414

1515
### 2. 更新镜像
1616

17-
### 3. 运行升级脚本
17+
- 更新 FastGPT 镜像 tag: v4.9.0-alpha
18+
- 更新 FastGPT 商业版镜像 tag: v4.9.0-alpha
19+
- Sandbox 镜像,可以不更新
20+
21+
### 3. 替换 OneAPI(可选)
22+
23+
如果需要使用 AI Proxy 替换 OneAPI 的用户可执行该步骤。
24+
25+
#### 1. 修改 yml 文件
26+
27+
参考[最新的 yml](https://raw.githubusercontent.com/labring/FastGPT/main/deploy/docker/docker-compose-pgvector.yml) 文件。里面已移除 OneAPI 并添加了 AIProxy配置。包含一个服务和一个 PgSQL 数据库。将 `aiproxy` 的配置`追加`到 OneAPI 的配置后面(先不要删除 OneAPI,有一个初始化会自动同步 OneAPI 的配置)
28+
29+
{{% details title="AI Proxy Yml 配置" closed="true" %}}
30+
31+
```
32+
# AI Proxy
33+
aiproxy:
34+
image: 'ghcr.io/labring/sealos-aiproxy-service:latest'
35+
container_name: aiproxy
36+
restart: unless-stopped
37+
depends_on:
38+
aiproxy_pg:
39+
condition: service_healthy
40+
networks:
41+
- fastgpt
42+
environment:
43+
# 对应 fastgpt 里的AIPROXY_API_TOKEN
44+
- ADMIN_KEY=aiproxy
45+
# 错误日志详情保存时间(小时)
46+
- LOG_DETAIL_STORAGE_HOURS=1
47+
# 数据库连接地址
48+
- SQL_DSN=postgres://postgres:aiproxy@aiproxy_pg:5432/aiproxy
49+
# 最大重试次数
50+
- RetryTimes=3
51+
# 不需要计费
52+
- BILLING_ENABLED=false
53+
# 不需要严格检测模型
54+
- DISABLE_MODEL_CONFIG=true
55+
healthcheck:
56+
test: ['CMD', 'curl', '-f', 'http://localhost:3000/api/status']
57+
interval: 5s
58+
timeout: 5s
59+
retries: 10
60+
aiproxy_pg:
61+
image: pgvector/pgvector:0.8.0-pg15 # docker hub
62+
# image: registry.cn-hangzhou.aliyuncs.com/fastgpt/pgvector:v0.8.0-pg15 # 阿里云
63+
restart: unless-stopped
64+
container_name: aiproxy_pg
65+
volumes:
66+
- ./aiproxy_pg:/var/lib/postgresql/data
67+
networks:
68+
- fastgpt
69+
environment:
70+
TZ: Asia/Shanghai
71+
POSTGRES_USER: postgres
72+
POSTGRES_DB: aiproxy
73+
POSTGRES_PASSWORD: aiproxy
74+
healthcheck:
75+
test: ['CMD', 'pg_isready', '-U', 'postgres', '-d', 'aiproxy']
76+
interval: 5s
77+
timeout: 5s
78+
retries: 10
79+
```
80+
81+
{{% /details %}}
82+
83+
#### 2. 增加 FastGPT 环境变量:
84+
85+
修改 yml 文件中,fastgpt 容器的环境变量:
86+
87+
```
88+
# AI Proxy 的地址,如果配了该地址,优先使用
89+
- AIPROXY_API_ENDPOINT=http://aiproxy:3000
90+
# AI Proxy 的 Admin Token,与 AI Proxy 中的环境变量 ADMIN_KEY
91+
- AIPROXY_API_TOKEN=aiproxy
92+
```
93+
94+
#### 3. 重载服务
95+
96+
`docker-compose down` 停止服务,然后 `docker-compose up -d` 启动服务,此时会追加 `aiproxy` 服务,并修改 FastGPT 的配置。
97+
98+
#### 4. 执行OneAPI迁移AI proxy脚本
99+
100+
- 可联网方案:
101+
102+
```bash
103+
# 进入 aiproxy 容器
104+
docker exec -it aiproxy sh
105+
# 安装 curl
106+
apk add curl
107+
# 执行脚本
108+
curl --location --request POST 'http://localhost:3000/api/channels/import/oneapi' \
109+
--header 'Authorization: Bearer aiproxy' \
110+
--header 'Content-Type: application/json' \
111+
--data-raw '{
112+
"dsn": "mysql://root:oneapimmysql@tcp(mysql:3306)/oneapi"
113+
}'
114+
# 返回 {"data":[],"success":true} 代表成功
115+
```
116+
117+
- 无法联网时,可打开`aiproxy`的外网暴露端口,然后在本地执行脚本。
118+
119+
aiProxy 暴露端口:3003:3000,修改后重新 `docker-compose up -d` 启动服务。
120+
121+
```bash
122+
# 在终端执行脚本
123+
curl --location --request POST 'http://localhost:3003/api/channels/import/oneapi' \
124+
--header 'Authorization: Bearer aiproxy' \
125+
--header 'Content-Type: application/json' \
126+
--data-raw '{
127+
"dsn": "mysql://root:oneapimmysql@tcp(mysql:3306)/oneapi"
128+
}'
129+
# 返回 {"data":[],"success":true} 代表成功
130+
```
131+
132+
- 如果不熟悉 docker 操作,建议不要走脚本迁移,直接删除 OneAPI 所有内容,然后手动重新添加渠道。
133+
134+
#### 5. 进入 FastGPT 检查`AI Proxy` 服务是否正常启动。
135+
136+
登录 root 账号后,在`账号-模型提供商`页面,可以看到多出了`模型渠道``调用日志`两个选项,打开模型渠道,可以看到之前 OneAPI 的渠道,说明迁移完成,此时可以手动再检查下渠道是否正常。
137+
138+
#### 6. 删除 OneAPI 服务
139+
140+
```bash
141+
# 停止服务,或者针对性停止 OneAPI 和其 Mysql
142+
docker-compose down
143+
# yml 文件中删除 OneAPI 和其 Mysql 依赖
144+
# 重启服务
145+
docker-compose up -d
146+
```
147+
148+
### 4. 运行 FastGPT 升级脚本
18149

19150
从任意终端,发起 1 个 HTTP 请求。其中 {{rootkey}} 替换成环境变量里的 `rootkey`;{{host}} 替换成**FastGPT 域名**
20151

@@ -28,7 +159,7 @@ curl --location --request POST 'https://{{host}}/api/admin/initv490' \
28159

29160
1. 升级 PG Vector 插件版本
30161
2. 全量更新知识库集合字段。
31-
3. 全量更新知识库数据中,index 的 type 类型。(时间较长)
162+
3. 全量更新知识库数据中,index 的 type 类型。(时间较长,最后可能提示 timeout,可忽略,数据库不崩都会一直增量执行
32163

33164
## 兼容 & 弃用
34165

projects/app/src/pageComponents/dataset/detail/Import/commonProgress/DataProcess.tsx

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -159,34 +159,29 @@ function DataProcess() {
159159
gridTemplateColumns={'repeat(2, 1fr)'}
160160
/>
161161
</Box>
162-
{trainingType === DatasetCollectionDataProcessModeEnum.chunk && (
162+
{trainingType === DatasetCollectionDataProcessModeEnum.chunk && feConfigs?.isPlus && (
163163
<Box mt={6}>
164164
<Box fontSize={'sm'} mb={2} color={'myGray.600'}>
165165
{t('dataset:enhanced_indexes')}
166166
</Box>
167-
{feConfigs?.isPlus && (
168-
<HStack gap={[3, 7]}>
169-
<HStack flex={'1'} spacing={1}>
170-
<Checkbox {...register('autoIndexes')}>
171-
<FormLabel>{t('dataset:auto_indexes')}</FormLabel>
167+
<HStack gap={[3, 7]}>
168+
<HStack flex={'1'} spacing={1}>
169+
<Checkbox {...register('autoIndexes')}>
170+
<FormLabel>{t('dataset:auto_indexes')}</FormLabel>
171+
</Checkbox>
172+
<QuestionTip label={t('dataset:auto_indexes_tips')} />
173+
</HStack>
174+
<HStack flex={'1'} spacing={1}>
175+
<MyTooltip
176+
label={!datasetDetail?.vlmModel ? t('common:error_vlm_not_config') : ''}
177+
>
178+
<Checkbox isDisabled={!datasetDetail?.vlmModel} {...register('imageIndex')}>
179+
<FormLabel>{t('dataset:image_auto_parse')}</FormLabel>
172180
</Checkbox>
173-
<QuestionTip label={t('dataset:auto_indexes_tips')} />
174-
</HStack>
175-
<HStack flex={'1'} spacing={1}>
176-
<MyTooltip
177-
label={!datasetDetail?.vlmModel ? t('common:error_vlm_not_config') : ''}
178-
>
179-
<Checkbox
180-
isDisabled={!datasetDetail?.vlmModel}
181-
{...register('imageIndex')}
182-
>
183-
<FormLabel>{t('dataset:image_auto_parse')}</FormLabel>
184-
</Checkbox>
185-
</MyTooltip>
186-
<QuestionTip label={t('dataset:image_auto_parse_tips')} />
187-
</HStack>
181+
</MyTooltip>
182+
<QuestionTip label={t('dataset:image_auto_parse_tips')} />
188183
</HStack>
189-
)}
184+
</HStack>
190185
</Box>
191186
)}
192187
<Box mt={6}>

0 commit comments

Comments
 (0)