3.1 KiB
3.1 KiB
DAG Planner with Critical-Path Metadata
Module
Orchestrator
Status
IMPLEMENTED
Description
DAG-based job planner that computes critical-path metadata for orchestrator execution plans, enabling dependency-aware scheduling and parallel execution of independent job chains.
Implementation Details
- Modules:
src/Orchestrator/StellaOps.Orchestrator/StellaOps.Orchestrator.Core/Scheduling/,src/Orchestrator/StellaOps.Orchestrator/StellaOps.Orchestrator.WebService/ - Key Classes:
DagPlanner(src/Orchestrator/StellaOps.Orchestrator/StellaOps.Orchestrator.Core/Scheduling/DagPlanner.cs) - computes execution DAGs from job dependency graphs, identifies critical path, and enables parallel scheduling of independent chainsDagEdge(src/Orchestrator/StellaOps.Orchestrator/StellaOps.Orchestrator.Core/Domain/DagEdge.cs) - edge model representing dependencies between jobs in the execution DAGJobScheduler(src/Orchestrator/StellaOps.Orchestrator/StellaOps.Orchestrator.Core/Scheduling/JobScheduler.cs) - schedules jobs based on DAG planner output, respecting dependency orderingJobStateMachine(src/Orchestrator/StellaOps.Orchestrator/StellaOps.Orchestrator.Core/Scheduling/JobStateMachine.cs) - state machine governing job lifecycle transitions within the DAG executionJob(src/Orchestrator/StellaOps.Orchestrator/StellaOps.Orchestrator.Core/Domain/Job.cs) - job entity with status, dependencies, and scheduling metadataJobStatus(src/Orchestrator/StellaOps.Orchestrator/StellaOps.Orchestrator.Core/Domain/JobStatus.cs) - enum defining job lifecycle statesJobHistory(src/Orchestrator/StellaOps.Orchestrator/StellaOps.Orchestrator.Core/Domain/JobHistory.cs) - historical record of job state transitionsDagEndpoints(src/Orchestrator/StellaOps.Orchestrator/StellaOps.Orchestrator.WebService/Endpoints/DagEndpoints.cs) - REST API for querying DAG execution plansDagContracts(src/Orchestrator/StellaOps.Orchestrator/StellaOps.Orchestrator.WebService/Contracts/DagContracts.cs) - API contracts for DAG responses
- Interfaces:
IDagEdgeRepository(src/Orchestrator/StellaOps.Orchestrator/StellaOps.Orchestrator.Infrastructure/Repositories/IDagEdgeRepository.cs) - Source: Feature matrix scan
E2E Test Plan
- Create a DAG with 5 jobs (A->B->C, A->D->E) and verify
DagPlanneridentifies A as the root and C/E as leaves - Verify critical path computation: the longest dependency chain (A->B->C or A->D->E) is marked as the critical path
- Schedule the DAG via
JobSchedulerand verify B and D execute in parallel after A completes - Add a new dependency (D->C) creating a diamond DAG and verify the critical path updates
- Query the DAG via
DagEndpointsand verify the response includes all edges, critical path markers, and parallel groups - Create a cyclic DAG (A->B->A) and verify
DagPlannerrejects it with a cycle detection error - Verify DAG metadata: each job node in the
DagContractsresponse includes estimated duration and dependency count - Schedule a DAG with one failed job and verify
JobStateMachinemarks downstream dependencies as blocked