airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata-django-portal] 02/02: AIRAVATA-2598 Display max queue settings, validate
Date Thu, 18 Jan 2018 15:13:52 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit d122bd945215d0e6e1eaf56d8dadf5cd7dce7dec
Author: Marcus Christie <machrist@iu.edu>
AuthorDate: Thu Jan 18 10:13:43 2018 -0500

    AIRAVATA-2598 Display max queue settings, validate
---
 .../models/ComputationalResourceSchedulingModel.js |  8 ++-
 django_airavata/apps/workspace/package-lock.json   | 42 ++++++++--------
 django_airavata/apps/workspace/package.json        |  2 +-
 .../components/experiment/QueueSettingsEditor.vue  | 57 ++++++++++++----------
 4 files changed, 59 insertions(+), 50 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 1e17acf..6fda294 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
@@ -20,19 +20,25 @@ export default class ComputationalResourceSchedulingModel extends BaseModel
{
         super(FIELDS, data);
     }
 
-    validate() {
+    validate(queueInfo = {}) {
         const validationResults = {};
         if (this.isEmpty(this.resourceHostId)) {
             validationResults['resourceHostId'] = "Please select a compute resource.";
         }
         if (!(this.nodeCount > 0)) {
             validationResults['nodeCount'] = "Enter a node count greater than 0.";
+        } else if (queueInfo.maxNodes && this.nodeCount > queueInfo.maxNodes)
{
+            validationResults['nodeCount'] = `Enter a node count no greater than ${queueInfo.maxNodes}.`;
         }
         if (!(this.totalCPUCount > 0)) {
             validationResults['totalCPUCount'] = "Enter a core count greater than 0.";
+        } else if (queueInfo.maxProcessors && this.totalCPUCount > queueInfo.maxProcessors)
{
+            validationResults['totalCPUCount'] = `Enter a core count no greater than ${queueInfo.maxProcessors}.`;
         }
         if (!(this.wallTimeLimit > 0)) {
             validationResults['wallTimeLimit'] = "Enter a wall time limit greater than 0.";
+        } else if (queueInfo.maxRunTime && this.wallTimeLimit > queueInfo.maxRunTime)
{
+            validationResults['wallTimeLimit'] = `Enter a wall time limit no greater than
${queueInfo.maxRunTime}.`;
         }
         return validationResults;
     }
diff --git a/django_airavata/apps/workspace/package-lock.json b/django_airavata/apps/workspace/package-lock.json
index 3b7c7dc..c7d7ad0 100644
--- a/django_airavata/apps/workspace/package-lock.json
+++ b/django_airavata/apps/workspace/package-lock.json
@@ -970,14 +970,14 @@
       "integrity": "sha512-DzGtdTlKbrMoGMpz0LigKSqJ+MgtFKxA791PU/q062OlRG0HybNZcTLH7rpDAmLS66Y3esN9yzKHLLbqa5UR3w=="
     },
     "bootstrap-vue": {
-      "version": "1.0.2",
-      "resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-1.0.2.tgz",
-      "integrity": "sha512-jDvCyXsjUTx6mDqrgaM9ZtsBiH6gJ1wCo4FmRr8/Ne03G3qSepKpzuk7rXouzVsSMBXU3mRx/i4UowmRCUW8lg==",
+      "version": "1.4.1",
+      "resolved": "https://registry.npmjs.org/bootstrap-vue/-/bootstrap-vue-1.4.1.tgz",
+      "integrity": "sha512-TXQ28trpKPkdJS/SlcvKOS5DTWxUPkyhGf19urUG1r6Cq6YrzNI+kMipzGpj46XFlYu0WUutzOa9KraYyPLDBQ==",
       "requires": {
         "lodash.startcase": "4.4.0",
         "opencollective": "1.0.3",
-        "popper.js": "1.12.6",
-        "vue-functional-data-merge": "1.0.6"
+        "popper.js": "1.12.9",
+        "vue-functional-data-merge": "2.0.4"
       }
     },
     "brace-expansion": {
@@ -1210,6 +1210,11 @@
         "supports-color": "2.0.0"
       }
     },
+    "chardet": {
+      "version": "0.4.2",
+      "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz",
+      "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I="
+    },
     "chokidar": {
       "version": "1.7.0",
       "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz",
@@ -10913,12 +10918,12 @@
       }
     },
     "external-editor": {
-      "version": "2.0.5",
-      "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.0.5.tgz",
-      "integrity": "sha512-Msjo64WT5W+NhOpQXh0nOHm+n0RfU1QUwDnKYvJ8dEJ8zlwLrqXNTv5mSUTJpepf41PDJGyhueTw2vNZW+Fr/w==",
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.1.0.tgz",
+      "integrity": "sha512-E44iT5QVOUJBKij4IIV3uvxuNlbKS38Tw1HiupxEIHPv9qtC2PrDYohbXV5U+1jnfIXttny8gUhj+oZvflFlzA==",
       "requires": {
+        "chardet": "0.4.2",
         "iconv-lite": "0.4.19",
-        "jschardet": "1.6.0",
         "tmp": "0.0.33"
       }
     },
