From 2b7f85936ca77097846d1a0d1cef8e567e7d9864 Mon Sep 17 00:00:00 2001 From: Sal Tijerina Date: Wed, 8 Nov 2023 14:46:43 -0600 Subject: [PATCH 1/3] app form updates: fix validation, max values, default values, formatting and text --- .../controllers/application-add.js | 2 +- .../workspace/controllers/application-form.js | 12 +++--- .../html/directives/agave-file-picker.html | 9 +++- .../workspace/services/apps-service.js | 41 ++++++++----------- 4 files changed, 31 insertions(+), 33 deletions(-) diff --git a/designsafe/static/scripts/applications/controllers/application-add.js b/designsafe/static/scripts/applications/controllers/application-add.js index 32202e626..fa08cc169 100644 --- a/designsafe/static/scripts/applications/controllers/application-add.js +++ b/designsafe/static/scripts/applications/controllers/application-add.js @@ -270,7 +270,7 @@ export function applicationAddCtrl(window, angular, $, _) { }, 'defaultProcessorsPerNode': { 'type': 'integer', - 'description': 'Default number of processors per node to be used when running this app if no processor count is given in the job request', + 'description': 'Total number of processors across all nodes to be used when running this app if no processor count is given in the job request', 'maxLength': 12, 'title': 'Default processor count', 'x-schema-form': { diff --git a/designsafe/static/scripts/workspace/controllers/application-form.js b/designsafe/static/scripts/workspace/controllers/application-form.js index 51b4bcf13..38504f276 100644 --- a/designsafe/static/scripts/workspace/controllers/application-form.js +++ b/designsafe/static/scripts/workspace/controllers/application-form.js @@ -123,16 +123,16 @@ export default function ApplicationFormCtrl($scope, $rootScope, $localStorage, $ let items = []; if ($scope.form.schema.properties.inputs) { items.push('inputs'); + $scope.form.form.push({ + type: 'fieldset', + readonly: readOnly, + title: 'Inputs', + items: items, + }); } if ($scope.form.schema.properties.parameters) { items.push('parameters'); } - $scope.form.form.push({ - type: 'fieldset', - readonly: readOnly, - title: 'Inputs', - items: items, - }); /* job details */ items = []; diff --git a/designsafe/static/scripts/workspace/html/directives/agave-file-picker.html b/designsafe/static/scripts/workspace/html/directives/agave-file-picker.html index a7b80aca7..ad68eb238 100644 --- a/designsafe/static/scripts/workspace/html/directives/agave-file-picker.html +++ b/designsafe/static/scripts/workspace/html/directives/agave-file-picker.html @@ -1,9 +1,14 @@
- + - +
diff --git a/designsafe/static/scripts/workspace/services/apps-service.js b/designsafe/static/scripts/workspace/services/apps-service.js index f7aea0213..73f9f28cd 100644 --- a/designsafe/static/scripts/workspace/services/apps-service.js +++ b/designsafe/static/scripts/workspace/services/apps-service.js @@ -206,21 +206,21 @@ export function appsService($http, $q, $translate, Django) { return regStr; } - let maxQueueRunTime = app.defaultQueue ? app.exec_sys.queues.find((q) => q.name === app.defaultQueue).maxRequestedTime : app.exec_sys.queues.find((q) => q.default === true).maxRequestedTime; + let defaultQueue = app.defaultQueue ? app.exec_sys.queues.find((q) => q.name === app.defaultQueue) : app.exec_sys.queues.find((q) => q.default === true); schema.properties.maxRunTime = { title: 'Maximum job runtime', - description: `In HH:MM:SS format. The maximum time you expect this job to run for. After this amount of time your job will be killed by the job scheduler. Shorter run times result in shorter queue wait times. Maximum possible time is ${maxQueueRunTime} (hrs:min:sec).`, + description: `In HH:MM:SS format. The maximum time you expect this job to run for. After this amount of time your job will be killed by the job scheduler. Shorter run times result in shorter queue wait times. Maximum possible time is ${defaultQueue.maxRequestedTime} (hrs:min:sec).`, type: 'string', - pattern: createMaxRunTimeRegex(maxQueueRunTime), - validationMessage: `Must be in format HH:MM:SS and be less than ${maxQueueRunTime} (hrs:min:sec).`, + pattern: createMaxRunTimeRegex(defaultQueue.maxRequestedTime), + validationMessage: `Must be in format HH:MM:SS and be less than ${defaultQueue.maxRequestedTime} (hrs:min:sec).`, required: true, - 'x-schema-form': { placeholder: app.defaultMaxRunTime || '06:00:00' }, + default: app.defaultMaxRunTime || '02:00:00' }; schema.properties.name = { title: 'Job name', - description: 'A recognizable name for this job.', + description: 'A recognizable name for this job. Make this descriptive if you submit many jobs.', type: 'string', required: true, default: app.id + '_' + this.getDateString(), @@ -228,35 +228,28 @@ export function appsService($http, $q, $translate, Django) { }; schema.properties.nodeCount = { - title: 'Node Count', - description: `Number of requested process nodes for the job. Default number of nodes is ${app.defaultNodeCount}.`, + title: 'Number of Nodes', + description: `Number of requested process nodes.`, type: 'integer', - enum: Array.from(Array(12).keys()).map((i) => i + 1), default: app.defaultNodeCount, - 'x-schema-form': { - type: 'select', - titleMap: _.map(Array.from(Array(12).keys()).map((i) => i + 1), function(val) { - return { - value: val, - name: val, - }; - }), - }, + minimum: 1, + maximum: defaultQueue.maxNodes, + required: true }; schema.properties.processorsPerNode = { title: 'Processors Per Node', - description: `Number of processors (cores) per node for the job. e.g. A selection of 16 processors per node along with 4 nodes - will result in 4 nodes with 16 processors each, 64 processors total. Default number of processors per node is ${Math.floor(app.defaultProcessorsPerNode || 1) / (app.defaultNodeCount || 1)}.`, + description: `Number of processors (cores) per node.`, type: 'integer', - default: Math.floor((app.defaultProcessorsPerNode || 1) / (app.defaultNodeCount || 1)), + default: app.defaultProcessorsOnEachNode || Math.floor((app.defaultProcessorsPerNode || 1) / (app.defaultNodeCount || 1)), minimum: 1, - maximum: Math.floor(app.defaultProcessorsPerNode || 1) / (app.defaultNodeCount || 1), + maximum: defaultQueue.maxProcessorsPerNode / defaultQueue.maxNodes, + required: true }; schema.properties.archivePath = { - title: 'Job output archive location (optional)', - description: `Specify a location where the job output should be archived. By default, job output will be archived at: ${Django.user}/archive/jobs/\${YYYY-MM-DD}/\${JOB_NAME}-\${JOB_ID}.`, + title: 'Job output archive location', + description: `All job output data will be archived here after job completion. If no path is specifed, job output will be archived to your My Data directory at ${Django.user}/archive/jobs/\${YYYY-MM-DD}/\${JOB_NAME}-\${JOB_ID}.`, type: 'string', format: 'agaveFile', 'x-schema-form': { placeholder: `${Django.user}/archive/jobs/\${YYYY-MM-DD}/\${JOB_NAME}-\${JOB_ID}` }, From 788d2f005bf29cfc3c9a9c617cfd22ec4c38b404 Mon Sep 17 00:00:00 2001 From: Sal Tijerina Date: Thu, 9 Nov 2023 11:11:31 -0600 Subject: [PATCH 2/3] fix processorsPerNode validation --- designsafe/static/scripts/workspace/services/apps-service.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designsafe/static/scripts/workspace/services/apps-service.js b/designsafe/static/scripts/workspace/services/apps-service.js index 73f9f28cd..b5db17eef 100644 --- a/designsafe/static/scripts/workspace/services/apps-service.js +++ b/designsafe/static/scripts/workspace/services/apps-service.js @@ -241,9 +241,9 @@ export function appsService($http, $q, $translate, Django) { title: 'Processors Per Node', description: `Number of processors (cores) per node.`, type: 'integer', - default: app.defaultProcessorsOnEachNode || Math.floor((app.defaultProcessorsPerNode || 1) / (app.defaultNodeCount || 1)), + default: Math.floor((app.defaultProcessorsPerNode || 1) / (app.defaultNodeCount || 1)), minimum: 1, - maximum: defaultQueue.maxProcessorsPerNode / defaultQueue.maxNodes, + maximum: Math.floor(defaultQueue.maxProcessorsPerNode / defaultQueue.maxNodes), required: true }; From baae9d80dccaa48037aa2e3be01e0682253243eb Mon Sep 17 00:00:00 2001 From: Jake Rosenberg Date: Thu, 9 Nov 2023 16:16:37 -0600 Subject: [PATCH 3/3] fix dark mode display for app version selector --- designsafe/static/scripts/workspace/html/application-form.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designsafe/static/scripts/workspace/html/application-form.html b/designsafe/static/scripts/workspace/html/application-form.html index f72fa929f..54c248267 100644 --- a/designsafe/static/scripts/workspace/html/application-form.html +++ b/designsafe/static/scripts/workspace/html/application-form.html @@ -12,7 +12,7 @@

Select an app

Select a version of {{data.bin.value.definition.label}} from the dropdown:
-