feat: 新增 compute_gateway、compute_poller、agent 模块,重构前端 dist

- 新增 backend/app/modules/compute_gateway(client/sync)计算网关模块
- 新增 backend/app/workers/compute_poller 计算轮询 worker
- 新增 compute/agent/process_manager 进程管理器
- 新增 scripts/ 脚本目录
- 更新 Docker 部署配置(app/compute/nginx)
- 更新后端平台 API、数据库 SQL、core 配置
- 更新前端多个视图组件及 API 模块
- 重构 frontend/dist 构建产物(新 hash)
- 更新多项文档

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
wuyongtao
2026-07-22 17:32:59 +08:00
parent 1e438164c1
commit 836343b29e
180 changed files with 3352 additions and 263 deletions

View File

@@ -1061,8 +1061,20 @@ CREATE TABLE IF NOT EXISTS compute_nodes (
name varchar(150) NOT NULL,
host varchar(200) NOT NULL,
api_base_url text NOT NULL,
file_gateway_url text NOT NULL DEFAULT '',
storage_node_id uuid REFERENCES storage_nodes(id) ON DELETE SET NULL,
status varchar(40) NOT NULL DEFAULT 'online',
scheduler_status varchar(40) NOT NULL DEFAULT 'online',
scheduler_weight integer NOT NULL DEFAULT 100,
enabled boolean NOT NULL DEFAULT true,
max_parallel_jobs integer NOT NULL DEFAULT 1,
data_root text NOT NULL DEFAULT '/data/yg-ft',
model_root text NOT NULL DEFAULT '/data/yg-ft/models',
log_root text NOT NULL DEFAULT '/opt/yg-ft/logs/training',
api_version varchar(40) NOT NULL DEFAULT 'v1',
capabilities jsonb NOT NULL DEFAULT '[]'::jsonb,
description text,
health_detail jsonb NOT NULL DEFAULT '{}'::jsonb,
agent_version varchar(80),
gpu_count integer NOT NULL DEFAULT 0,
last_heartbeat_at timestamptz,
@@ -1434,10 +1446,15 @@ ALTER TABLE fine_tune_tasks ADD COLUMN IF NOT EXISTS tenant_id uuid REFERENCES t
ALTER TABLE fine_tune_tasks ADD COLUMN IF NOT EXISTS project_id uuid REFERENCES projects(id) ON DELETE SET NULL;
ALTER TABLE fine_tune_tasks ADD COLUMN IF NOT EXISTS owner_id uuid REFERENCES users(id) ON DELETE SET NULL;
ALTER TABLE fine_tune_tasks ADD COLUMN IF NOT EXISTS approval_status approval_status NOT NULL DEFAULT 'not_required';
ALTER TABLE fine_tune_tasks ADD COLUMN IF NOT EXISTS compute_node_id uuid REFERENCES compute_nodes(id) ON DELETE SET NULL;
ALTER TABLE fine_tune_tasks ADD COLUMN IF NOT EXISTS compute_job_id uuid REFERENCES compute_jobs(id) ON DELETE SET NULL;
ALTER TABLE fine_tune_tasks ADD COLUMN IF NOT EXISTS resume_checkpoint_id uuid REFERENCES fine_tune_checkpoints(id) ON DELETE SET NULL;
CREATE INDEX IF NOT EXISTS idx_fine_tune_tasks_scope_status
ON fine_tune_tasks(tenant_id, project_id, status, created_at DESC) WHERE deleted_at IS NULL;
CREATE INDEX IF NOT EXISTS idx_fine_tune_tasks_compute_job
ON fine_tune_tasks(compute_job_id) WHERE deleted_at IS NULL;
CREATE INDEX IF NOT EXISTS idx_fine_tune_tasks_node_status
ON fine_tune_tasks(compute_node_id, status, created_at DESC) WHERE deleted_at IS NULL;
ALTER TABLE inference_tasks ADD COLUMN IF NOT EXISTS tenant_id uuid REFERENCES tenants(id) ON DELETE SET NULL;
ALTER TABLE inference_tasks ADD COLUMN IF NOT EXISTS project_id uuid REFERENCES projects(id) ON DELETE SET NULL;