WS-4 Stage 6 (DevOps): Docker packaging + deployment report - #7
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- 首页 / 改造为对话工作台(3 栏:会话侧栏 / 消息流 / 研究检视),集成 ConversationProvider - 新增对话领域类型 types/conversation.ts(对齐 api-contract §5 的 11 类 WS 事件) - 新增 conversation.ts API 客户端 + ConversationWebSocket(JWT 子协议、心跳、自动重连、消息队列) - 新增 conversation-context.tsx(useReducer 管理流式消息 / 阶段进展 / 报告) - 新增 analysis/ 组件:报告卡片(5 级评级 + 5 段 + MD/JSON/PDF 导出)、阶段进展块、评级刻度、数据快照 - 新增 conversation/ 组件:会话侧栏、消息流/气泡、输入区(流式/停止)、未登录引导、检视面板 - 下线模拟交易 / 交易排行榜 / 仪表盘路由与组件,统一 not-found.tsx 引导回对话工作台(适配 output:'export' 静态导出,不使用 redirects()) - AppNavbar 移除排行榜/盯盘入口,新建分析→新建对话;8 个页面 Footer 引用迁移至 common/Footer - 登录/注册后跳转目标改为 / 构建通过(next build 静态导出),无新增 npm 依赖。 Refs: WS-4 M3
Co-authored-by: multica-agent <github@multica.ai>
Stage 6 Part 1 (Docker packaging) — full stack containerized: - devops/Dockerfile.backend: multi-stage FastAPI/uvicorn image, non-root (app user), healthcheck on /api/config, filters optional ta-lib (has pandas fallback in akshare_indicator.py). - devops/Dockerfile.frontend: multi-stage Next.js static export → Nginx, reuses existing nginx.conf.template + start.sh (envsubst), healthcheck on /. - devops/docker-compose.yml: backend + frontend services, SQLite default (no DB service needed), scheduler runs in-process. Optional MySQL profile (commented). Volumes for db/eval/results. restart: unless-stopped. - devops/.env.example: env template (OPENAI_API_KEY required, defaults match gpt-5.5 + oneinfinityai). - devops/deployment-report.md: Part 1 verification (10 endpoint checks pass), Part 2 blocked on backend BUG-006 fix, known risks. - devops/rollback-plan.md: image/git/stop-restore rollback + data backup. Verified on this host (raspberry pi + restricted network, DaoCloud mirror for Docker Hub): both services healthy, frontend serves static export, API proxy works, old trading/leaderboard routes 308/404 as expected. New bug found: BUG-007 (P2) — backend root route GET / returns 500 due to Starlette 1.x TemplateResponse signature change (page_routes.py:20). Non-blocking: nginx serves static frontend, not this route. Flagged for backend rework. Part 2 (full-chain conversation→analysis→report_ready verification) is blocked on backend BUG-006 fix (timeout+degradation for Skills data sources) — will run after that fix merges. Branch: ws-4-devops-stage6 Base: ws-4-m5-m6-backend-hardening + ws-4-m3-frontend merge Co-authored-by: multica-agent <github@multica.ai>
Co-authored-by: multica-agent <github@multica.ai>
…ix, exports verified Merged ws-4-qa-rework (BUG-005/006/007) into ws-4-devops-stage6 and ran the conversation->analysis full chain. Findings: - BUG-006 silent 0% hang reproduced; real root cause is a task-dispatch race (submit_task before db.commit -> worker session can't see the record -> 'analysis record not found' -> abort). NOT the skill layer. Verified 1-line fix (commit before submit) ends the hang; full stage events now flow for US (AAPL) and HK (00700.HK). Fix handed to backend for ws-4-qa-rework. - BUG-006 resilience works: failed runs terminate with stage_error/status=failed. - New env blocker: api.oneinfinityai.com returns 403/Cloudflare-1010 from this egress, capping the chain before report_ready. Environment-specific, not code. - BUG-005 PDF + BUG-007 template signature verified fixed (live in container). Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
Co-authored-by: multica-agent <github@multica.ai>
…build (1e40081) Re-merged ws-4-qa-rework 1e40081 (dispatch race fix) into ws-4-devops-stage6, rebuilt backend, re-ran conversation->analysis for US (AAPL) + HK (00700.HK): - No 0% silent hang: analysis now runs to 10% (market stage), streams the full stage event chain, terminates gracefully status=error on LLM failure. - DB before/after: pre-fix run 0.0%/interrupted; post-fix runs 10.0%/error. - Exports re-verified: PDF %PDF-1.4, MD, JSON all 200. BUG-007 GET / -> 200. - report_ready not reached ONLY because api.oneinfinityai.com returns 403/ Cloudflare-1010 from this egress (env limitation, user confirmed code ok). BUG-006 closed at code level. See deployment-report.md section 5.5. Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: multica-agent <github@multica.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WS-4 Stage 6 (DevOps) — Docker Packaging + Deployment Report
Stage 6 Part 1 (Docker packaging): DONE ✅
Stage 6 Part 2 (full-chain verification): BLOCKED on backend BUG-006 fix
What's in this PR
Adds
devops/directory with Docker packaging artifacts for the full TradingAgents Web stack:devops/Dockerfile.backendappuser), healthcheck on/api/config, filters optionalta-lib(has pandas fallback).devops/Dockerfile.frontendnginx.conf.template+start.sh. Healthcheck on/.devops/docker-compose.ymlbackend+frontendservices. SQLite default (no DB service needed). Scheduler runs in-process. Optional MySQL profile (commented).devops/.env.exampleOPENAI_API_KEYrequired, defaults matchgpt-5.5+oneinfinityai.devops/deployment-report.mddevops/rollback-plan.mdPart 1 Verification (PASS ✅)
Verified on this host (raspberry pi + restricted network, DaoCloud mirror for Docker Hub):
10 endpoint checks all pass:
/api/configthrough nginx): 200 JSON/api/config): 200/intraday-trading: 308 →//leaderboard: 308 →//api/intraday/foo: 404/api/leaderboard: 404New bug found: BUG-007 (P2, non-blocking)
Backend root route
GET /returns 500 due to Starlette 1.x compatibility issue:Starlette 1.x changed
TemplateResponsesignature toTemplateResponse(request, name, context=None). The old call passes adictas the second positional arg →TypeError: unhashable type: 'dict'.Impact: Does NOT affect the deployed app — nginx serves the Next.js static export for
/, and the backend's/route is vestigial. All real API endpoints work correctly.Fix (for backend rework):
templates.TemplateResponse(request, "index.html")Part 2 — Blocked on BUG-006
Full-chain verification (conversation → analysis →
report_ready) requires the backend BUG-006 fix (timeout + degradation for Skills data sources) to be merged first. Will run after that fix lands.Dependencies
This PR is based on the merge of
ws-4-m5-m6-backend-hardening(PR #4) ⊕ws-4-m3-frontend(PR #5). Merge after PRs #1–#5. Only adds new files indevops/— no conflicts with any prior PR.Constraints
gpt-5.5default (deep + quick)https://api.oneinfinityai.com/v1).envgitignored)