@@ -12481,7 +12486,7 @@
         "chalk": "1.1.3",
         "cli-cursor": "2.1.0",
         "cli-width": "2.2.0",
-        "external-editor": "2.0.5",
+        "external-editor": "2.1.0",
         "figures": "2.0.0",
         "lodash": "4.17.4",
         "mute-stream": "0.0.7",
@@ -12831,11 +12836,6 @@
         "esprima": "2.7.3"
       }
     },
-    "jschardet": {
-      "version": "1.6.0",
-      "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-1.6.0.tgz",
-      "integrity": "sha512-xYuhvQ7I9PDJIGBWev9xm0+SMSed3ZDBAmvVjbFR1ZRLAF+vlXcQu6cRI9uAlj81rzikElRVteehwV7DuX2ZmQ=="
-    },
     "jsesc": {
       "version": "1.3.0",
       "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz",
@@ -13752,9 +13752,9 @@
       }
     },
     "popper.js": {
-      "version": "1.12.6",
-      "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.12.6.tgz",
-      "integrity": "sha512-wZlMkIJM1hFcM9F7nSrRCbKKfkH0kk/GrCoj3EUoKU8kx9xPtvnOZNHKsQOM12+xqbYv2HeBWI8Y8pxb6vmnRQ=="
+      "version": "1.12.9",
+      "resolved": "https://registry.npmjs.org/popper.js/-/popper.js-1.12.9.tgz",
+      "integrity": "sha1-DfvC3/lsRRuzMu3Pz6r1ZtMx1bM="
     },
     "portfinder": {
       "version": "1.0.13",
@@ -15583,9 +15583,9 @@
       "integrity": "sha512-Au9rf8fPkBulFHfZ406UaQDd1jH9fqGRIM+0IHilrXnJ/0TeeMH4SBkNxWf2dGevl2S3aVeu0E/WklEv0/msag=="
     },
     "vue-functional-data-merge": {
-      "version": "1.0.6",
-      "resolved": "https://registry.npmjs.org/vue-functional-data-merge/-/vue-functional-data-merge-1.0.6.tgz",
-      "integrity": "sha512-wzUHcvLBiVJcDais1HdmFObi2VagMB5jd/dZuacDO0GCdHURxkvPrReaAyAhW/+g29j5gRu0QKP1DH7CaBRwmQ=="
+      "version": "2.0.4",
+      "resolved": "https://registry.npmjs.org/vue-functional-data-merge/-/vue-functional-data-merge-2.0.4.tgz",
+      "integrity": "sha512-Q7OBltO35UEYnRxLcweulhi37/kYVfToqSrsdsbwM5os2DjRB1+k9YKtYcZEdjTUTC+QIqCMjqxggRn1mMoC1w=="
     },
     "vue-hot-reload-api": {
       "version": "2.2.0",
diff --git a/django_airavata/apps/workspace/package.json b/django_airavata/apps/workspace/package.json
index 0b99254..c8d9725 100644
--- a/django_airavata/apps/workspace/package.json
+++ b/django_airavata/apps/workspace/package.json
@@ -11,7 +11,7 @@
   },
   "dependencies": {
     "bootstrap": "^4.0.0-beta.2",
-    "bootstrap-vue": "^1.0.2",
+    "bootstrap-vue": "^1.4.1",
     "django-airavata-api": "file:../api",
     "django-airavata-common-ui": "file:../../static/common",
     "moment": "^2.18.1",
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 c1eca9f..355ec4b 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
@@ -37,58 +37,61 @@
                 <div class="col">
                     <b-form-group label="Select a Queue" label-for="queue"
                         :feedback="getValidationFeedback('queueName')"
-                        :state="getValidationState('queueName')"
-                        :description="queueDescription">
+                        :state="getValidationState('queueName')">
                         <b-form-select id="queue"
                             v-model="localComputationalResourceScheduling.queueName"
                             :options="queueOptions" required
                             @change="queueChanged"
                             :state="getValidationState('queueName')">
                         </b-form-select>
+                        <div slot="description">
+                            {{ selectedQueueDefault.queueDescription }}
+                        </div>
                     </b-form-group>
-                </div>
-            </div>
-            <div class="row">
-                <div class="col">
                     <b-form-group label="Node Count" label-for="node-count"
                         :feedback="getValidationFeedback('nodeCount')"
                         :state="getValidationState('nodeCount')">
                         <b-form-input id="node-count" type="number" min="1"
+                            :max="selectedQueueDefault.maxNodes"
                             v-model="localComputationalResourceScheduling.nodeCount" required
                             @input="emitValueChanged"
                             :state="getValidationState('nodeCount')">
                         </b-form-input>
+                        <div slot="description">
+                            <i class="fa fa-info-circle" aria-hidden="true"></i>
+                            Max Allowed Nodes = {{ selectedQueueDefault.maxNodes }}
+                        </div>
                     </b-form-group>
-                </div>
-            </div>
-            <div class="row">
-                <div class="col">
                     <b-form-group label="Total Core Count" label-for="core-count"
                         :feedback="getValidationFeedback('totalCPUCount')"
                         :state="getValidationState('totalCPUCount')">
                         <b-form-input id="core-count" type="number" min="1"
+                            :max="selectedQueueDefault.maxProcessors"
                             v-model="localComputationalResourceScheduling.totalCPUCount"
required
                             @input="emitValueChanged"
                             :state="getValidationState('totalCPUCount')">
                         </b-form-input>
+                        <div slot="description">
+                            <i class="fa fa-info-circle" aria-hidden="true"></i>
+                            Max Allowed Cores = {{ selectedQueueDefault.maxProcessors }}
+                        </div>
                     </b-form-group>
-                </div>
-            </div>
-            <div class="row">
-                <div class="col">
                     <b-form-group label="Wall Time Limit" label-for="walltime-limit"
                         :feedback="getValidationFeedback('wallTimeLimit')"
                         :state="getValidationState('wallTimeLimit')">
-                        <b-form-input id="walltime-limit" type="number" min="1"
-                            v-model="localComputationalResourceScheduling.wallTimeLimit"
required
-                            @input="emitValueChanged"
-                            :state="getValidationState('wallTimeLimit')">
-                        </b-form-input>
+                        <b-input-group right="minutes">
+                            <b-form-input id="walltime-limit" type="number" min="1"
+                                :max="selectedQueueDefault.maxRunTime"
+                                v-model="localComputationalResourceScheduling.wallTimeLimit"
required
+                                @input="emitValueChanged"
+                                :state="getValidationState('wallTimeLimit')">
+                            </b-form-input>
+                        </b-input-group>
+                        <div slot="description">
+                            <i class="fa fa-info-circle" aria-hidden="true"></i>
+                            Max Allowed Wall Time = {{ selectedQueueDefault.maxRunTime }}
+                        </div>
                     </b-form-group>
-                </div>
-            </div>
-            <div class="row">
-                <div class="col">
                     <div>
                         <i class="fa fa-times text-secondary" aria-hidden="true"></i>
                         <a class="text-secondary" href="#" @click.prevent="showConfiguration
= false">Hide Settings</a>
@@ -120,7 +123,6 @@ export default {
             localComputationalResourceScheduling: this.value.clone(),
             queueDefaults: [],
             showConfiguration: false,
-            queueDescription: null,
         }
     },
     computed: {
@@ -133,6 +135,9 @@ export default {
             });
             return queueOptions;
         },
