AirSpark/README.md
zyc 3f33485632
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 1m42s
ci: 添加 Gitea Actions 部署流水线 + K3s 清单
对齐 AirShelf 的部署模型(master→prod / dev→dev),适配 Next.js 16 SSR 形态:
- frontend/Dockerfile · multi-stage(deps→builder→runner),Next.js standalone + node:20-alpine,非 root 运行
- frontend/next.config.ts · 启用 output: "standalone"(打 Docker 镜像必需)
- frontend/.dockerignore · 排除 .next/node_modules/env 等
- k8s/ · web-deployment(:3000) + ingress + cert-issuer + redirect middleware
- .gitea/workflows/deploy.yaml · build/push 重试 3 次,deploy 重试 5 次,失败上报日志中心 project_id=airspark
- prod 域名 airspark.airlabs.art / dev 域名 airspark.test.airlabs.art

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-18 11:49:43 +08:00

130 lines
3.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Air Spark
> AI 驱动的动画自动化生产平台 · Air Spark 内部使用
导演通过对话生成剧本,系统自动串联**图片生成 → 视频生成 → 拼接**,输出完整成片。
---
## 核心理念
**模型 + Skill = Agent**
Skill 即系统提示词,定义 Agent 的行为规则和输出格式。新增内容类型 = 新增 Skill不改代码。
---
## 七阶段流水线
```
Stage 1 剧本对话 screenplay-skill
Stage 2 资产 & 分镜规划 storyboard-skill
Stage 3 片段切分 segmentation-skill
Stage 4 参考图生成 Banana Pro (人设图 / 场景图)
Stage 5 Keyshot 宫格图 空间锚点参考
Stage 6 视频生成 Seedance (提示词 + 参考图)
Stage 7 拼接成片
```
两条并行线均以剧本为输入:
- 剧本 → storyboard-skill → Keyshot 宫格图(空间参考)
- 剧本 → segmentation-skill → 片段提示词 → Seedance
---
## 目录结构
```
.
├── frontend/ Next.js 16 (App Router) + React 19 + Tailwind v4
├── skills/ 项目 Skill 包(剧本、分镜、切分等)
├── skills-lock.json Skill 版本锁
├── PRD.md 产品需求文档
├── UI-Design-System.md 设计系统规范
├── DEV-LOG.md 开发日志
├── seedance视频生成文档.md Seedance API 集成参考
└── mook图/ Mock / 参考图
```
---
## 快速开始
```bash
cd frontend
npm install
npx next dev --webpack
```
打开 http://localhost:3000
> ⚠️ Next.js 16 的 Turbopack 在部分 Windows 环境会 panic`failed to create whole tree`),所以使用 `--webpack` 启动。
可用路由:
- `/` — 首页
- `/dashboard` — 项目工作台
- `/showcase` — UI 展示
---
## 技术栈
- **Frontend**Next.js 16.1.6 · React 19.2 · TypeScript 5 · Tailwind CSS v4
- **图标**lucide-react
- **视频生成**:火山引擎 Seedance参见 `seedance视频生成文档.md`
- **图像生成**Banana Pro
- **对话/规划**Claude通过 Skill 体系驱动)
---
## 角色
| 角色 | 核心需求 |
|------|---------|
| **导演** | 对话写剧本 → 一键触发流水线 → 审核成片 |
| **管理员** | 管理成员、API Key、Skill 配置 |
---
## 内容层级
```
Project一部动画 IP
├── Asset Library角色/场景图,跨集复用)
└── EpisodeEP01, EP02 ...
├── script.md
├── 流水线状态
└── 各阶段输出文件
```
---
## 更多文档
- [PRD.md](./PRD.md) — 完整产品需求
- [UI-Design-System.md](./UI-Design-System.md) — 设计系统
- [DEV-LOG.md](./DEV-LOG.md) — 开发日志
- [seedance视频生成文档.md](./seedance视频生成文档.md) — Seedance API 接入
---
## 部署
CI/CD 走 Gitea Actions + 火山引擎 CR + K3s(traefik + cert-manager)。
| 分支 | 环境 | 域名 | Image tag |
| --- | --- | --- | --- |
| `master` | production | `airspark.airlabs.art` | `prod-YYYYMMDD-<sha7>` |
| `dev` | development | `airspark.test.airlabs.art` | `dev-YYYYMMDD-<sha7>` |
推到对应分支自动触发 [.gitea/workflows/deploy.yaml](.gitea/workflows/deploy.yaml):
checkout → `docker build ./frontend` (multi-stage: deps → builder → runner)→ push `airspark-web` → kubectl apply [k8s/](k8s/) → rollout restart。
**Next.js standalone 模式:** [frontend/next.config.ts](frontend/next.config.ts) 中 `output: "standalone"`,Docker runtime 仅拷贝 `.next/standalone` + `.next/static` + `public`,以非 root 用户运行 `node server.js`,监听 `:3000`。Service 80 → targetPort 3000。
**Gitea 仓库需要配置的 Secrets:**
- prod: `CR_PROD_PASSWORD` · `VOLCANO_PROD_KUBE_CONFIG`
- dev: `CR_SERVER` · `CR_USERNAME` · `CR_PASSWORD` · `VOLCANO_TEST_KUBE_CONFIG`