airavata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AIRAVATA-2521) Ability define gateway level maximum values for walltime, node and CPU counts
Date Tue, 07 Nov 2017 20:23:00 GMT

    [ https://issues.apache.org/jira/browse/AIRAVATA-2521?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16242812#comment-16242812
] 

ASF GitHub Bot commented on AIRAVATA-2521:
------------------------------------------

machristie closed pull request #70: [AIRAVATA-2521] Ability define gateway level maximum values
for walltime, node and CPU counts
URL: https://github.com/apache/airavata-php-gateway/pull/70
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/app/config/pga_config.php.template b/app/config/pga_config.php.template
index 654a1ed58..495c98c97 100644
--- a/app/config/pga_config.php.template
+++ b/app/config/pga_config.php.template
@@ -180,6 +180,21 @@ return array(
         'wall-time-limit' => '30',
 
         /**
+         * Max node count
+         */
+        'max-node-count' => '4',
+
+        /**
+         * Max total core count
+         */
+        'max-total-cpu-count' => '96',
+
+        /**
+         * Max wall time limit
+         */
+        'max-wall-time-limit' => '120',
+
+        /**
          * Enable app-catalog cache
          */
         'enable-app-catalog-cache' => true,
diff --git a/app/controllers/ExperimentController.php b/app/controllers/ExperimentController.php
index 131fa1d7a..5660a366c 100755
--- a/app/controllers/ExperimentController.php
+++ b/app/controllers/ExperimentController.php
@@ -55,7 +55,6 @@ public function createSubmit()
                 "wallTimeLimit" => $wallTimeLimit
             );
 
-
             $experimentInputs = array(
                 "disabled" => ' disabled',
                 "experimentName" => $_POST['experiment-name'],
@@ -94,7 +93,17 @@ public function createSubmit()
 
         } else if (isset($_POST['save']) || isset($_POST['launch'])) {
             try {
-                $expId = ExperimentUtilities::create_experiment();
+                $computeResourceId = Input::get("crId");
+                //Validate entered queue details
+                $queueValues = array("queueName" => Input::get("queue-name"),
+                    "nodeCount" => Input::get("nodeCount"),
+                    "cpuCount" => Input::get("cpuCount"),
+                    "wallTimeLimit" => Input::get("wallTimeLimit")
+                );
+                if($this->validateQueueData($computeResourceId, $queueValues))
+                    $expId = ExperimentUtilities::create_experiment();
+                else
+                    Redirect::to("experiment/create")->with("error-message", "Validate
the number f nodes, CPUs and the wall time limit");
             } catch (Exception $ex) {
                 Log::error("Failed to create experiment!");
                 Log::error($ex);
@@ -396,7 +405,17 @@ public function editSubmit()
     {
         $experiment = ExperimentUtilities::get_experiment(Input::get('expId')); // update
local experiment variable
         try {
-            $updatedExperiment = ExperimentUtilities::apply_changes_to_experiment($experiment,
Input::all());
+            $computeResourceId = Input::get("crId");
+            //Validate entered queue details
+            $queueValues = array("queueName" => Input::get("queue-name"),
+                "nodeCount" => Input::get("nodeCount"),
+                "cpuCount" => Input::get("cpuCount"),
+                "wallTimeLimit" => Input::get("wallTimeLimit")
+            );
+            if($this->validateQueueData($computeResourceId, $queueValues))
+                $updatedExperiment = ExperimentUtilities::apply_changes_to_experiment($experiment,
Input::all());
+            else
+                Redirect::to("experiment/create")->with("error-message", "Validate the
number of nodes, CPUs and the wall time limit");
         } catch (Exception $ex) {
             $errMessage = "Failed to update experiment: " . $ex->getMessage();
             Log::error($errMessage);
@@ -590,6 +609,21 @@ private function getAllowedFileSize()
         }
         return $allowedFileSize;
     }
+
+    private function validateQueueData($computeResourceId, $queue)
+    {
+        $queues = ExperimentUtilities::getQueueDatafromResourceId($computeResourceId);
+        $queueName = $queue['queueName'];
+
+        foreach($queues as $aQueue){
+            if($aQueue->queueName == $queueName) {
+                if($queue['validateQueueData'] <= $aQueue->maxNodes && $queue['maxCPUCount']
<= $aQueue->maxProcessors && $queue['wallTimeLimit'] <= $aQueue->maxRunTime)
+                    return true;
+            }
+        }
+
+        return false;
+    }
 }
 
 ?>
diff --git a/app/libraries/ExperimentUtilities.php b/app/libraries/ExperimentUtilities.php
index 9424893ea..f3c96ce0d 100755
--- a/app/libraries/ExperimentUtilities.php
+++ b/app/libraries/ExperimentUtilities.php
@@ -1422,7 +1422,25 @@ public static function get_transfer_details($experimentId)
     public static function getQueueDatafromResourceId($crId)
     {
         $resourceObject = Airavata::getComputeResource(Session::get('authz-token'), $crId);
-        return $resourceObject->batchQueues;
+        $queues =  $resourceObject->batchQueues;
+
+        //Defining maximum allowed value for queue resources
+        $maxNodeCount = Config::get('pga_config.airavata')["max-node-count"];
+        $maxCPUCount = Config::get('pga_config.airavata')["max-total-cpu-count"];
+        $maxWallTimeLimit = Config::get('pga_config.airavata')["max-wall-time-limit"];
+
+        foreach($queues as $aQueue){
+            if($aQueue->maxNodes > $maxNodeCount){
+                $aQueue->maxNodes = $maxNodeCount;
+            }
+            if($aQueue->maxProcessors > $maxCPUCount){
+                $aQueue->maxProcessors = $maxCPUCount;
+            }
+            if($aQueue->maxRunTime > $maxWallTimeLimit){
+                $aQueue->maxRunTime = $maxWallTimeLimit;
+            }
+        }
+        return $queues;
     }
 
     /**


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Ability define gateway level maximum values for walltime, node and CPU counts
> -----------------------------------------------------------------------------
>
>                 Key: AIRAVATA-2521
>                 URL: https://issues.apache.org/jira/browse/AIRAVATA-2521
>             Project: Airavata
>          Issue Type: New Feature
>          Components: PGA PHP Web Gateway
>    Affects Versions: 0.18
>            Reporter: Eroma
>            Assignee: Marcus Christie
>
> Currently at SciGaP level (common and applicable for all the gateways) can provide maximum
values for node, CPUs and walltime. At individual gateway level these values cannot be exceeded
at job submission. 
> The new requirement is to have maximum values set at gateway level, so users cannot exceed
at job submissions. When defining these values at gateway level, should not be able to go
above the SciGaP level maximum values. Only applicable for that particular gateway. The values
should be applicable at create, edit and clone experiment.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message