class DagBuilder {

  public static Dag getInstallationDag(JsonCluster cluster, ClusterRuntime clusterEntity, ClusterStats clusterStats,
      TaskSubmitter submitter, Map<String, JsonObject> chefJsons) throws KaramelException {
    Dag dag = new Dag();
    Map<String, RunRecipeTask> allRecipeTasks = new HashMap<>();
    CookbookCache cache = ClusterDefinitionService.CACHE;
    List<KaramelizedCookbook> kcbs = cache.loadRootKaramelizedCookbooks(cluster);
    machineLevelTasks(cluster, clusterEntity, clusterStats, submitter, dag, kcbs);
    cookbookLevelInstallationTasks(cluster, clusterEntity, clusterStats, chefJsons, submitter, allRecipeTasks, dag,
        kcbs);
    Map<String, Map<String, Task>> rlts = recipeLevelTasks(cluster, clusterEntity, clusterStats, chefJsons, submitter,
        allRecipeTasks, dag, kcbs);
    updateKaramelDependencies(allRecipeTasks, dag, rlts);
    return dag;
  }

}