| feat: integrate Template Manager and refactor E2B runtime - Add TemplateManagerClient; scheduler queries template metadata before E2B sandbox creation and enriches e2b.dev/* annotations - Refactor E2B runtime: remove all Container-layer CRI calls, use PodSandbox interface only - Remove parseCPUToVCPU/parseMemoryToMB; vcpu/ram-mb injected by Template Manager - Fix e2b.dev/tem-id typo to e2b.dev/team-id - Default runtime type changed to e2b (configured via agentEnv.RUNTIME_TYPE) - Unify agent socket to RUNTIME_SOCKET; E2B injects unix:///run/cri-multiplex.sock - Add e2bRuntimeEndpoint config to ConfigMap - Add NODE_IP/E2B_CONFIG_PATH env and hostPath mount to scheduler - ListImages/PullImage/GetSandboxLogs return not supported - resolvePodRuntimeType/resolveRuntimeTypeFromTemplate iterate all containers - Update sandbox-watcher CRI socket to /run/cri-multiplex.sock - Add template_manager_client_test.go covering HTTP/error/cache/injection logic - Refactor NewSSGRuntimeManager and Attach to use config structs (G.FUN.01) - Extract matchesLabelSelector helper to reduce nesting in e2b_test.go - Fix G.ERR.01: check io.WriteString/ReadAll/WriteFile return values - Merge duplicate 403/410 test cases into table test | 2 个月前 |
| feat: add copyright headers, fix deployment config and containerd image normalization - Add Mulan PSL v2 copyright headers to 82 source files (Go, proto, Python, Makefile, Dockerfiles) and include OAT.xml for license compliance tooling - Fix Makefile: add missing build-scheduler target - Fix deployment config: correct defaultSandboxAgentImage, add gRPC port 9091 to controller, reorganize sandbox-watcher config under config/sandbox-watcher/ with proper RBAC and namespace - Add normalizeImageRef in containerd runtime to canonicalize short image names (e.g. python:3.11 -> docker.io/library/python:3.11), fixing "invalid port" errors from containerd - Rename internal/sandbox-watcher/ to internal/sandboxwatcher/ to match Go package name convention - Add defensive default cases to switch statements in scanner.go - Fix import group ordering across all Go files (stdlib -> third-party -> local) per goimports best practice - Add examples/data_pipeline.py ETL demo - Refine README.md and README.en.md | 2 个月前 |
| refactor: clean up code smells and fix UpsertDetail atomicity in warm subsystem Code cleanup: - Remove dead field TaskManager.workers - Drop unused ctx param in computeTargets - Drop unused snapshotID param in LoadBalancer.Pick (round-robin, no affinity) - Remove dead Store.GetCachedSuperPods method, implementation, and mock - Remove redundant Health initial value in parseMooncakeRawValue (always overwritten) - Replace custom splitKey with strings.Split in etcd.go - Replace redundant goroutine with defer cancel() in TaskManager.Start - Simplify QueryCacheDetails signature (drop unused int64 total return) - Extract shared doWarmSnapshotHTTP helper from e2b_client and node_backend - Use task-supplied CreatedAt/UpdatedAt in CreateTask instead of time.Now() Race and atomicity fixes: - Fix data race in LoadBalancer.RefreshStorage (copy slice under lock) - Fix classifyFn data race (lock SetClassifyFunc and read classifyFn under lock) - Make UpsertDetail atomic via SELECT FOR UPDATE transaction with plan union and SUCCESS guard, fixing state-stuck-at-WARM bug when concurrent workers overwrite the plan of one another - warmTarget returns snapshotComplete to early-exit when all targets warmed - Log DB error instead of silently swallowing in processSnapshot GetDetail - Exit process on HTTP/gRPC server crash; guard gRPC context.Canceled Design-doc alignment fixes (oFEP-0004): - Remove warm-to-all fallback per A4: when fewer SuperPods than the regular target count are available, computeTargets retries with a refreshed capacity view and then records the snapshot FAILED; no plan inflation - Rebuild the load-balancer pool from the configured SuperPod set on every RefreshStorage so an excluded SuperPod returns once its view recovers (the pool previously could only shrink, blocking A4 retry recovery) - Record unplanned snapshots via UpsertDetail(state=FAILED) so task progress counts them as failed instead of in-progress forever - Make SUCCESS terminal in MarkSnapshotFailed (SQL guard state <> SUCCESS): a late failure from a concurrent task must not regress a fully-warmed snapshot - storage-details response covers all N configured SuperPods per D3: missing reports are filled as health=UNAVAILABLE; etcd keys outside the configured set are dropped - Mirror the PGStore UpsertDetail/MarkSnapshotFailed contracts in fakeStore (SUCCESS guard, plan union, warmed-set preservation) so unit tests are faithful to the real store Static-check fixes: - End the GetDetail if/else-if chain with an else clause - Add default clause to the progress-summary switch statement - Document why fakeStore.Close is empty in task manager tests - Replace time.After with an explicitly stopped timer per bounded retry in warmTarget - Use one shared deadline timer for the concurrent-worker wait loop in tests - Check UpsertDetail and CreateTask errors in task manager tests - G.FUN.01: extract pickRegularTargets and sleepOrCancelled helpers from computeTargets so each function has a single purpose and shallow nesting; warmTarget reuses sleepOrCancelled for its retry backoff - G.TYP.09: check map key presence with the comma-ok idiom before reading storage-details test response entries Adds stringSetUnion helper, mock tests, and integration tests for the concurrent UpsertDetail scenario. Also fixes verifyTaskProgress compile error and StaleTaskNotReclaimedWhenFresh zero-timestamp regression. | 1 个月前 |
| feat: 实现沙箱快照预热功能 (oFEP-0004) 为 FluxSandboxController 增加快照预热子系统,支持异步批量预热快照到 SuperPod,并提供任务进度、缓存详情与存储资源查询接口。 主要内容: - 新增 warm 包:任务管理器、PostgreSQL 持久化层、E2B API-Server 客户端、 MoonCake etcd 客户端、负载均衡调度、4 个 RESTful API - 新增 PostgreSQL Schema (0001_warm.sql) 及两表模型 - 集成到 controller:--warm-* flag、生命周期管理与 API 挂载 关键设计: - 任务队列基于 FOR UPDATE SKIP LOCKED 原子领取,stale 超时回收 - 逐目标下发 E2B,warmed_snapshot_id 幂等,集合比较驱动状态机 - 负载均衡器共享游标实现常规镜像跨 SuperPod 轮询分布 - 处理过程心跳刷新 updated_at,防止长任务被重复领取 - 重启恢复跳过已 SUCCESS 快照,不降级状态 - 请求体大小限制、批量查询、错误码校验等健壮性加固 | 1 个月前 |
| 新增提案: 0007-FluxSandbox对接Kata运行时 | 1 个月前 |
| feat: add copyright headers, fix deployment config and containerd image normalization - Add Mulan PSL v2 copyright headers to 82 source files (Go, proto, Python, Makefile, Dockerfiles) and include OAT.xml for license compliance tooling - Fix Makefile: add missing build-scheduler target - Fix deployment config: correct defaultSandboxAgentImage, add gRPC port 9091 to controller, reorganize sandbox-watcher config under config/sandbox-watcher/ with proper RBAC and namespace - Add normalizeImageRef in containerd runtime to canonicalize short image names (e.g. python:3.11 -> docker.io/library/python:3.11), fixing "invalid port" errors from containerd - Rename internal/sandbox-watcher/ to internal/sandboxwatcher/ to match Go package name convention - Add defensive default cases to switch statements in scanner.go - Fix import group ordering across all Go files (stdlib -> third-party -> local) per goimports best practice - Add examples/data_pipeline.py ETL demo - Refine README.md and README.en.md | 2 个月前 |
| 新增提案: 0007-FluxSandbox对接Kata运行时 | 1 个月前 |
| docs: add 30000 sandbox performance verification report | 2 个月前 |
| Add sandbox-benchmark tool and fix CR deletion/ghost reservation issues Add sandbox-benchmark performance testing tool (tools/sandbox-benchmark/): - HTTP path via opensandbox-server SDK (WithRetry for create, manual retry with per-attempt context for delete) and gRPC direct path - Shared HTTP transport between create and delete phases to avoid EADDRNOTAVAIL (local port exhaustion) - Timing collection from controller/scheduler logs via K8s log API, filtered by actual sandbox ID set - Formatted output: per-round results, summary stats, controller/ scheduler timing breakdown, and p50 latency decomposition tree - README.md with build, RBAC, and usage instructions Controller log-level and timing optimization: - slog level Info->Warn to keep timing logs within K8s 10Mi container log size limit - Merge handler_ms into CreateSandbox timing log (eliminates separate high-volume gRPC handler timing log) - DeleteSandbox trace logs to Debug - Timing precision Milliseconds->Seconds*1000 - upsertSubSandboxGroup: Update->MergeFrom Patch (avoids resourceVersion conflict flooding Reconciler error logs) - Deployment: max-concurrent-streams=5000 Scheduler high-frequency log downgrade: - 9 Info logs to Debug (reconcileOrphanSandboxes, removeStuckFinalizer, UpdateSummary, etc.) - handleDeleteSandbox to Debug - Timing precision improvement Fix CR deletion caused by spurious SSG onDelete events: - ssg_watcher.go onDelete: add DeletionTimestamp check to skip false delete events from informer watch reconnects during create bursts - main.go: K8s client QPS 50->100, Burst 100->200 (eliminates client-side throttling that destabilizes watch connection) Fix ghost reservation false detection during create bursts: - orphanGracePeriod 30s->60s (agent /status may return empty during create bursts, 30s too short causing false ghost detection) - Add minGhostConfirm=3: require 3 consecutive ghost detections before cleanup (resets if sandbox reappears in agent /status) - highWaterMark 200->50 (easier to trigger GetStatus backoff) - Upgrade ghost reservation cleanup logs from Debug to Info Fix benchmark reporter percentage display precision: %.1f->%.2f Reduce waitIdleRecovery print frequency from 5s to 30s Fix gate-check violations: - G.CMT.01: add copyright headers to all benchmark source files - G.TYP.09: use comma-ok pattern for map key reads in collector.go - if-else-if: add else clause in collector.go log parsing - G.ERR.01: check extractInt and WriteFile error returns - G.FUN.01: extract parseTimingFields, scanLogs, collectFromPod, collectCtrlFields, collectSchedFields to reduce function depth - G.PKG.04: fix import ordering in runner.go - G.SIT.02: check type assertion in allocator.go - G.FMT.01: gofmt all modified files (controller.go, sandbox_controller.go) - Duplicate code: extract runHTTPCreate, runDeletes, newCreateResult, buildDeleteClient to eliminate repeated blocks - Large functions: split createViaHTTP (76->33) and deleteSandboxes (85->25) by extracting worker logic | 1 个月前 |
| feat: initial release of FluxSandbox FluxSandbox is a high-performance sandbox scheduling engine for Kubernetes, designed for AI agent workloads that demand low-latency, high-throughput sandbox lifecycle management. Core design: - One Pod, N sandboxes model for high-density deployment (>1000/node) - Two-phase scheduling: K8s schedules Agent Pods, FluxSandbox scheduler dispatches sandboxes in-memory without etcd writes - Sharded parallel scheduling with linear throughput scaling - Async CR persistence for cloud-native operability - Pluggable runtime interface (containerd supported, E2B/kata planned) - OpenSandbox integration via SandboxProviderService gRPC Components: - flux-sandbox-controller: shard management, routing, gRPC gateway - flux-sandbox-scheduler: in-memory registry, scheduling engine, CR orchestration - flux-sandbox-agent: data-plane runtime management - sandbox-watcher: orphan sandbox cleanup (DaemonSet) CRDs: SandboxGroup, SubSandboxGroup, Sandbox (v1alpha1) Performance targets: <50ms latency, >3000 sandboxes/s, >1000 sandboxes/node | 2 个月前 |
| refactor: move warm subsystem into internal/snapshotwarmup package Move the snapshot warm-up code from internal/flux-sandbox-controller/warm into its own package (internal/snapshotwarmup), running inside the controller process without a separate deployment: - Warm RESTful API is mounted on the controller HTTP server at /api/v1/ - Warm task manager runs as a goroutine within the controller - Dropped controller-runtime dependency from InitComponents - Removed standalone cmd/snapshot-warmup, Dockerfile and K8s manifests - Warm DB migrations live under config/controller/warm-migrations/ | 1 个月前 |
| feat: add copyright headers, fix deployment config and containerd image normalization - Add Mulan PSL v2 copyright headers to 82 source files (Go, proto, Python, Makefile, Dockerfiles) and include OAT.xml for license compliance tooling - Fix Makefile: add missing build-scheduler target - Fix deployment config: correct defaultSandboxAgentImage, add gRPC port 9091 to controller, reorganize sandbox-watcher config under config/sandbox-watcher/ with proper RBAC and namespace - Add normalizeImageRef in containerd runtime to canonicalize short image names (e.g. python:3.11 -> docker.io/library/python:3.11), fixing "invalid port" errors from containerd - Rename internal/sandbox-watcher/ to internal/sandboxwatcher/ to match Go package name convention - Add defensive default cases to switch statements in scanner.go - Fix import group ordering across all Go files (stdlib -> third-party -> local) per goimports best practice - Add examples/data_pipeline.py ETL demo - Refine README.md and README.en.md | 2 个月前 |
| feat: add copyright headers, fix deployment config and containerd image normalization - Add Mulan PSL v2 copyright headers to 82 source files (Go, proto, Python, Makefile, Dockerfiles) and include OAT.xml for license compliance tooling - Fix Makefile: add missing build-scheduler target - Fix deployment config: correct defaultSandboxAgentImage, add gRPC port 9091 to controller, reorganize sandbox-watcher config under config/sandbox-watcher/ with proper RBAC and namespace - Add normalizeImageRef in containerd runtime to canonicalize short image names (e.g. python:3.11 -> docker.io/library/python:3.11), fixing "invalid port" errors from containerd - Rename internal/sandbox-watcher/ to internal/sandboxwatcher/ to match Go package name convention - Add defensive default cases to switch statements in scanner.go - Fix import group ordering across all Go files (stdlib -> third-party -> local) per goimports best practice - Add examples/data_pipeline.py ETL demo - Refine README.md and README.en.md | 2 个月前 |
| feat: add copyright headers, fix deployment config and containerd image normalization - Add Mulan PSL v2 copyright headers to 82 source files (Go, proto, Python, Makefile, Dockerfiles) and include OAT.xml for license compliance tooling - Fix Makefile: add missing build-scheduler target - Fix deployment config: correct defaultSandboxAgentImage, add gRPC port 9091 to controller, reorganize sandbox-watcher config under config/sandbox-watcher/ with proper RBAC and namespace - Add normalizeImageRef in containerd runtime to canonicalize short image names (e.g. python:3.11 -> docker.io/library/python:3.11), fixing "invalid port" errors from containerd - Rename internal/sandbox-watcher/ to internal/sandboxwatcher/ to match Go package name convention - Add defensive default cases to switch statements in scanner.go - Fix import group ordering across all Go files (stdlib -> third-party -> local) per goimports best practice - Add examples/data_pipeline.py ETL demo - Refine README.md and README.en.md | 2 个月前 |
| feat: initial release of FluxSandbox FluxSandbox is a high-performance sandbox scheduling engine for Kubernetes, designed for AI agent workloads that demand low-latency, high-throughput sandbox lifecycle management. Core design: - One Pod, N sandboxes model for high-density deployment (>1000/node) - Two-phase scheduling: K8s schedules Agent Pods, FluxSandbox scheduler dispatches sandboxes in-memory without etcd writes - Sharded parallel scheduling with linear throughput scaling - Async CR persistence for cloud-native operability - Pluggable runtime interface (containerd supported, E2B/kata planned) - OpenSandbox integration via SandboxProviderService gRPC Components: - flux-sandbox-controller: shard management, routing, gRPC gateway - flux-sandbox-scheduler: in-memory registry, scheduling engine, CR orchestration - flux-sandbox-agent: data-plane runtime management - sandbox-watcher: orphan sandbox cleanup (DaemonSet) CRDs: SandboxGroup, SubSandboxGroup, Sandbox (v1alpha1) Performance targets: <50ms latency, >3000 sandboxes/s, >1000 sandboxes/node | 2 个月前 |
| feat: initial release of FluxSandbox FluxSandbox is a high-performance sandbox scheduling engine for Kubernetes, designed for AI agent workloads that demand low-latency, high-throughput sandbox lifecycle management. Core design: - One Pod, N sandboxes model for high-density deployment (>1000/node) - Two-phase scheduling: K8s schedules Agent Pods, FluxSandbox scheduler dispatches sandboxes in-memory without etcd writes - Sharded parallel scheduling with linear throughput scaling - Async CR persistence for cloud-native operability - Pluggable runtime interface (containerd supported, E2B/kata planned) - OpenSandbox integration via SandboxProviderService gRPC Components: - flux-sandbox-controller: shard management, routing, gRPC gateway - flux-sandbox-scheduler: in-memory registry, scheduling engine, CR orchestration - flux-sandbox-agent: data-plane runtime management - sandbox-watcher: orphan sandbox cleanup (DaemonSet) CRDs: SandboxGroup, SubSandboxGroup, Sandbox (v1alpha1) Performance targets: <50ms latency, >3000 sandboxes/s, >1000 sandboxes/node | 2 个月前 |
| refactor: clean up code smells and fix UpsertDetail atomicity in warm subsystem Code cleanup: - Remove dead field TaskManager.workers - Drop unused ctx param in computeTargets - Drop unused snapshotID param in LoadBalancer.Pick (round-robin, no affinity) - Remove dead Store.GetCachedSuperPods method, implementation, and mock - Remove redundant Health initial value in parseMooncakeRawValue (always overwritten) - Replace custom splitKey with strings.Split in etcd.go - Replace redundant goroutine with defer cancel() in TaskManager.Start - Simplify QueryCacheDetails signature (drop unused int64 total return) - Extract shared doWarmSnapshotHTTP helper from e2b_client and node_backend - Use task-supplied CreatedAt/UpdatedAt in CreateTask instead of time.Now() Race and atomicity fixes: - Fix data race in LoadBalancer.RefreshStorage (copy slice under lock) - Fix classifyFn data race (lock SetClassifyFunc and read classifyFn under lock) - Make UpsertDetail atomic via SELECT FOR UPDATE transaction with plan union and SUCCESS guard, fixing state-stuck-at-WARM bug when concurrent workers overwrite the plan of one another - warmTarget returns snapshotComplete to early-exit when all targets warmed - Log DB error instead of silently swallowing in processSnapshot GetDetail - Exit process on HTTP/gRPC server crash; guard gRPC context.Canceled Design-doc alignment fixes (oFEP-0004): - Remove warm-to-all fallback per A4: when fewer SuperPods than the regular target count are available, computeTargets retries with a refreshed capacity view and then records the snapshot FAILED; no plan inflation - Rebuild the load-balancer pool from the configured SuperPod set on every RefreshStorage so an excluded SuperPod returns once its view recovers (the pool previously could only shrink, blocking A4 retry recovery) - Record unplanned snapshots via UpsertDetail(state=FAILED) so task progress counts them as failed instead of in-progress forever - Make SUCCESS terminal in MarkSnapshotFailed (SQL guard state <> SUCCESS): a late failure from a concurrent task must not regress a fully-warmed snapshot - storage-details response covers all N configured SuperPods per D3: missing reports are filled as health=UNAVAILABLE; etcd keys outside the configured set are dropped - Mirror the PGStore UpsertDetail/MarkSnapshotFailed contracts in fakeStore (SUCCESS guard, plan union, warmed-set preservation) so unit tests are faithful to the real store Static-check fixes: - End the GetDetail if/else-if chain with an else clause - Add default clause to the progress-summary switch statement - Document why fakeStore.Close is empty in task manager tests - Replace time.After with an explicitly stopped timer per bounded retry in warmTarget - Use one shared deadline timer for the concurrent-worker wait loop in tests - Check UpsertDetail and CreateTask errors in task manager tests - G.FUN.01: extract pickRegularTargets and sleepOrCancelled helpers from computeTargets so each function has a single purpose and shallow nesting; warmTarget reuses sleepOrCancelled for its retry backoff - G.TYP.09: check map key presence with the comma-ok idiom before reading storage-details test response entries Adds stringSetUnion helper, mock tests, and integration tests for the concurrent UpsertDetail scenario. Also fixes verifyTaskProgress compile error and StaleTaskNotReclaimedWhenFresh zero-timestamp regression. | 1 个月前 |
| feat: 实现沙箱快照预热功能 (oFEP-0004) 为 FluxSandboxController 增加快照预热子系统,支持异步批量预热快照到 SuperPod,并提供任务进度、缓存详情与存储资源查询接口。 主要内容: - 新增 warm 包:任务管理器、PostgreSQL 持久化层、E2B API-Server 客户端、 MoonCake etcd 客户端、负载均衡调度、4 个 RESTful API - 新增 PostgreSQL Schema (0001_warm.sql) 及两表模型 - 集成到 controller:--warm-* flag、生命周期管理与 API 挂载 关键设计: - 任务队列基于 FOR UPDATE SKIP LOCKED 原子领取,stale 超时回收 - 逐目标下发 E2B,warmed_snapshot_id 幂等,集合比较驱动状态机 - 负载均衡器共享游标实现常规镜像跨 SuperPod 轮询分布 - 处理过程心跳刷新 updated_at,防止长任务被重复领取 - 重启恢复跳过已 SUCCESS 快照,不降级状态 - 请求体大小限制、批量查询、错误码校验等健壮性加固 | 1 个月前 |