Methods
(static) abort(uuid) → {Promise}
Abort a task
see: https://computing.qarnot.com/documentation/api/#api-Tasks-Abort_Task
see: https://computing.qarnot.com/documentation/api/#api-Tasks-Abort_Task
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) delete() → {Promise}
Delete a task (abort it if it's running)
see: https://computing.qarnot.com/documentation/api/#api-Tasks-Delete_Task
see: https://computing.qarnot.com/documentation/api/#api-Tasks-Delete_Task
Example
Usage
await Qarnot.tasks.delete('25b48b2e-b43b-4963-bec3-d7d112e58c81');
Returns:
- Type
- Promise
(static) get(uuid) → {Promise.<Object>}
Get informations of the specified task
see: https://computing.qarnot.com/documentation/api/#api-Tasks-Task_Information
see: https://computing.qarnot.com/documentation/api/#api-Tasks-Task_Information
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\""
}
],
"tags": []
}
Parameters:
Name | Type | Description |
---|---|---|
uuid |
String | uuid of the task |
Returns:
- Type
- Promise.<Object>
(static) lastStderr(uuid) → {Promise.<String>}
Error output of the task (can be rotated) since last access
see: https://computing.qarnot.com/documentation/api/#api-Tasks-Last_Task_Std_Err
see: https://computing.qarnot.com/documentation/api/#api-Tasks-Last_Task_Std_Err
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>}
Standard output of the task (can be rotated) since last access.
see: https://computing.qarnot.com/documentation/api/#api-Tasks-Last_Task_Std_Out
see: https://computing.qarnot.com/documentation/api/#api-Tasks-Last_Task_Std_Out
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>>}
List all tasks
see: https://computing.qarnot.com/documentation/api/#api-Tasks-List_Task
see: https://computing.qarnot.com/documentation/api/#api-Tasks-List_Task
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\""
}
],
"tags": []
}
]
Returns:
List of tasks
- Type
- Promise.<Array.<Object>>
(static) run() → {Promise.<Object>}
Create a new task, wait for its completion. stdout&stderr are printed on the fly
see: https://computing.qarnot.com/documentation/api/#api-Tasks-List_Tasks
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}!'
}
]
});
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}!"
}
],
"tags": []
}
Returns:
Task description
- Type
- Promise.<Object>
(static) snapshot(uuid) → {Promise}
Request only one snapshot
see: https://computing.qarnot.com/documentation/api/#api-Tasks-UniqueSnapshot
see: https://computing.qarnot.com/documentation/api/#api-Tasks-UniqueSnapshot
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>}
Error output of the task (can be rotated).
see: https://computing.qarnot.com/documentation/api/#api-Tasks-Task_Std_Err
see: https://computing.qarnot.com/documentation/api/#api-Tasks-Task_Std_Err
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>}
Standard output of the task (can be rotated).
see: https://computing.qarnot.com/documentation/api/#api-Tasks-Task_Std_Out
see: https://computing.qarnot.com/documentation/api/#api-Tasks-Task_Std_Out
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>}
Create a new task, return its uuid
see: https://computing.qarnot.com/documentation/api/#api-Tasks-List_Tasks
see: https://computing.qarnot.com/documentation/api/#api-Tasks-List_Tasks
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}!'
}
]
});
console.log(task);
Output
{
"uuid": "cddbc5ab-c44d-4c49-9421-0ab795613da7"
}
Returns:
- Type
- Promise.<Object>
(static) summaries() → {Promise.<Array.<Object>>}
List a summary of all your tasks
see: https://computing.qarnot.com/documentation/api/#api-Tasks-List_Tasks_Summaries
see: https://computing.qarnot.com/documentation/api/#api-Tasks-List_Tasks_Summaries
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>>