CI/CDにおけるDAGとは?
DAG(directed acyclic graph、有向非巡回グラフ)は、辺に向きがあり巡回を含まないグラフで、辺をたどって出発点に戻ることは決してできません。CI/CDでは、jobがノードで依存関係が辺となるため、DAGは何を並列に実行でき、何が待たなければならないかを定義します。巡回がないことが、有効で有限な実行順序を保証します。
なぜ重要か
パイプラインをDAGとしてモデル化すると、schedulerは依存関係を尊重しつつ独立したjobを同時に実行して並列性を最大化し、実現不可能な構成(巡回)を最初に検出できます。同じ構造は、作業を正しく順序付ける必要があるbuildシステムやworkflowエンジンの基盤にもなっています。
関連する概念
- ノードはjob、辺は依存関係
- 巡回がなければ有効なトポロジカル順序が存在する
- critical pathはその中を通る最長の経路
関連ガイド
What Is the Critical Path in a Pipeline?The critical path is the longest dependent chain of jobs through a pipeline, which sets the minimum possible…
What Is a Fan-In Barrier?A fan-in barrier is a synchronization point where a job waits for all of its parallel upstream jobs to finish…
What Is a Dependency Graph?A dependency graph maps how components or packages depend on one another, used to order builds, detect cycles…