Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task/DES-2609: App Form Updates #1123

Merged
merged 5 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h1>Select an app</h1>
<div ng-if="data.bin" class="app-dropdown">
<p compile="data.bin.description" class="app-form-wrapper" ng-if="data.bin.description"></p>
<div>Select a version of <b>{{data.bin.value.definition.label}}</b> from the dropdown:</div>
<select ng-model="data.selectedApp" ng-options="app.value.definition.label for app in data.bin.applications | orderBy: 'value.definition.label'">
<select ng-model="data.selectedApp" ng-options="app.value.definition.label for app in data.bin.applications | orderBy: 'value.definition.label'" style="color:initial;">
<option value=''disabled selected>-- Please Select --</option>
</select>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<div>
<div class="input-group">
<span class="input-group-btn">
<button ng-click="wantFile($event)" class="btn btn-default" type="button">Select</button>
<button ng-click="wantFile($event)" class="btn btn-default" type="button">Select</button>
</span>
<input type="text" class="form-control" ng-model="data.input" placeholder="{{form.placeholder || 'Click to select input data'}}" />
<input
type="text"
class="form-control"
ng-model="data.input"
placeholder="{{form.placeholder || 'Click Select on the left to choose input data'}}"
/>
</div>
<span class="help-text" ng-if="requesting">
<button type="button" class="btn btn-xs btn-link" ng-click="stopWant($event)">Cancel</button>
Expand Down
39 changes: 16 additions & 23 deletions designsafe/static/scripts/workspace/services/apps-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,57 +206,50 @@ 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(),
maxLength: 64,
};

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)),
minimum: 1,
maximum: Math.floor(app.defaultProcessorsPerNode || 1) / (app.defaultNodeCount || 1),
maximum: Math.floor(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: <code>${Django.user}/archive/jobs/\${YYYY-MM-DD}/\${JOB_NAME}-\${JOB_ID}</code>.`,
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 <code>${Django.user}/archive/jobs/\${YYYY-MM-DD}/\${JOB_NAME}-\${JOB_ID}</code>.`,
type: 'string',
format: 'agaveFile',
'x-schema-form': { placeholder: `${Django.user}/archive/jobs/\${YYYY-MM-DD}/\${JOB_NAME}-\${JOB_ID}` },
Expand Down