You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2020/06/19 20:36:12 UTC

[airavata-django-portal] 01/02: AIRAVATA-3344 Add physical memory field to queue settings

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit 6b8f66067dc3e2581831dec7a0bfb0f130cf4edb
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Fri Jun 19 16:35:28 2020 -0400

    AIRAVATA-3344 Add physical memory field to queue settings
---
 .../models/ComputationalResourceSchedulingModel.js |  5 +++
 .../components/experiment/QueueSettingsEditor.vue  | 36 ++++++++++++++++++++--
 2 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/django_airavata/apps/api/static/django_airavata_api/js/models/ComputationalResourceSchedulingModel.js b/django_airavata/apps/api/static/django_airavata_api/js/models/ComputationalResourceSchedulingModel.js
index e919f1e..ea4e858 100644
--- a/django_airavata/apps/api/static/django_airavata_api/js/models/ComputationalResourceSchedulingModel.js
+++ b/django_airavata/apps/api/static/django_airavata_api/js/models/ComputationalResourceSchedulingModel.js
@@ -49,6 +49,11 @@ export default class ComputationalResourceSchedulingModel extends BaseModel {
         } else if (queueInfo && queueInfo.maxRunTime && this.wallTimeLimit > queueInfo.maxRunTime) {
             validationResults['wallTimeLimit'] = `Enter a wall time limit no greater than ${queueInfo.maxRunTime}.`;
         }
+        if (!(this.totalPhysicalMemory >= 0)) {
+            validationResults['totalPhysicalMemory'] = "Enter a total physical memory greater than or equal to 0.";
+        } else if (queueInfo && queueInfo.maxMemory && this.totalPhysicalMemory > queueInfo.maxMemory) {
+            validationResults['totalPhysicalMemory'] = `Enter a total physical memory no greater than ${queueInfo.maxMemory}.`;
+        }
         return validationResults;
     }
 }
diff --git a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/QueueSettingsEditor.vue b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/QueueSettingsEditor.vue
index e50a3f0..93d7231 100644
--- a/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/QueueSettingsEditor.vue
+++ b/django_airavata/apps/workspace/static/django_airavata_workspace/js/components/experiment/QueueSettingsEditor.vue
@@ -28,6 +28,10 @@
                   <h3 class="h5 mb-0">{{ data.wallTimeLimit }} minutes</h3>
                   <span class="text-muted text-uppercase">TIME LIMIT</span>
                 </div>
+                <div class="col">
+                  <h3 class="h5 mb-0">{{ data.totalPhysicalMemory }} MB</h3>
+                  <span class="text-muted text-uppercase">PHYSICAL MEMORY</span>
+                </div>
               </div>
             </div>
           </b-link>
@@ -99,12 +103,12 @@
             </div>
           </b-form-group>
           <b-form-group
-            label="Wall Time Limit (in minutes)"
+            label="Wall Time Limit"
             label-for="walltime-limit"
             :invalid-feedback="getValidationFeedback('wallTimeLimit')"
             :state="getValidationState('wallTimeLimit', true)"
           >
-            <b-input-group right="minutes">
+            <b-input-group append="minutes">
               <b-form-input
                 id="walltime-limit"
                 type="number"
@@ -121,6 +125,28 @@
               Max Allowed Wall Time = {{ maxWalltime }} minutes
             </div>
           </b-form-group>
+          <b-form-group
+            label="Total Physical Memory"
+            label-for="total-physical-memory"
+            :invalid-feedback="getValidationFeedback('totalPhysicalMemory')"
+            :state="getValidationState('totalPhysicalMemory', true)"
+          >
+            <b-input-group append="MB">
+              <b-form-input
+                id="total-physical-memory"
+                type="number"
+                min="0"
+                :max="maxPhysicalMemory"
+                v-model="data.totalPhysicalMemory"
+                :state="getValidationState('totalPhysicalMemory', true)"
+              >
+              </b-form-input>
+            </b-input-group>
+            <div slot="description">
+              <i class="fa fa-info-circle" aria-hidden="true"></i>
+              Max Physical Memory = {{ maxPhysicalMemory }} MB
+            </div>
+          </b-form-group>
           <div>
             <a
               class="text-secondary action-link"
@@ -227,6 +253,12 @@ export default {
       }
       return this.selectedQueueDefault.maxRunTime;
     },
+    maxPhysicalMemory: function() {
+      if (!this.selectedQueueDefault) {
+        return 0;
+      }
+      return this.selectedQueueDefault.maxMemory;
+    },
     queueDefaults() {
       return this.appDeploymentQueues
         ? this.appDeploymentQueues