Ejemplo n.º 1
0
 public static void machineLevelTasks(
     JsonCluster cluster,
     ClusterRuntime clusterEntity,
     ClusterStats clusterStats,
     TaskSubmitter submitter,
     Dag dag)
     throws KaramelException {
   Confs confs = Confs.loadKaramelConfs();
   String prepStoragesConf = confs.getProperty(Settings.PREPARE_STORAGES_KEY);
   String vendorPath = UserClusterDataExtractor.makeVendorPath(cluster);
   for (GroupRuntime ge : clusterEntity.getGroups()) {
     for (MachineRuntime me : ge.getMachines()) {
       Provider provider = UserClusterDataExtractor.getGroupProvider(cluster, ge.getName());
       boolean storagePreparation =
           (prepStoragesConf != null
               && prepStoragesConf.equalsIgnoreCase("true")
               && (provider instanceof Ec2));
       if (storagePreparation) {
         String model = ((Ec2) provider).getType();
         InstanceType instanceType = InstanceType.valueByModel(model);
         PrepareStoragesTask st =
             new PrepareStoragesTask(
                 me, clusterStats, submitter, instanceType.getStorageDevices());
         dag.addTask(st);
       }
       AptGetEssentialsTask t1 =
           new AptGetEssentialsTask(me, clusterStats, submitter, storagePreparation);
       InstallBerkshelfTask t2 = new InstallBerkshelfTask(me, clusterStats, submitter);
       MakeSoloRbTask t3 = new MakeSoloRbTask(me, vendorPath, clusterStats, submitter);
       dag.addTask(t1);
       dag.addTask(t2);
       dag.addTask(t3);
     }
   }
 }