19 Commits
Author SHA1 Message Date
syadmin 27c4d96ae1 docs(deploy): 新增 ai30 生产服发布指南 2026-11-20 00:14:42 +08:00
syadmin 3f680882c8 ci(deploy): 新增 ai30 生产部署工作流(prod 分支手动触发) 2026-11-19 23:53:07 +08:00
runny a27d58560b Merge branch 'master'
deploy-hxtesting / build-and-deploy (push) Successful in 1m49s
2026-11-19 22:33:58 +08:00
runny 3a20abc492 Merge branch 'master'
deploy-hxtesting / build-and-deploy (push) Successful in 2m51s
2026-11-19 17:11:28 +08:00
runny db5ca7790d Merge branch 'master'
deploy-hxtesting / build-and-deploy (push) Successful in 2m34s
2026-11-19 01:50:33 +08:00
runny 0d5afe1193 Merge branch 'master'
deploy-hxtesting / build-and-deploy (push) Successful in 2m58s
2026-11-17 08:22:17 +08:00
runny e0e2a0e7c3 merge: 合并 master 分支推送管理功能(学员开课通知、周一讲师汇总与企微推送闭环)
deploy-hxtesting / build-and-deploy (push) Successful in 1m48s
master 为独立 init 的历史(基线导入+功能提交 7ec21f3+e378e8b),与 main 无共同祖先,
经 --allow-unrelated-histories 合并;冲突处理:training 功能文件取 master,
CI workflow 与 scripts(可执行位)保留 main 版本。
2026-11-16 18:44:13 +08:00
syadmin b328f83244 docs: 发布指南补充 Casdoor 认证接入要点(姓名映射 displayName、SSRF 白名单等服务器侧配置) 2026-11-14 22:16:17 +08:00
syadmin c7fe475545 docs: 测试服发布指南(test 分支触发流程、协作注意事项、环境速查) 2026-11-14 21:57:05 +08:00
syadmin 3bc62a5acb ci: 测试服入口端口 8888→8801(释放 8888 号段,登记册同步)
deploy-hxtesting / build-and-deploy (push) Successful in 1m45s
2026-11-14 21:51:51 +08:00
syadmin 89392b0fa4 ci: 部署触发改为 test 分支(按平台发布纪律:合并 main→test 即发布到测试区的决定),部署目录跟踪 origin/test
deploy-hxtesting / build-and-deploy (push) Successful in 1m50s
2026-11-14 21:44:17 +08:00
syadmin a29ed6ff24 ci: 健康检查与入口端口改为 8888(按端口登记册规范:平台 Web 入口 88xx 段,80 释放)
deploy-hxtesting / build-and-deploy (push) Successful in 1m51s
2026-11-14 19:00:40 +08:00
syadmin 035edaf3fe ci: 镜像清理改为仅限本项目旧 sha 版本(保留最近 5 个),不再使用全局 image prune 以免影响共享服务器上其他项目的悬空层
deploy-hxtesting / build-and-deploy (push) Successful in 1m51s
2026-11-14 18:16:58 +08:00
runny 746ecfaa34 fix: 修复 .gitignore 未锚定目录规则误伤源码(幽灵bug)
deploy-hxtesting / build-and-deploy (push) Successful in 1m52s
- artifacts/ 等未锚定规则会命中任意层级同名目录,导致
  frontend/src/views/artifacts/ArtifactLibrary.vue(路由动态导入)、
  cli/internal/build/(cli 模块源码)、cmd/desktop/build/(桌面构建资产)
  从未入库——本机正常、他人克隆后构建必挂
