Methods
(static) abort(uuid) → {Promise}
- Description:
- Source:
Example
Usage
await Qarnot.tasks.abort('00181edb-f156-4a06-a5af-54d503b5a7a0');
Parameters:
Name |
Type |
Description |
uuid |
String
|
uuid of the task |
Returns:
-
Type
-
Promise
(static) clone() → {Promise.<Object>}
- Description:
- Source:
Examples
Usage
const task = await Qarnot.tasks.clone('3ed6fb06-354c-492f-9897-4d1020316530',
{
"name": "clonedTask"
"tags": [
"t1",
"t2"
],
"constants" : [
{
"key" : "MY_CONSTANT",
"value" : "my value"
}
]
}
});
console.log(task);
Output
{
"uuid": "cddbc5ab-c44d-4c49-9421-0ab795613da7"
}
Returns:
-
Type
-
Promise.<Object>
(static) delete() → {Promise}
- Description:
- Source:
Example
Usage
await Qarnot.tasks.delete('25b48b2e-b43b-4963-bec3-d7d112e58c81');
Returns:
-
Type
-
Promise
(static) get(uuid) → {Promise.<Object>}
- Description:
- Source:
Examples
Usage
const task = await Qarnot.tasks.get('8bc0b16c-6fc3-4ee8-83ef-6c56a7778897');
console.log(task);
Output
{
"uuid": "8bc0b16c-6fc3-4ee8-83ef-6c56a7778897",
"name": "helloworld-withdata",
"shortname": "8bc0b16c-6fc3-4ee8-83ef-6c56a7778897",
"profile": "docker-batch",
"poolUuid": null,
"progress": 100,
"runningInstanceCount": 0,
"runningCoreCount": 0,
"executionTime": "00:00:01",
"wallTime": "00:01:55",
"state": "Success",
"instanceCount": 1,
"creationDate": "2019-06-11T12:59:46Z",
"endDate": "2019-06-11T13:01:42Z",
"resourceBuckets": [
"my-input-bucket"
],
"resultBucket": "my-output-bucket",
"errors": [],
"completedInstances": [],
"status": {
"timestamp": "0001-01-01T00:00:00Z",
"lastUpdateTimestamp": "0001-01-01T00:00:00Z",
"downloadProgress": 0,
"executionProgress": 100,
"uploadProgress": 100,
"instanceCount": 0,
"downloadTime": "00:00:00",
"downloadTimeSec": 0,
"environmentTime": "00:01:45",
"environmentTimeSec": 105,
"executionTime": "00:00:01",
"executionTimeSec": 1,
"executionTimeByCpuModel": [
{
"model": "AMD Ryzen 7 2700X Eight-Core Processor",
"time": 1,
"core": 8
}
],
"executionTimeGhzByCpuModel": [
{
"model": "AMD Ryzen 7 2700X Eight-Core Processor",
"timeGhz": 0.0001258,
"core": 8,
"clockRatio": 0
}
],
"uploadTime": "00:00:03",
"uploadTimeSec": 3,
"wallTime": "00:01:55",
"wallTimeSec": 115,
"succeededRange": "0",
"executedRange": "0",
"failedRange": "",
"startedOnceRange": "0",
"runningInstancesInfo": {
"perRunningInstanceInfo": [],
"snapshotResults": [],
"timestamp": "0001-01-01T00:00:00Z",
"averageFrequencyGHz": 0,
"maxFrequencyGHz": 0,
"minFrequencyGHz": 0,
"averageMaxFrequencyGHz": 0,
"averageCpuUsage": 0,
"clusterPowerIndicator": 1,
"averageMemoryUsage": 0,
"averageNetworkInKbps": 0,
"averageNetworkOutKbps": 0,
"totalNetworkInKbps": 0,
"totalNetworkOutKbps": 0,
"runningCoreCountByCpuModel": []
}
},
"snapshotInterval": 0,
"resultsCount": 1,
"constants": [
{
"key": "DOCKER_CMD",
"value": "sh -c \"cat input.txt | rev > output.txt\""
}
],
"labels": {
"label": "value"
}
"tags": []
}
Parameters:
Name |
Type |
Description |
uuid |
String
|
uuid of the task |
Returns:
-
Type
-
Promise.<Object>
(static) lastStderr(uuid) → {Promise.<String>}
- Description:
- Source:
Examples
Usage
let stderr = await Qarnot.tasks.lastStderr('00181edb-f156-4a06-a5af-54d503b5a7a0');
console.log(stderr);
console.log('===')
//sleep 30
stderr = await Qarnot.tasks.lastStderr('00181edb-f156-4a06-a5af-54d503b5a7a0');
console.log(stderr);
Output
3> stderr from node 3!
===
2> stderr from node 2!
1> stderr from node 1!
0> stderr from node 0!
Parameters:
Name |
Type |
Description |
uuid |
String
|
uuid of the task |
Returns:
-
Type
-
Promise.<String>
(static) lastStdout(uuid) → {Promise.<String>}
- Description:
- Source:
Examples
Usage
let stdout = await Qarnot.tasks.lastStdout('00181edb-f156-4a06-a5af-54d503b5a7a0');
console.log(stdout);
console.log('===')
//sleep 30
stdout = await Qarnot.tasks.lastStdout('00181edb-f156-4a06-a5af-54d503b5a7a0');
console.log(stdout);
Output
3> hello world from node 3!
===
2> hello world from node 2!
1> hello world from node 1!
0> hello world from node 0!
Parameters:
Name |
Type |
Description |
uuid |
String
|
uuid of the task |
Returns:
-
Type
-
Promise.<String>
(static) list() → {Promise.<Array.<Object>>}
- Description:
- Source:
Examples
Usage
const tasks = await Qarnot.tasks.list();
console.log(tasks);
Output
[
{
"uuid": "8bc0b16c-6fc3-4ee8-83ef-6c56a7778897",
"name": "helloworld-withdata",
"shortname": "8bc0b16c-6fc3-4ee8-83ef-6c56a7778897",
"profile": "docker-batch",
"poolUuid": null,
"progress": 100,
"runningInstanceCount": 0,
"runningCoreCount": 0,
"executionTime": "00:00:01",
"wallTime": "00:01:55",
"state": "Success",
"instanceCount": 1,
"creationDate": "2019-06-11T12:59:46Z",
"endDate": "2019-06-11T13:01:42Z",
"resourceBuckets": [
"my-input-bucket"
],
"resultBucket": "my-output-bucket",
"errors": [],
"completedInstances": [],
"status": {
"timestamp": "0001-01-01T00:00:00Z",
"lastUpdateTimestamp": "0001-01-01T00:00:00Z",
"downloadProgress": 0,
"executionProgress": 100,
"uploadProgress": 100,
"instanceCount": 0,
"downloadTime": "00:00:00",
"downloadTimeSec": 0,
"environmentTime": "00:01:45",
"environmentTimeSec": 105,
"executionTime": "00:00:01",
"executionTimeSec": 1,
"executionTimeByCpuModel": [
{
"model": "AMD Ryzen 7 2700X Eight-Core Processor",
"time": 1,
"core": 8
}
],
"executionTimeGhzByCpuModel": [
{
"model": "AMD Ryzen 7 2700X Eight-Core Processor",
"timeGhz": 0.0001258,
"core": 8,
"clockRatio": 0
}
],
"uploadTime": "00:00:03",
"uploadTimeSec": 3,
"wallTime": "00:01:55",
"wallTimeSec": 115,
"succeededRange": "0",
"executedRange": "0",
"failedRange": "",
"startedOnceRange": "0",
"runningInstancesInfo": {
"perRunningInstanceInfo": [],
"snapshotResults": [],
"timestamp": "0001-01-01T00:00:00Z",
"averageFrequencyGHz": 0,
"maxFrequencyGHz": 0,
"minFrequencyGHz": 0,
"averageMaxFrequencyGHz": 0,
"averageCpuUsage": 0,
"clusterPowerIndicator": 1,
"averageMemoryUsage": 0,
"averageNetworkInKbps": 0,
"averageNetworkOutKbps": 0,
"totalNetworkInKbps": 0,
"totalNetworkOutKbps": 0,
"runningCoreCountByCpuModel": []
}
},
"snapshotInterval": 0,
"resultsCount": 1,
"constants": [
{
"key": "DOCKER_CMD",
"value": "sh -c \"cat input.txt | rev > output.txt\""
}
],
"labels": {
"label": "value"
},
"tags": []
}
]
Returns:
List of tasks
-
Type
-
Promise.<Array.<Object>>
(static) paginate() → {Promise.<Array.<Object>>}
- Description:
- Source:
Examples
Usage
const paginate = await Qarnot.tasks.paginate();
console.log(paginate);
Output
[
{
data:
[
{
"Shortname": "3ed6fb06-354c-492f-9897-4d1020316530",
"Name": "test5",
"Profile": "docker-batch",
"Resources": [],
"ResourcesBuckets": [],
"Results": null,
"ResultsBucket": null,
"State": "Success",
"PreviousState": "UploadingResults",
"StateTransitionTime": "2020-06-12T13:01:50Z",
"PreviousStateTransitionTime": "2020-06-12T13:01:44Z",
"LastModified": "2020-06-12T13:01:50Z",
"Errors": [],
"Status": {
"DownloadProgress": 0.0,
"ExecutionProgress": 100.0,
"UploadProgress": 100.0,
"InstanceCount": 0,
"DownloadTimeSec": 0,
"ExecutionTimeSec": 1,
"UploadTimeSec": 1,
"SucceededRange": "0",
"ExecutedRange": "0",
"FailedRange": "",
"RunningInstancesInfo": {
"Timestamp": "0001-01-01T00:00:00Z",
"AverageFrequencyGHz": 0.0,
"MaxFrequencyGHz": 0.0,
"MinFrequencyGHz": 0.0,
"AverageMaxFrequencyGHz": 0.0,
"AverageCpuUsage": 0.0,
"ClusterPowerIndicator": 1.0,
"AverageMemoryUsage": 0.0,
"AverageNetworkInKbps": 0.0,
"AverageNetworkOutKbps": 0.0,
"TotalNetworkInKbps": 0.0,
"TotalNetworkOutKbps": 0.0,
"PerRunningInstanceInfo": []
},
"ExecutionTimeByCpuModel": [
{
"Model": "AMD Ryzen 7 1700X Eight-Core Processor",
"Time": 1,
"Core": 8
}
],
"ExecutionTimeGhzByCpuModel": [
{
"Model": "AMD Ryzen 7 1700X Eight-Core Processor",
"TimeGhz": 0.0002609452,
"Core": 8,
"ClockRatio": 0.0
}
]
},
"CreationDate": "2020-06-12T13:00:09Z",
"ResultsCount": 0,
"Tags": [],
"Constants": {
"DOCKER_REPO": "library/ubuntu",
"DOCKER_TAG": "latest",
"DOCKER_CMD": "ls",
},
"Constraints": {
},
"Labels": {
},
"DependsOn": [],
"SnapshotInterval": 0,
"PoolUuid": "00000000-0000-0000-0000-000000000000",
"Pool": null,
"JobUuid": "00000000-0000-0000-0000-000000000000",
"Job": null,
"Completed": true,
"Executing": false,
"InstanceCount": 1,
"ResultsWhitelist": null,
"ResultsBlacklist": null,
"SnapshotWhitelist": null,
"SnapshotBlacklist": null,
"Instances": [
0
],
"Connection": null,
"Uuid": "3ed6fb06-354c-492f-9897-4d1020316530"
}
],
count: 1,
isTruncated: true,
nextToken: '5ed67ba6d1f1b90d3aff497b'
}
]
Returns:
-
Type
-
Promise.<Array.<Object>>
(static) paginateSummaries() → {Promise.<Array.<Object>>}
- Description:
- Source:
Examples
Usage
const paginate_summaries = await Qarnot.tasks.summaries_pagination();
console.log(paginate_summaries);
Output
[
{
data:
[
{
"Shortname": "3ed6fb06-354c-492f-9897-4d1020316530",
"Name": "test5",
"Profile": "docker-batch",
"Resources": [],
"ResourcesBuckets": [],
"Results": null,
"ResultsBucket": null,
"State": "Success",
"PreviousState": "UploadingResults",
"StateTransitionTime": "2020-06-12T13:01:50Z",
"PreviousStateTransitionTime": "2020-06-12T13:01:44Z",
"LastModified": "2020-06-12T13:01:50Z",
"Errors": [],
"Status": {
"DownloadProgress": 0.0,
"ExecutionProgress": 100.0,
"UploadProgress": 100.0,
"InstanceCount": 0,
"DownloadTimeSec": 0,
"ExecutionTimeSec": 1,
"UploadTimeSec": 1,
"SucceededRange": "0",
"ExecutedRange": "0",
"FailedRange": "",
"RunningInstancesInfo": {
"Timestamp": "0001-01-01T00:00:00Z",
"AverageFrequencyGHz": 0.0,
"MaxFrequencyGHz": 0.0,
"MinFrequencyGHz": 0.0,
"AverageMaxFrequencyGHz": 0.0,
"AverageCpuUsage": 0.0,
"ClusterPowerIndicator": 1.0,
"AverageMemoryUsage": 0.0,
"AverageNetworkInKbps": 0.0,
"AverageNetworkOutKbps": 0.0,
"TotalNetworkInKbps": 0.0,
"TotalNetworkOutKbps": 0.0,
"PerRunningInstanceInfo": []
},
"ExecutionTimeByCpuModel": [
{
"Model": "AMD Ryzen 7 1700X Eight-Core Processor",
"Time": 1,
"Core": 8
}
],
"ExecutionTimeGhzByCpuModel": [
{
"Model": "AMD Ryzen 7 1700X Eight-Core Processor",
"TimeGhz": 0.0002609452,
"Core": 8,
"ClockRatio": 0.0
}
]
},
"CreationDate": "2020-06-12T13:00:09Z",
"ResultsCount": 0,
"Tags": [],
"Constants": {
"DOCKER_REPO": "library/ubuntu",
"DOCKER_TAG": "latest",
"DOCKER_CMD": "ls",
},
"Constraints": {
},
"DependsOn": [],
"SnapshotInterval": 0,
"PoolUuid": "00000000-0000-0000-0000-000000000000",
"Pool": null,
"JobUuid": "00000000-0000-0000-0000-000000000000",
"Job": null,
"Completed": true,
"Executing": false,
"InstanceCount": 1,
"ResultsWhitelist": null,
"ResultsBlacklist": null,
"SnapshotWhitelist": null,
"SnapshotBlacklist": null,
"Instances": [
0
],
"Connection": null,
"Uuid": "3ed6fb06-354c-492f-9897-4d1020316530"
}
],
count: 1,
isTruncated: true,
nextToken: '5ed67ba6d1f1b90d3aff497b'
}
]
Returns:
-
Type
-
Promise.<Array.<Object>>
(static) recover() → {Promise.<Object>}
- Description:
- Source:
Examples
Usage
const task = await Qarnot.tasks.recover('3ed6fb06-354c-492f-9897-4d1020316530',
{
"name": "recoveredTask"
"tags": [
"t1",
"t2"
],
"constants" : [
{
"key" : "MY_CONSTANT",
"value" : "my value"
}
]
}
});
console.log(task);
Output
{
"uuid": "cddbc5ab-c44d-4c49-9421-0ab795613da7"
}
Returns:
-
Type
-
Promise.<Object>
(static) resume() → {Promise.<Object>}
- Description:
- Source:
Examples
Usage
const task = await Qarnot.tasks.resume('3ed6fb06-354c-492f-9897-4d1020316530',
{
"name": "resumedTask"
"tags": [
"t1",
"t2"
],
"constants" : [
{
"key" : "MY_CONSTANT",
"value" : "my value"
}
]
}
});
console.log(task);
Output
{
"uuid": "cddbc5ab-c44d-4c49-9421-0ab795613da7"
}
Returns:
-
Type
-
Promise.<Object>
(static) retry() → {Promise.<Object>}
- Description:
- Source:
Examples
Usage
const task = await Qarnot.tasks.retry('3ed6fb06-354c-492f-9897-4d1020316530',
{
"name": "retriedTask"
"tags": [
"t1",
"t2"
],
"constants" : [
{
"key" : "MY_CONSTANT",
"value" : "my value"
}
]
}
});
console.log(task);
Output
{
"uuid": "cddbc5ab-c44d-4c49-9421-0ab795613da7"
}
Returns:
-
Type
-
Promise.<Object>
(static) run() → {Promise.<Object>}
- Description:
- Source:
Examples
Usage
const task = await Qarnot.tasks.run({
name: 'helloworld',
profile: 'docker-batch',
instanceCount: 4,
constants : [
{
key : 'DOCKER_CMD',
value : 'echo hello world from node ${INSTANCE_ID}!'
}
],
labels: {
label: "value"
}
});
console.log('task:');
console.log(task);
Output
3> hello world from node 3!
2> hello world from node 2!
1> hello world from node 1!
0> hello world from node 0!
task:
{
"uuid": "00181edb-f156-4a06-a5af-54d503b5a7a0",
"name": "helloworld",
"shortname": "00181edb-f156-4a06-a5af-54d503b5a7a0",
"profile": "docker-batch",
"poolUuid": null,
"progress": 100,
"runningInstanceCount": 0,
"runningCoreCount": 0,
"executionTime": "00:00:04",
"wallTime": "00:02:25",
"state": "Success",
"instanceCount": 4,
"creationDate": "2019-06-11T23:17:13Z",
"endDate": "2019-06-11T23:19:39Z",
"resourceBuckets": [],
"resultBucket": null,
"errors": [],
"completedInstances": [
{
"results": null,
"instanceId": 0,
"wallTimeSec": 144.82016,
"execTimeSec": 1,
"execTimeSecGHz": 0,
"peakMemoryMB": 0,
"state": "Success",
"error": null,
"cpuModel": "AMD Ryzen 7 2700X Eight-Core Processor",
"coreCount": 8,
"clockRatio": 0,
"averageGHz": 0
},
{
"results": null,
"instanceId": 1,
"wallTimeSec": 114.001007,
"execTimeSec": 1,
"execTimeSecGHz": 0,
"peakMemoryMB": 0,
"state": "Success",
"error": null,
"cpuModel": "AMD Ryzen 7 2700X Eight-Core Processor",
"coreCount": 8,
"clockRatio": 0,
"averageGHz": 0
},
{
"results": null,
"instanceId": 2,
"wallTimeSec": 103.250336,
"execTimeSec": 1,
"execTimeSecGHz": 0,
"peakMemoryMB": 0,
"state": "Success",
"error": null,
"cpuModel": "AMD Ryzen 7 2700X Eight-Core Processor",
"coreCount": 8,
"clockRatio": 0,
"averageGHz": 0
},
{
"results": null,
"instanceId": 3,
"wallTimeSec": 98.1486,
"execTimeSec": 1,
"execTimeSecGHz": 3.70000029,
"peakMemoryMB": 0,
"state": "Success",
"error": null,
"cpuModel": "AMD Ryzen 7 2700X Eight-Core Processor",
"coreCount": 8,
"clockRatio": 1,
"averageGHz": 3.70000029
}
],
"status": {
"timestamp": "0001-01-01T00:00:00Z",
"lastUpdateTimestamp": "0001-01-01T00:00:00Z",
"downloadProgress": 0,
"executionProgress": 100,
"uploadProgress": 100,
"instanceCount": 0,
"downloadTime": "00:00:00",
"downloadTimeSec": 0,
"environmentTime": "00:06:32",
"environmentTimeSec": 392,
"executionTime": "00:00:04",
"executionTimeSec": 4,
"executionTimeByCpuModel": [
{
"model": "AMD Ryzen 7 2700X Eight-Core Processor",
"time": 4,
"core": 8
}
],
"executionTimeGhzByCpuModel": [
{
"model": "AMD Ryzen 7 2700X Eight-Core Processor",
"timeGhz": 3.70000029,
"core": 8,
"clockRatio": 0.25
}
],
"uploadTime": "00:00:04",
"uploadTimeSec": 4,
"wallTime": "00:02:25",
"wallTimeSec": 145,
"succeededRange": "0-3",
"executedRange": "0-3",
"failedRange": "",
"startedOnceRange": "0-3",
"runningInstancesInfo": {
"perRunningInstanceInfo": [],
"snapshotResults": [],
"timestamp": "0001-01-01T00:00:00Z",
"averageFrequencyGHz": 0,
"maxFrequencyGHz": 0,
"minFrequencyGHz": 0,
"averageMaxFrequencyGHz": 0,
"averageCpuUsage": 0,
"clusterPowerIndicator": 1,
"averageMemoryUsage": 0,
"averageNetworkInKbps": 0,
"averageNetworkOutKbps": 0,
"totalNetworkInKbps": 0,
"totalNetworkOutKbps": 0,
"runningCoreCountByCpuModel": []
}
},
"snapshotInterval": 0,
"resultsCount": 0,
"constants": [
{
"key": "DOCKER_CMD",
"value": "echo hello world from node ${INSTANCE_ID}!"
}
"labels": {
"label": "value"
}
],
"tags": []
}
Returns:
Task description
-
Type
-
Promise.<Object>
(static) snapshot(uuid) → {Promise}
- Description:
- Source:
Example
Usage
await Qarnot.tasks.snapshot('00181edb-f156-4a06-a5af-54d503b5a7a0');
Parameters:
Name |
Type |
Description |
uuid |
String
|
uuid of the task to snapshot |
Returns:
-
Type
-
Promise
(static) stderr(uuid) → {Promise.<String>}
- Description:
- Source:
Examples
Usage
const stderr = await Qarnot.tasks.stderr('00181edb-f156-4a06-a5af-54d503b5a7a0');
console.log(stderr);
Output
3> stderr from node 3!
2> stderr from node 2!
1> stderr from node 1!
0> stderr from node 0!
Parameters:
Name |
Type |
Description |
uuid |
String
|
uuid of the task |
Returns:
-
Type
-
Promise.<String>
(static) stdout(uuid) → {Promise.<String>}
- Description:
- Source:
Examples
Usage
const stdout = await Qarnot.tasks.stdout('00181edb-f156-4a06-a5af-54d503b5a7a0');
console.log(stdout);
Output
3> hello world from node 3!
2> hello world from node 2!
1> hello world from node 1!
0> hello world from node 0!
Parameters:
Name |
Type |
Description |
uuid |
String
|
uuid of the task |
Returns:
-
Type
-
Promise.<String>
(static) submit() → {Promise.<Object>}
- Description:
- Source:
Examples
Usage
const task = await Qarnot.tasks.submit({
name: 'helloworld',
profile: 'docker-batch',
instanceCount: 4,
constants : [
{
key : 'DOCKER_CMD',
value : 'echo hello world from node ${INSTANCE_ID}!'
}
],
tasks: {
label: "value"
}
});
console.log(task);
Output
{
"uuid": "cddbc5ab-c44d-4c49-9421-0ab795613da7"
}
Returns:
-
Type
-
Promise.<Object>
(static) summaries() → {Promise.<Array.<Object>>}
- Description:
- Source:
Examples
Usage
await Qarnot.tasks.summaries();
Output
[
{
"uuid": "8bc0b16c-6fc3-4ee8-83ef-6c56a7778897",
"name": "helloworld-withdata",
"shortname": "8bc0b16c-6fc3-4ee8-83ef-6c56a7778897",
"profile": "docker-batch",
"poolUuid": null,
"progress": 100,
"runningInstanceCount": 0,
"runningCoreCount": 0,
"executionTime": "00:00:01",
"wallTime": "00:01:55",
"state": "Success",
"instanceCount": 1,
"creationDate": "2019-06-11T12:59:46Z",
"endDate": "2019-06-11T13:01:42Z"
}
]
Returns:
Object (see link above)
-
Type
-
Promise.<Array.<Object>>
(static) updateResources(uuid) → {undefined}
- Description:
- Source:
Example
Usage
await Qarnot.task.update_resources('00181edb-f156-4a06-a5af-54d503b5a7a0')
Parameters:
Name |
Type |
Description |
uuid |
String
|
uuid of the task |
Returns:
-
Type
-
undefined