You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@airavata.apache.org by tilaks26 <gi...@git.apache.org> on 2017/09/29 22:24:26 UTC

[GitHub] airavata-php-gateway pull request #70: [AIRAVATA-2521] Ability define gatewa...

GitHub user tilaks26 opened a pull request:

    https://github.com/apache/airavata-php-gateway/pull/70

    [AIRAVATA-2521] Ability define gateway level maximum values for walltime, node and CPU counts

    - Added the maximum allowed values for the nodes, CPU cores and wall time limit to the pga_config.php.template for reference.
    - Modified the createSubmit() and editSubmit() methods in ExperiementController.php to validate the entered values for nodes, CPU cores and wall time limit for a given experiment. If invalid, an appropriate message is returned to the view.
    - Added a new private method - validateQueueData() in ExperiementController.php to perform the validation of the queue values.
    - Modified the getQueueDatafromResourceId() method in ExperiementUtilities.php to compare the queue's maximum values for nodes, CPU cores and wall time limit with that of the gateway's configuration (found in the pga_config.php file)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tilaks26/airavata-php-gateway gateway-level-max-queue-values

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/airavata-php-gateway/pull/70.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #70
    
----
commit d3900b9ab94a9fb5c68d686480429ae003d9a21e
Author: Sneha Tilak <ti...@149-160-247-119.dhcp-bl.indiana.edu>
Date:   2017-09-29T22:15:38Z

    Set the gateway level maximum values for walltime, node and CPU counts

----


---

[GitHub] airavata-php-gateway pull request #70: [AIRAVATA-2521] Ability define gatewa...

Posted by tilaks26 <gi...@git.apache.org>.
Github user tilaks26 commented on a diff in the pull request:

    https://github.com/apache/airavata-php-gateway/pull/70#discussion_r142161589
  
    --- Diff: app/controllers/ExperimentController.php ---
    @@ -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"),
    --- End diff --
    
    Sorry Marcus. I changed this after I tested it on my local machine but I didn’t commit the changes to the PR. Do you want me to do it now?


---

[GitHub] airavata-php-gateway pull request #70: [AIRAVATA-2521] Ability define gatewa...

Posted by machristie <gi...@git.apache.org>.
Github user machristie commented on a diff in the pull request:

    https://github.com/apache/airavata-php-gateway/pull/70#discussion_r142138406
  
    --- Diff: app/controllers/ExperimentController.php ---
    @@ -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");
    --- End diff --
    
    This should redirect to `"experiment/edit"`, not create.


---

[GitHub] airavata-php-gateway pull request #70: [AIRAVATA-2521] Ability define gatewa...

Posted by machristie <gi...@git.apache.org>.
Github user machristie commented on a diff in the pull request:

    https://github.com/apache/airavata-php-gateway/pull/70#discussion_r142139225
  
    --- Diff: 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"];
    --- End diff --
    
    Need to check whether the config value exists first.  It won't exist for most gateways.


---

[GitHub] airavata-php-gateway pull request #70: [AIRAVATA-2521] Ability define gatewa...

Posted by tilaks26 <gi...@git.apache.org>.
Github user tilaks26 commented on a diff in the pull request:

    https://github.com/apache/airavata-php-gateway/pull/70#discussion_r142161831
  
    --- Diff: app/controllers/ExperimentController.php ---
    @@ -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)
    --- End diff --
    
    I changed these too. But didn’t commit the new changes.


---

[GitHub] airavata-php-gateway pull request #70: [AIRAVATA-2521] Ability define gatewa...

Posted by machristie <gi...@git.apache.org>.
Github user machristie commented on a diff in the pull request:

    https://github.com/apache/airavata-php-gateway/pull/70#discussion_r142138718
  
    --- Diff: app/controllers/ExperimentController.php ---
    @@ -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)
    --- End diff --
    
    The array keys don't match. Should be `nodeCount` instead of `validateQueueData`, and `cpuCount` instead of `maxCPUCount`.


---

[GitHub] airavata-php-gateway pull request #70: [AIRAVATA-2521] Ability define gatewa...

Posted by machristie <gi...@git.apache.org>.
Github user machristie commented on a diff in the pull request:

    https://github.com/apache/airavata-php-gateway/pull/70#discussion_r142136729
  
    --- Diff: app/controllers/ExperimentController.php ---
    @@ -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"),
    --- End diff --
    
    I'm pretty sure these aren't the right names for the form fields. Should be `node-count`, `cpu-count` and `walltime-count`. See [experiment-queue-block.blade.php](https://github.com/apache/airavata-php-gateway/blob/develop/app/views/partials/experiment-queue-block.blade.php#L80-L98)


---