workflow-local-dev
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWorkflow Local Development
工作流本地开发
Quick Reference
快速参考
Key Commands
关键命令
| Task | Command |
|---|---|
| Check pods | |
| Restart component | |
| View component logs | |
| 任务 | 命令 |
|---|---|
| 检查Pod状态 | |
| 重启组件 | |
| 查看组件日志 | |
Locally Deployed Components
本地部署的组件
These workflow services are deployed locally as shared dependencies:
, , , , , ,
workflow-catalogworkflow-executions-apiworkflow-engine-workerworkflow-consumerworkflow-validatorworkflows-workerstandalone-tasks-worker以下工作流服务作为共享依赖项本地部署:
, , , , , ,
workflow-catalogworkflow-executions-apiworkflow-engine-workerworkflow-consumerworkflow-validatorworkflows-workerstandalone-tasks-workerUtility Scripts
实用脚本
Execute these scripts for common operations:
执行以下脚本完成常见操作:
Check Pod Status
检查Pod状态
bash
bash .cursor/skills/workflow-local-dev/scripts/check-pods.shbash
bash .cursor/skills/workflow-local-dev/scripts/check-pods.shRestart a Service
重启服务
bash
bash .cursor/skills/workflow-local-dev/scripts/restart-service.sh <service-name>bash
bash .cursor/skills/workflow-local-dev/scripts/restart-service.sh <service-name>Example: bash .cursor/skills/workflow-local-dev/scripts/restart-service.sh catalog
示例: bash .cursor/skills/workflow-local-dev/scripts/restart-service.sh catalog
undefinedundefinedTail Service Logs
跟踪服务日志
bash
bash .cursor/skills/workflow-local-dev/scripts/tail-logs.sh <service-name>bash
bash .cursor/skills/workflow-local-dev/scripts/tail-logs.sh <service-name>Example: bash .cursor/skills/workflow-local-dev/scripts/tail-logs.sh executions-api
示例: bash .cursor/skills/workflow-local-dev/scripts/tail-logs.sh executions-api
undefinedundefinedQuery Database
查询数据库
bash
bash .cursor/skills/workflow-local-dev/scripts/db-query.sh "<SQL query>"bash
bash .cursor/skills/workflow-local-dev/scripts/db-query.sh "<SQL query>"Example: bash .cursor/skills/workflow-local-dev/scripts/db-query.sh "SELECT * FROM workflow_engine.workflows ORDER BY created_at DESC LIMIT 5"
示例: bash .cursor/skills/workflow-local-dev/scripts/db-query.sh "SELECT * FROM workflow_engine.workflows ORDER BY created_at DESC LIMIT 5"
---
---Development Workflow
开发流程
Use this flow primarily when containers fail locally or when you need to debug runtime behavior.
- Capture current status:
kubectl get pods --context kind-kind - Rebuild/restart component:
tilt trigger workflow-<service> - Watch logs or health:
kubectl logs -f <pod> --context kind-kind - Inspect configuration or data (if needed):
bash .cursor/skills/workflow-local-dev/scripts/db-query.sh "<SQL query>"
主要在容器本地运行失败或需要调试运行时行为时使用此流程。
- 捕获当前状态:
kubectl get pods --context kind-kind - 重建/重启组件:
tilt trigger workflow-<service> - 监控日志或健康状态:
kubectl logs -f <pod> --context kind-kind - 检查配置或数据(如有需要):
bash .cursor/skills/workflow-local-dev/scripts/db-query.sh "<SQL query>"
Troubleshooting
故障排查
Pod Issues
Pod问题
bash
kubectl get pods --context kind-kind
kubectl describe pod <pod-name> --context kind-kind
kubectl logs -f <pod-name> --context kind-kindbash
kubectl get pods --context kind-kind
kubectl describe pod <pod-name> --context kind-kind
kubectl logs -f <pod-name> --context kind-kindTemporal Workflows
Temporal工作流
Open http://localhost:8081 (Temporal UI) and search by workflow ID.
打开 http://localhost:8081 (Temporal UI) 并按工作流ID搜索。
Database State
数据库状态
bash
undefinedbash
undefinedUse the db-query script (runs psql inside the postgres pod)
使用db-query脚本(在postgres Pod内运行psql)
bash .cursor/skills/workflow-local-dev/scripts/db-query.sh "SELECT * FROM workflow_engine.workflows ORDER BY created_at DESC LIMIT 5"
undefinedbash .cursor/skills/workflow-local-dev/scripts/db-query.sh "SELECT * FROM workflow_engine.workflows ORDER BY created_at DESC LIMIT 5"
undefinedPulsar Messages
Pulsar消息
bash
pulsar-admin topics stats persistent://public/dap/<topic>
pulsar-client consume persistent://public/dap/<topic> -s test-sub -n 10bash
pulsar-admin topics stats persistent://public/dap/<topic>
pulsar-client consume persistent://public/dap/<topic> -s test-sub -n 10Using Kubernetes MCP (When Available)
使用Kubernetes MCP(若可用)
If the Kubernetes MCP server is enabled, you can use MCP tools instead of shell commands for a more integrated experience. The MCP defaults to the context.
kind-kind如果Kubernetes MCP服务器已启用,您可以使用MCP工具替代Shell命令,获得更集成的体验。MCP默认使用上下文。
kind-kindList Pods
列出Pods
Tool: pods_list
Arguments: { "labelSelector": "app=workflow-catalog" }Or list all pods:
Tool: pods_list
Arguments: {}工具: pods_list
参数: { "labelSelector": "app=workflow-catalog" }或列出所有Pods:
工具: pods_list
参数: {}Get Pod Logs
获取Pod日志
Tool: pods_log
Arguments: {
"name": "workflow-catalog-xxxxx",
"namespace": "default",
"tail": 100
}For previous container logs (after crash):
Tool: pods_log
Arguments: {
"name": "workflow-catalog-xxxxx",
"namespace": "default",
"previous": true
}工具: pods_log
参数: {
"name": "workflow-catalog-xxxxx",
"namespace": "default",
"tail": 100
}对于容器崩溃后的历史日志:
工具: pods_log
参数: {
"name": "workflow-catalog-xxxxx",
"namespace": "default",
"previous": true
}Execute Commands in Pods (e.g., Database Queries)
在Pod中执行命令(例如数据库查询)
Tool: pods_exec
Arguments: {
"name": "postgres-xxxxx",
"namespace": "default",
"command": ["psql", "-U", "postgres", "-d", "temporal", "-c", "SELECT * FROM workflow_engine.workflows ORDER BY created_at DESC LIMIT 5"]
}工具: pods_exec
参数: {
"name": "postgres-xxxxx",
"namespace": "default",
"command": ["psql", "-U", "postgres", "-d", "temporal", "-c", "SELECT * FROM workflow_engine.workflows ORDER BY created_at DESC LIMIT 5"]
}Delete Pod (Force Restart)
删除Pod(强制重启)
Tool: pods_delete
Arguments: {
"name": "workflow-catalog-xxxxx",
"namespace": "default"
}工具: pods_delete
参数: {
"name": "workflow-catalog-xxxxx",
"namespace": "default"
}Get Pod Details
获取Pod详情
Tool: pods_get
Arguments: {
"name": "workflow-catalog-xxxxx",
"namespace": "default"
}工具: pods_get
参数: {
"name": "workflow-catalog-xxxxx",
"namespace": "default"
}List Cluster Events (Troubleshooting)
列出集群事件(故障排查)
Tool: events_list
Arguments: { "namespace": "default" }Note: When using MCP tools, you don't need to specifyas it defaults tocontext. The MCP approach is useful when you want the agent to directly interact with the cluster without spawning shell processes.kind-kind
工具: events_list
参数: { "namespace": "default" }注意: 使用MCP工具时,无需指定,因为它默认使用context。当您希望Agent直接与集群交互而无需启动Shell进程时,MCP方法非常有用。kind-kind
Additional Resources
额外资源
- For complete service URLs and infrastructure details, see reference.md
- 完整的服务URL和基础设施详情,请查看 reference.md