diff --git a/src/common/compute/backends/gme/metadata.js b/src/common/compute/backends/gme/metadata.js new file mode 100644 index 000000000..ef50ac57f --- /dev/null +++ b/src/common/compute/backends/gme/metadata.js @@ -0,0 +1,9 @@ +/*globals define*/ +define([], function() { + return { + name: 'WebGME Executor Framework', + dashboard: './dashboard/index', + client: './Client', + configStructure: [] + }; +}); diff --git a/src/common/compute/backends/gme/metadata.json b/src/common/compute/backends/gme/metadata.json deleted file mode 100644 index 43ca4a39b..000000000 --- a/src/common/compute/backends/gme/metadata.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "WebGME Executor Framework", - "dashboard": "./dashboard/index", - "client": "./Client", - "configStructure": [] -} diff --git a/src/common/compute/backends/local/metadata.js b/src/common/compute/backends/local/metadata.js new file mode 100644 index 000000000..95d9d4fc7 --- /dev/null +++ b/src/common/compute/backends/local/metadata.js @@ -0,0 +1,9 @@ +/*globals define*/ +define([], function() { + return { + name: 'Server Execution', + dashboard: null, + client: './Client', + configStructure: [] + }; +}); diff --git a/src/common/compute/backends/local/metadata.json b/src/common/compute/backends/local/metadata.json deleted file mode 100644 index 685612247..000000000 --- a/src/common/compute/backends/local/metadata.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "Server Execution", - "dashboard": null, - "client": "./Client", - "configStructure": [] -} diff --git a/src/common/compute/backends/sciserver-compute/metadata.js b/src/common/compute/backends/sciserver-compute/metadata.js new file mode 100644 index 000000000..4e9fd10cb --- /dev/null +++ b/src/common/compute/backends/sciserver-compute/metadata.js @@ -0,0 +1,38 @@ +/*globals define*/ +define([ +], function( +) { + return { + name: 'SciServer Compute', + dashboard: './dashboard/index', + configStructure: [ + { + name: 'username', + displayName: 'Username', + description: 'SciServer username', + value: '', + valueType: 'stringX', + valueItemsURL: '/routers/SciServerAuth', + extraValueItems: [ + { + name: 'Link account...', + type: 'URL', + value: 'https://apps.sciserver.org/login-portal/login?callbackUrl=<%= window.location.origin %>/routers/SciServerAuth/register' + } + ], + readOnly: false, + isAuth: true + }, + { + name: 'computeDomain', + displayName: 'Compute Domain', + description: 'A small job shares resources with up to 4 other jobs and has a max quota for RAM of approx 32GB. A large job runs exclusively and has all CPU cores and RAM available (approx 240GB), however since only one large job will run at a time, there may be a longer wait for the job to start.', + value: 'Small Jobs Domain', + valueItems: [ + 'Small Jobs Domain', + 'Large Jobs Domain' + ] + } + ], + }; +}); diff --git a/src/common/compute/index.js b/src/common/compute/index.js index d5a4dec33..e5c71a183 100644 --- a/src/common/compute/index.js +++ b/src/common/compute/index.js @@ -1,10 +1,11 @@ /*globals define, requirejs */ (function() { const COMPUTE_BACKENDS = ['gme', 'local', 'sciserver-compute']; + const metadataPath = name => `deepforge/compute/backends/${name}/metadata`; define([ 'module', 'deepforge/compute/backends/ComputeBackend', - ].concat(COMPUTE_BACKENDS.map(name => `text!deepforge/compute/backends/${name}/metadata.json`)), + ].concat(COMPUTE_BACKENDS.map(metadataPath)), function( module, ComputeBackend, @@ -44,8 +45,7 @@ throw new Error(`Compute backend not found: ${id}`); } - const relativePath = `backends/${id}/metadata.json`; - const metadata = JSON.parse(requirejs(`text!deepforge/compute/${relativePath}`)); + const metadata = requirejs(metadataPath(id)); metadata.id = id; return metadata; };