- 修复: 锚定仓库根 /artifacts/ /dist/ /build/ /tmp/ /temp/ /logs/;补 frontend/dist/
- 找回 6 个被吞文件;顺带清理改名产生的重复规则行
2026-11-14 17:49:28 +08:00
syadmin 04e93935a5 fix: .gitignore 的 artifacts/ 规则限定为仓库根目录(原规则误伤 frontend/src/views/artifacts/ 源码,导致该目录从未入库、克隆后前端构建失败)
deploy-hxtesting / build-and-deploy (push) Failing after 55s
2026-11-14 01:52:51 +08:00
syadmin 5f491edff4 fix(docker): 移除 go 模块的 cache mount 加速构建(hxtesting 上 buildkit cache mount 文件系统 IO 极慢导致 go mod download 超时);ci: 构建跳过 anydoc(Rust 工具链需外网)
deploy-hxtesting / build-and-deploy (push) Failing after 1m45s
2026-11-14 01:49:35 +08:00
syadmin d03e024d59 ci: 新增 Gitea Actions 自动部署工作流(push main 自动构建 app/ui 镜像并部署 hxtesting 测试服);修复 scripts 可执行位 2026-11-14 01:08:14 +08:00
runny 9058149576 refactor: 项目更名 WeKnora → Academy
Build & Publish (dsh-academy) / End-to-end inside dsh (latest, advisory) (push) Skipped
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Frontend / Docker multi-stage image (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-academy) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-academy) / Publish to npm (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Helm / chart (push) Canceled after 0s
- 全量替换代码/配置/文档中的项目名(保留上游 GitHub 链接、weixin 文档域名、Docker Hub 镜像名)
- 重命名 32 个含项目名的文件/目录;Go module 路径改为 academy(含 client/cli 子模块)
- docreader proto 描述符采用等长替换,保持序列化字节布局有效
- Dockerfile.app 构建网络修复: browserskill 离线产物通道、PyPI/apt 国内镜像
- 运行验证: go build ✓ docker compose up ✓ 健康检查 ✓
2026-11-13 20:52:51 +08:00
runny 9097ee699d chore: 项目基线(基于 WeKnora 定制版,整理文件忽略规则) 2026-11-13 17:54:56 +08:00
24 changed files with 173 additions and 0 deletions

No files matched your search

+61
View File
@@ -0,0 +1,61 @@
# ai30 生产服自动部署
# 触发:仅手动(workflow_dispatch)——生产环境人工卡点,push prod 不自动部署。
# (发布纪律 standards://workflow/release@2.0.1:生产部署需人工触发;
# 测试区走 deploy-hxtesting.yml 的 push test 触发,两者分工见 docs/deploy-hxtesting.md)
# 执行:ai30 宿主上的 gitea-runner(label=deploy-ai30,host 模式,inspur 用户)
# 说明:与 deploy-hxtesting 同构,差异三点——分支 prod、端口 8802、目标机 x86_64;
# 端口登记:8801=测试(hxtesting) / 8802=生产(ai30),均属 88xx 平台 Web 号段。
# 构建前产物 artifacts/ 与 .env 均为 gitignored,由部署管理员在 ai30 维护。
name: deploy-ai30
on:
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: deploy-ai30
timeout-minutes: 60
env:
DEPLOY_DIR: /data/ai-platform/ai_academy
steps:
- name: 同步代码
run: |
set -e
cd "$DEPLOY_DIR"
git fetch origin
git checkout -q -B prod origin/prod
echo "GIT_SHA=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
echo "当前部署提交: $(git log --oneline -1)"
- name: 构建镜像(app + frontend,x86_64 原生)
run: |
set -e
cd "$DEPLOY_DIR"
# WITH_ANYDOC=0:跳过 anydoc 解析引擎(Rust 工具链需外网;文档解析由 docreader 容器承担)
WITH_ANYDOC=0 bash scripts/build_images.sh -p
WITH_ANYDOC=0 bash scripts/build_images.sh -f
docker tag wechatopenai/weknora-app:latest wechatopenai/weknora-app:sha-${GIT_SHA}
docker tag wechatopenai/weknora-ui:latest wechatopenai/weknora-ui:sha-${GIT_SHA}
# 仅清理本项目旧版本镜像(保留最近 5 个 sha-* 备回滚),不影响 ai30 上其他项目
for repo in wechatopenai/weknora-app wechatopenai/weknora-ui; do
docker images --format '{{.Tag}}' "$repo" | grep '^sha-' | tail -n +6 \
| xargs -r -I{} docker rmi "$repo:{}" >/dev/null 2>&1 || true
done
- name: 部署(compose up)
run: |
set -e
cd "$DEPLOY_DIR"
docker compose up -d --remove-orphans
- name: 健康检查
run: |
set -e
sleep 20
if curl -fsS -o /dev/null --max-time 10 http://127.0.0.1:8802/; then
echo "WEB_OK: http://ai30:8802/ 已可访问 (sha-${GIT_SHA})"
else
echo "健康检查失败,容器状态:"
cd "$DEPLOY_DIR" && docker compose ps
exit 1
fi
+61
View File
@@ -0,0 +1,61 @@
# hxtesting 测试服自动部署
# 触发:push 到 test 分支(按平台发布纪律:合并 main→test 即一次发布决定),也支持手动触发
# 执行:hxtesting 宿主上的 gitea-runner(label=deploy-host,host 模式)
# 说明:构建 app/frontend 镜像并顶替同名 latest tag,docreader/sandbox 等沿用官方镜像;
# 每次构建额外打 sha-<短提交> tag 便于回滚。
name: deploy-hxtesting
on:
push:
branches: [test]
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: deploy-host
timeout-minutes: 40
env:
DEPLOY_DIR: /home/lisq/services/ai_academy
steps:
- name: 同步代码
run: |
set -e
cd "$DEPLOY_DIR"
git fetch origin
git checkout -q -B test origin/test
echo "GIT_SHA=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
echo "当前部署提交: $(git log --oneline -1)"
- name: 构建镜像(app + frontend,ARM64 原生)
run: |
set -e
cd "$DEPLOY_DIR"
# WITH_ANYDOC=0:跳过 anydoc 解析引擎(Rust 工具链需外网,hxtesting 不可达;
# 文档解析由 docreader 容器承担,测试环境不受影响)
WITH_ANYDOC=0 bash scripts/build_images.sh -p
WITH_ANYDOC=0 bash scripts/build_images.sh -f
docker tag wechatopenai/weknora-app:latest wechatopenai/weknora-app:sha-${GIT_SHA}
docker tag wechatopenai/weknora-ui:latest wechatopenai/weknora-ui:sha-${GIT_SHA}
# 仅清理本项目旧版本镜像(保留最近 5 个 sha-* 备回滚),不影响服务器上其他项目
for repo in wechatopenai/weknora-app wechatopenai/weknora-ui; do
docker images --format '{{.Tag}}' "$repo" | grep '^sha-' | tail -n +6 \
| xargs -r -I{} docker rmi "$repo:{}" >/dev/null 2>&1 || true
done
- name: 部署(compose up)
run: |
set -e
cd "$DEPLOY_DIR"
docker compose up -d --remove-orphans
- name: 健康检查
run: |
set -e
sleep 20
if curl -fsS -o /dev/null --max-time 10 http://127.0.0.1:8801/; then
echo "WEB_OK: http://hxtesting:8801/ 已可访问 (sha-${GIT_SHA})"
else
echo "健康检查失败,容器状态:"
cd "$DEPLOY_DIR" && docker compose ps
exit 1
fi
+51
View File
@@ -0,0 +1,51 @@
# 生产服发布指南(ai30 手动部署)
> 面向本仓库的所有开发者。测试服流程见 [deploy-hxtesting.md](deploy-hxtesting.md);
> 完整原理(runner 装法、踩坑、复建)见平台知识库
> `sy-platform-knowledge/docs/ai-academy-gitea-actions自动部署指南.md`(生产侧照搬同构)。
## 一图流
```
发布准备:git checkout prod
git merge main ← 或从已验证的 test 内容合入
git push origin prod ← 只进分支,不触发部署
生产发布:Gitea → 仓库 → 工作流 → deploy-ai30 → 「运行工作流」(选 prod 分支)
观察结果:工作流 tab 绿✅即发布完成(约 5-30 分钟,首次构建较慢)
访问验证:http://192.168.100.230:8802 ← 工号 + 密码登录(正式 Casdoor auth.well-trust.com)
```
## 你需要记住的三件事
1. **push prod 不自动部署(与测试区最大差异)**。生产环境人工卡点:把代码推上
prod 分支只是「发布候选」,必须到工作流页面手动点「运行工作流」才会真正发布
(发布纪律 `standards://workflow/release@2.0.1`:生产部署需人工触发)。
2. **部署全自动**:手动触发后由 ai30 宿主 runner(label=deploy-ai30)构建镜像并
compose up;失败点开红色运行记录看日志。回滚:ssh ai30 后
`docker tag wechatopenai/weknora-app:sha-<旧hash> wechatopenai/weknora-app:latest`
(ui 同理)→ `cd /data/ai-platform/ai_academy && docker compose up -d app frontend`。
3. **服务器配置不随代码走**:`.env`(端口、数据库、正式 Casdoor 接入等)由部署管理员
维护在 ai30 `/data/ai-platform/ai_academy/.env`(gitignored)。需要改配置找管理员。
## 与测试区的差异速查
| 项 | 测试区(hxtesting) | 生产区(ai30) |
| --- | --- | --- |
| 入口 | http://192.168.100.192:8801 | http://192.168.100.230:8802 |
| 触发 | push `test` 分支即部署 | 手动运行 deploy-ai30 工作流 |
| 工作流 | `.gitea/workflows/deploy-hxtesting.yml` | `.gitea/workflows/deploy-ai30.yml` |
| runner | hxtesting 宿主 lisq 用户(deploy-host) | ai30 宿主 inspur 用户(deploy-ai30,linger 常驻) |
| 认证 | 测试 Casdoor `autht.well-trust.com` | 正式 Casdoor `auth.well-trust.com`(应用 ai-academy) |
| 工作目录 | `~/services/ai_academy` | `/data/ai-platform/ai_academy` |
| 端口登记 | 8801(登记册 88xx 段) | 8802(app 容器仅回环 127.0.0.1:18080,宿主 8080 已被占用) |
## 环境信息速查
| 项 | 值 |
| --- | --- |
| 生产服入口 | http://192.168.100.230:8802(域名绑定待 DNS 管理员登记后更新) |
| 代码仓库 | http://192.168.100.230:3000/szsy_organization/ai_academy |
| 部署机 runner | `ssh ai30 'systemctl --user status gitea-runner'`(inspur,Linger=yes 开机自启) |
| 认证 | 正式 Casdoor `auth.well-trust.com`;回调登记 `http://192.168.100.230:8802/api/v1/auth/oidc/callback`(域名定稿后同步追加域名回调);client 凭据存 Mac `~/dev-tools/aido-oidc-prod.txt`(600) |
| Casdoor 改库备份 | ai30 shared-postgres `casdoor_db.application_bak_20261119`(注册应用行前快照) |
| 数据落位 | ai30 Docker 数据根 `/data/lib/docker`(/data 卷,987G 可用) |
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
Regular → Executable
View File
File mode changed.
View File
File mode changed.
Regular → Executable
View File
File mode changed.