feat(scheduler): 实现 Worker 调度和管理功能#43
Merged
Merged
Conversation
主要变更: - 新增 SchedulerConfig 配置结构 - 重构 Worker 为 WorkerClient,优化 WebSocket 连接管理 - 实现 ProcessScheduler 进程调度器 - 新增 WorkerManager 服务器端管理 - 调整路由注册逻辑,整合到主配置 - 统一使用 worker-id 替代 assistant-code
Implements WorkerScheduler interface using Docker CLI commands to manage containerized workers. Features: - Start/Stop/Health/List containerized workers - Thread-safe instance tracking with mutex - Environment variable injection from config and spec - Container lifecycle monitoring via polling - Automatic cleanup on stop Enhancements: - Add Mode field to SchedulerConfig with proper YAML/JSON tags - Add interface compliance verification to ProcessScheduler - Follow same patterns as ProcessScheduler for consistency
- 添加完整的单元测试覆盖核心函数 - 测试 containerName, buildEnvVars, containerWorkingDir 等辅助函数 - 验证环境变量合并逻辑和覆盖优先级 - 测试构造函数和错误处理路径 - 添加并发安全性测试验证线程安全 - 修复: 添加 containerWorkingDir 方法 - 修复: 移除 SINGEROS_ASSISTANT_CODE 环境变量 - 修复: 添加容器工作目录卷挂载
Contributor
Author
|
/oc 检查一下代码是否有什么问题 |
Contributor
|
让我获取PR分支并查看具体变更内容。 |
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.

主要变更: