feat: add Temporal-backed TaskTree service

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
root
2026-07-16 20:59:51 +02:00
parent de43ed5508
commit 23de918e94
32 changed files with 3410 additions and 3 deletions
+60
View File
@@ -506,6 +506,8 @@ lanes:
- hwlab-workbench-runtime
- hwlab-user-billing
- hwlab-project-management
- hwlab-tasktree-api
- hwlab-tasktree-worker
- hwlab-cloud-web
- hwlab-gateway
- hwlab-edge-proxy
@@ -515,6 +517,8 @@ lanes:
hwlab-workbench-runtime: deploy/runtime/boot/hwlab-workbench-runtime.sh
hwlab-user-billing: deploy/runtime/boot/hwlab-user-billing.sh
hwlab-project-management: deploy/runtime/boot/hwlab-project-management.sh
hwlab-tasktree-api: deploy/runtime/boot/hwlab-tasktree-api.sh
hwlab-tasktree-worker: deploy/runtime/boot/hwlab-tasktree-worker.sh
hwlab-cloud-web: deploy/runtime/boot/hwlab-cloud-web.sh
hwlab-gateway: deploy/runtime/boot/hwlab-gateway.sh
hwlab-edge-proxy: deploy/runtime/boot/hwlab-edge-proxy.sh
@@ -630,6 +634,37 @@ lanes:
env:
TZ: Asia/Shanghai
observable: true
hwlab-tasktree-api:
runtimeKind: bun-command
entrypoint: cmd/hwlab-tasktree-api/main.ts
artifactKind: bun-command
healthPath: /health/ready
healthPort: 6673
componentPaths:
- cmd/hwlab-tasktree-api/
- internal/tasktree/
- tools/src/tasktree-cli.ts
- package.json
- package-lock.json
- deploy/runtime/boot/hwlab-tasktree-api.sh
env:
TZ: Asia/Shanghai
observable: true
hwlab-tasktree-worker:
runtimeKind: bun-command
entrypoint: cmd/hwlab-tasktree-worker/main.ts
artifactKind: bun-command
healthPath: /health/ready
healthPort: 6674
componentPaths:
- cmd/hwlab-tasktree-worker/
- internal/tasktree/
- package.json
- package-lock.json
- deploy/runtime/boot/hwlab-tasktree-worker.sh
env:
TZ: Asia/Shanghai
observable: true
hwlab-cloud-web:
runtimeKind: cloud-web
entrypoint: web/hwlab-cloud-web/index.html
@@ -857,6 +892,7 @@ lanes:
HWLAB_USER_BILLING_URL: http://hwlab-user-billing.hwlab-v03.svc.cluster.local:6670
HWLAB_WORKBENCH_RUNTIME_URL: http://hwlab-workbench-runtime.hwlab-v03.svc.cluster.local:6671
HWLAB_PROJECT_MANAGEMENT_URL: http://hwlab-project-management.hwlab-v03.svc.cluster.local:6672
HWLAB_TASKTREE_URL: http://hwlab-tasktree-api.hwlab-v03.svc.cluster.local:6673
HWLAB_HWPOD_SPEC_REGISTRY_DIRS: /etc/hwlab/hwpod-specs
HWLAB_HWPOD_NODE_WS_TOKEN: secretRef:hwlab-v03-hwpod-node-auth/token
HWLAB_USER_BILLING_LOGIN_RETRY_ATTEMPTS: "2"
@@ -964,7 +1000,31 @@ lanes:
configMapName: hwlab-v03-project-management-bootstrap
mountPath: /etc/hwlab/project-management
readOnly: true
- serviceId: hwlab-tasktree-api
replicas: 1
env:
TASKTREE_DATABASE_URL: secretRef:hwlab-tasktree-db/database-url
TASKTREE_TEMPORAL_ADDRESS: temporal-frontend.temporal.svc.cluster.local:7233
TASKTREE_TEMPORAL_NAMESPACE: unidesk
TASKTREE_TEMPORAL_TASK_QUEUE: hwlab-v03-tasktree
TASKTREE_API_PORT: "6673"
OTEL_SERVICE_NAME: hwlab-tasktree-api
- serviceId: hwlab-tasktree-worker
replicas: 1
env:
TASKTREE_DATABASE_URL: secretRef:hwlab-tasktree-db/database-url
TASKTREE_TEMPORAL_ADDRESS: temporal-frontend.temporal.svc.cluster.local:7233
TASKTREE_TEMPORAL_NAMESPACE: unidesk
TASKTREE_TEMPORAL_TASK_QUEUE: hwlab-v03-tasktree
TASKTREE_WORKER_HEALTH_PORT: "6674"
OTEL_SERVICE_NAME: hwlab-tasktree-worker
services:
- serviceId: hwlab-tasktree-api
namespace: hwlab-dev
healthPath: /health/live
- serviceId: hwlab-tasktree-worker
namespace: hwlab-dev
healthPath: /health/live
- serviceId: hwlab-cloud-api
namespace: hwlab-dev
healthPath: /health/live
+28
View File
@@ -2,6 +2,34 @@
"apiVersion": "v1",
"kind": "List",
"items": [
{
"apiVersion": "v1",
"kind": "Service",
"metadata": {
"name": "hwlab-tasktree-api",
"namespace": "hwlab-dev",
"labels": { "app.kubernetes.io/name": "hwlab-tasktree-api", "hwlab.pikastech.local/service-id": "hwlab-tasktree-api" }
},
"spec": {
"type": "ClusterIP",
"selector": { "app.kubernetes.io/name": "hwlab-tasktree-api" },
"ports": [{ "name": "http", "port": 6673, "targetPort": "http" }]
}
},
{
"apiVersion": "v1",
"kind": "Service",
"metadata": {
"name": "hwlab-tasktree-worker",
"namespace": "hwlab-dev",
"labels": { "app.kubernetes.io/name": "hwlab-tasktree-worker", "hwlab.pikastech.local/service-id": "hwlab-tasktree-worker" }
},
"spec": {
"type": "ClusterIP",
"selector": { "app.kubernetes.io/name": "hwlab-tasktree-worker" },
"ports": [{ "name": "http", "port": 6674, "targetPort": "http" }]
}
},
{
"apiVersion": "v1",
"kind": "Service",
+48
View File
@@ -2,6 +2,54 @@
"apiVersion": "v1",
"kind": "List",
"items": [
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "hwlab-tasktree-api",
"namespace": "hwlab-dev",
"labels": { "app.kubernetes.io/name": "hwlab-tasktree-api", "hwlab.pikastech.local/service-id": "hwlab-tasktree-api" }
},
"spec": {
"replicas": 0,
"selector": { "matchLabels": { "app.kubernetes.io/name": "hwlab-tasktree-api" } },
"template": {
"metadata": { "labels": { "app.kubernetes.io/name": "hwlab-tasktree-api", "hwlab.pikastech.local/service-id": "hwlab-tasktree-api" } },
"spec": { "containers": [{
"name": "hwlab-tasktree-api",
"image": "127.0.0.1:5000/hwlab/hwlab-tasktree-api:dev",
"ports": [{ "name": "http", "containerPort": 6673 }],
"env": [{ "name": "TASKTREE_API_PORT", "value": "6673" }],
"readinessProbe": { "httpGet": { "path": "/health/ready", "port": "http" } },
"livenessProbe": { "httpGet": { "path": "/health/live", "port": "http" } }
}] }
}
}
},
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "hwlab-tasktree-worker",
"namespace": "hwlab-dev",
"labels": { "app.kubernetes.io/name": "hwlab-tasktree-worker", "hwlab.pikastech.local/service-id": "hwlab-tasktree-worker" }
},
"spec": {
"replicas": 0,
"selector": { "matchLabels": { "app.kubernetes.io/name": "hwlab-tasktree-worker" } },
"template": {
"metadata": { "labels": { "app.kubernetes.io/name": "hwlab-tasktree-worker", "hwlab.pikastech.local/service-id": "hwlab-tasktree-worker" } },
"spec": { "containers": [{
"name": "hwlab-tasktree-worker",
"image": "127.0.0.1:5000/hwlab/hwlab-tasktree-worker:dev",
"ports": [{ "name": "http", "containerPort": 6674 }],
"env": [{ "name": "TASKTREE_WORKER_HEALTH_PORT", "value": "6674" }],
"readinessProbe": { "httpGet": { "path": "/health/ready", "port": "http" } },
"livenessProbe": { "httpGet": { "path": "/health/live", "port": "http" } }
}] }
}
}
},
{
"apiVersion": "v1",
"kind": "PersistentVolumeClaim",
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
set -eu
export HWLAB_SERVICE_ID=hwlab-tasktree-api
export HWLAB_SERVICE_ENTRYPOINT=cmd/hwlab-tasktree-api/main.ts
export TASKTREE_API_PORT="${TASKTREE_API_PORT:-6673}"
export PORT="$TASKTREE_API_PORT"
exec "${HWLAB_BUN_COMMAND:-bun}" run cmd/hwlab-tasktree-api/main.ts
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
set -eu
export HWLAB_SERVICE_ID=hwlab-tasktree-worker
export HWLAB_SERVICE_ENTRYPOINT=cmd/hwlab-tasktree-worker/main.ts
export TASKTREE_WORKER_HEALTH_PORT="${TASKTREE_WORKER_HEALTH_PORT:-6674}"
export PORT="$TASKTREE_WORKER_HEALTH_PORT"
exec "${HWLAB_BUN_COMMAND:-bun}" run cmd/hwlab-tasktree-worker/main.ts