コード例 #1
0
ファイル: setup_sc.php プロジェクト: AdamDS/GenomeVIP
 $size = $_POST['size'];
 $v_db = array();
 $volspec = array();
 if (isset($_POST['awsinfovol'])) {
     $v_db = json_decode($_POST['awsinfovol'], true);
     $volspec = json_decode($_POST['awsvolspec']);
 }
 // Get key name and common name
 $p = parse_ini_file($tmp_sc, true);
 foreach (array_keys($p) as $i) {
     if (preg_match("/^key/", $i) > 0) {
         $a = preg_split('/\\s+/', $i);
         $keyname = $a[1];
     }
 }
 $tmp = getawstypes($types_dict);
 foreach ($types_dict as $sc_type => $info) {
     if ($type == $sc_type) {
         $clustbasename = $info['name'];
         $odp = $info['odp'];
         break;
     }
 }
 $clust_tag = generateRandomString(4);
 $real_cluster = $clustbasename . "_" . $clust_tag;
 // Proposed configuration
 $buffer0 = array();
 array_push($buffer0, "\n");
 array_push($buffer0, "[cluster {$real_cluster}]\n");
 array_push($buffer0, "KEYNAME = {$keyname}\n");
 array_push($buffer0, "CLUSTER_SIZE = {$size}\n");
コード例 #2
0
ファイル: resources2.php プロジェクト: AdamDS/GenomeVIP
         case 0:
             // aws
             $tmp = getid($cmd, $results, $scconf);
             break;
         case 1:
             // local
             $results[0] = "local";
     }
 } elseif ($cmd == "cluster") {
     switch ($tgt) {
         case 0:
             // aws
             // get fully configured sc clusters
             // $tmp = getid2($cmd, $known, $scconf);
             // get known cluster types
             $tmp = getawstypes($types);
             $clustdb = array();
             $k = 0;
             foreach ($types as $sc_type => $info) {
                 $myresults[$k++] = array('ec2' => $sc_type, 'vcpu' => $info['vcpu'], 'ecpu' => $info['ecpu'], 'mem' => $info['mem'], 'name' => $info['name'], 'odp' => $info['odp']);
                 $clustdb[$sc_type] = $info['name'];
             }
             usort($myresults, function ($item1, $item2) {
                 return $item1['mem'] - $item2['mem'];
             });
             // Cluster
             $cluster = "<div class='tdindents'><table id='clusttab' class='clusttab'><tr><th>Select</th><th>Type</th><th>n(VCPU)</th><th>n(ECPU)</th><th>Memory(GB)</th></tr>";
             for ($k = 0; $k < count($myresults); $k++) {
                 $cluster .= "<tr><td align='center'><input type='radio' name='clusters' value='" . $myresults[$k]['ec2'] . "'/></td>";
                 $cluster .= "<td align='center'>" . $myresults[$k]['name'] . "</td>";
                 $cluster .= "<td align='center'>" . $myresults[$k]['vcpu'] . "</td>";