fix(api): fix dockerfile to include models.json, remove huge prompt example to fit 4K limit
All checks were successful
E2E Health Check / e2e-health (push) Successful in 17s

This commit is contained in:
OG T
2026-03-31 14:03:34 +08:00
parent 46843c8e19
commit fb0ddf305c
2 changed files with 4 additions and 41 deletions

View File

@@ -39,8 +39,9 @@ WORKDIR /app
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
# Copy application code
# Copy application code and models config
COPY apps/api/src/ ./src/
COPY apps/api/models.json ./models.json
# Create non-root user
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app

View File

@@ -102,46 +102,8 @@ For each optimization suggestion, provide EXECUTABLE kubectl commands:
}
```
## 🔥 Example: High CPU with SignOz Data
Given SignOz metrics: RPS=150 (↑), Error=0.5%, P99=450ms (↑)
```json
{
"action_title": "擴展副本數 + 配置 HPA 自動擴展",
"description": "api-gateway CPU 飆高SignOz 顯示 RPS 從 80 飆升至 150 (+87%)P99 從 200ms 升至 450ms。流量突增導致資源不足。",
"suggested_action": "SCALE_DEPLOYMENT",
"kubectl_command": "kubectl scale deployment/api-gateway --replicas=4 -n production",
"target_resource": "api-gateway",
"namespace": "production",
"risk_level": "medium",
"blast_radius": {
"affected_pods": 0,
"estimated_downtime": "0",
"related_services": [],
"data_impact": "NONE"
},
"primary_responsibility": "INFRA",
"responsibility_reasoning": "流量突增但 HPA 未配置,屬基礎設施團隊責任",
"secondary_teams": ["BE"],
"optimization_suggestions": [
{
"type": "HPA",
"description": "配置 CPU 基準 HPA閾值 70%,基於 SignOz RPS 趨勢",
"kubectl_or_config": "kubectl autoscale deployment api-gateway --cpu-percent=70 --min=2 --max=10 -n production"
},
{
"type": "RESOURCE_LIMIT",
"description": "增加 CPU limit 以應對流量峰值",
"kubectl_or_config": "kubectl set resources deployment/api-gateway --requests=cpu=500m --limits=cpu=2000m -n production"
}
],
"reasoning": "SignOz 數據顯示流量突增為主因,非代碼問題。先擴容緩解,再配置 HPA 防止復發。",
"deviation_analysis": "RPS +87%P99 延遲 +125%,超出基準線達 +4.2σ",
"confidence": 0.91,
"affected_services": ["api-gateway"],
"signoz_correlation": "RPS 與 CPU 使用率高度相關 (r=0.94)P99 上升為資源競爭導致"
}
```
## 🔥 Short Example: High CPU -> SCALE_DEPLOYMENT, HPA, risk_level=medium
Please carefully justify your confidence between 0.0 and 1.0 (e.g. 0.82) based on symptoms and metrics.
Now analyze the following alert with SignOz data:
"""