+        selectedQueueDefault: function() {
+            return this.queueDefaults.find(queue => queue.queueName === this.localComputationalResourceScheduling.queueName);
+        },
     },
     methods: {
         queueChanged: function(queueName) {
@@ -141,7 +146,6 @@ export default {
             this.localComputationalResourceScheduling.totalCPUCount = queueDefault.defaultCPUCount;
             this.localComputationalResourceScheduling.nodeCount = queueDefault.defaultNodeCount;
             this.localComputationalResourceScheduling.wallTimeLimit = queueDefault.defaultWalltime;
-            this.queueDescription = queueDefault.queueDescription;
             this.emitValueChanged();
         },
         emitValueChanged: function() {
@@ -168,12 +172,11 @@ export default {
                     this.localComputationalResourceScheduling.totalCPUCount = defaultQueue.defaultCPUCount;
                     this.localComputationalResourceScheduling.nodeCount = defaultQueue.defaultNodeCount;
                     this.localComputationalResourceScheduling.wallTimeLimit = defaultQueue.defaultWalltime;
-                    this.queueDescription = defaultQueue.queueDescription;
                     this.emitValueChanged();
                 });
         },
         getValidationFeedback: function(properties) {
-            return utils.getProperty(this.localComputationalResourceScheduling.validate(),
properties);
+            return utils.getProperty(this.localComputationalResourceScheduling.validate(this.selectedQueueDefault),
properties);
         },
         getValidationState: function(properties) {
             return this.getValidationFeedback(properties) ? 'invalid' : null;

-- 
To stop receiving notification emails like this one, please contact
"commits@airavata.apache.org" <commits@airavata.apache.org>.

Mime
View raw message