pools

Namespace

pools

Source:

Methods

(static) checkScalingPoliciesSanity() → {Promise}

Description:
Source:
Example

Usage

const pool = await Qarnot.pools.get('f7cc95a3-7161-485d-ab2b-b13da6c9c0ea')
const policies = {
  "policies": [
    {
      "type": "ManagedTasksQueue",
      "minTotalSlots": 0,
      "maxTotalSlots": 10,
      "minIdleSlots": 1,
      "minIdleTimeSeconds": 90,
      "scalingFactor": 0.5,
      "name": "the-active-policy",
      "enabledPeriods": [
        {
          "type": "Weekly",
          "days": [
            "thursday"
          ],
          "startTimeUtc": "19:30:00",
          "endTimeUtc": "23:59:59",
          "name": "thursday-evening"
        },
        {
          "type": "Weekly",
          "days": [
            "friday"
          ],
          "startTimeUtc": "00:00:00",
          "endTimeUtc": "10:00:00",
          "name": "friday-morning"
        }
      ]
    },
    {
      "type": "Fixed",
      "slotsCount": 19,
      "name": "default-policy",
      "enabledPeriods": [
        {
          "type": "Always",
          "name": "always"
        }
      ]
    }
  ]
}
await Qarnot.pools.check_scaling_policies_sanity(policies);
Returns:
Type
Promise

(static) clone() → {Promise.<Object>}

Description:
Source:
Examples

Usage

const pool = await Qarnot.pools.clone('3ed6fb06-354c-492f-9897-4d1020316530',
  {
    "name": "clonedPool"
    "tags": [
      "t1",
      "t2"
    ],
    "constants" : [
      {
      "key" : "MY_CONSTANT",
      "value" : "my value"
      }
    ]
  }
});
console.log(pool);

Output

{
  "uuid": "cddbc5ab-c44d-4c49-9421-0ab795613da7"
}
Returns:
Type
Promise.<Object>

(static) close() → {Promise}

Description:
Source:
Example

Usage

await Qarnot.pools.close('25b48b2e-b43b-4963-bec3-d7d112e58c81');
Returns:
Type
Promise

(static) create() → {Promise.<Object>}

Description:
Source:
Examples

Usage

const pool = await Qarnot.pools.create({
  name: 'my blend',
  profile: 'blender',
  instanceCount: 4,
  snapshotWhitelist: 'white.*',
  snapshotBlacklist: 'black.*',
  resultsWhitelist: 'white.*',
  resultsBlacklist: 'black.*',
  constants : [
    {
      key : 'BLEND_FILE',
      value :  'final.blend'
    }
  ],
  labels: {
    label1: "value"
  },
  elasticProperty: {
    isElastic: false,
    minTotalSlots: 0,
    maxTotalSlots: 0,
    minIdleSlots: 0,
    resizePeriod: 90,
    rampResizeFactor: 0.2,
    minIdleTimeSeconds: 100
  },
});
console.log(pool)

Output

{ uuid: 'f7cc95a3-7161-485d-ab2b-b13da6c9c0ea' }
Returns:
Type
Promise.<Object>

(static) delete() → {Promise}

Description:
Source:
Example

Usage

await Qarnot.pools.delete('25b48b2e-b43b-4963-bec3-d7d112e58c81');
Returns:
Type
Promise

(static) get(uuid) → {Promise.<Object>}

Description:
Source:
Examples

Usage

const pool = await Qarnot.pools.get('62e80aae-d20a-4608-b873-ec8bff991733');
console.log(pool);

Output

{
   "name": "my-pool",
   "shortname": "62e80aae-d20a-4608-b873-ec8bff991733",
   "creationDate": "2017-11-24T08:52:58Z",
   "constants": [
     {
       "key": "BLEND_FILE",
       "value": "qarnot.blend"
     }
   ],
   "labels": {
     "label1": "value"
    },
   "tags": [],
   "uuid": "62e80aae-d20a-4608-b873-ec8bff991733",
   "instanceCount": 2,
   "profile": "blender",
   "resourceBuckets": [],
   "status": {
   "downloadProgress": 100.0,
   "executionProgress": 0.0,
   "uploadProgress": 0.0,
   "instanceCount": 2,
   "downloadTime": "00:00:00",
   "downloadTimeSec": 0.0,
   "environmentTime": "00:00:00",
   "environmentTimeSec": 0.0,
   "executionTime": "00:37:20",
   "executionTimeSec": 2240.0,
   "uploadTime": "00:00:00",
   "uploadTimeSec": 0.0,
   "wallTime": "00:19:05",
   "wallTimeSec": 1145.0,
   "succeededRange": "",
   "executedRange": "",
   "failedRange": "",
   "startedOnceRange": "0-1",
   "runningInstancesInfo": {
       "perRunningInstanceInfo": [
          {
             "phase": "execution",
             "instanceId": 0,
             "maxFrequencyGHz": 4.0,
             "currentFrequencyGHz": 3900.0,
             "cpuUsage": 0.0,
             "maxMemoryMB": 16384,
             "currentMemoryMB": 0,
             "networkInKbps": 0.0,
             "networkOutKbps": 0.0,
             "progress": 0.0,
             "executionTimeSec": 1132.7,
             "executionTimeGHz": 4368.437,
             "cpuModel": "",
             "activeForwards": [],
             "memoryUsage": 0.0
          },
          {
             "phase": "execution",
             "instanceId": 1,
             "maxFrequencyGHz": 4.0,
             "currentFrequencyGHz": 3900.0,
             "cpuUsage": 0.0,
             "maxMemoryMB": 16384,
             "currentMemoryMB": 0,
             "networkInKbps": 0.0,
             "networkOutKbps": 0.0,
             "progress": 0.0,
             "executionTimeSec": 1132.7,
             "executionTimeGHz": 4368.439,
             "cpuModel": "",
             "activeForwards": [],
             "memoryUsage": 0.0
          }
       ],
       "timestamp": "0001-01-01T00:00:00",
       "averageFrequencyGHz": 3900.0,
       "maxFrequencyGHz": 3900.0,
       "minFrequencyGHz": 3900.0,
       "averageMaxFrequencyGHz": 4.0,
       "averageCpuUsage": 0.0,
       "clusterPowerIndicator": 975.0,
       "averageMemoryUsage": 0.0,
       "averageNetworkInKbps": 0.0,
       "averageNetworkOutKbps": 0.0,
       "totalNetworkInKbps": 0.0,
       "totalNetworkOutKbps": 0.0,
    }
  },
  "state": "FullyExecuting"
}
Parameters:
Name Type Description
uuid String uuid of the pool
Returns:
Type
Promise.<Object>

(static) lastStderr(uuid) → {Promise.<String>}

Description:
Source:
Examples

Usage

let stderr = await Qarnot.pools.lastStderr('00181edb-f156-4a06-a5af-54d503b5a7a0');
console.log(stderr);
console.log('===')
//sleep 30
stderr = await Qarnot.pools.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 pool
Returns:
Type
Promise.<String>

(static) lastStdout(uuid) → {Promise.<String>}

Description:
Source:
Examples

Usage

let stdout = await Qarnot.pools.lastStdout('00181edb-f156-4a06-a5af-54d503b5a7a0');
console.log(stdout);
console.log('===')
//sleep 30
stdout = await Qarnot.pools.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 pool
Returns:
Type
Promise.<String>

(static) list() → {Promise.<Array.<Object>>}

Description:
Source:
Examples

Usage

const pools = await Qarnot.pools.list();
console.log(pools);

Output

[
  {
     "name": "my-pool",
     "shortname": "62e80aae-d20a-4608-b873-ec8bff991733",
     "creationDate": "2017-11-24T08:52:58Z",
     "constants": [
       {
         "key": "BLEND_FILE",
         "value": "qarnot.blend"
       }
     ],
     "labels": {
       "label": "value"
     },
     "tags": [],
     "uuid": "62e80aae-d20a-4608-b873-ec8bff991733",
     "instanceCount": 2,
     "profile": "blender",
     "resourceBuckets": [],
     "status": {
     "downloadProgress": 100.0,
     "executionProgress": 0.0,
     "uploadProgress": 0.0,
     "instanceCount": 2,
     "downloadTime": "00:00:00",
     "downloadTimeSec": 0.0,
     "environmentTime": "00:00:00",
     "environmentTimeSec": 0.0,
     "executionTime": "00:37:20",
     "executionTimeSec": 2240.0,
     "uploadTime": "00:00:00",
     "uploadTimeSec": 0.0,
     "wallTime": "00:19:05",
     "wallTimeSec": 1145.0,
     "succeededRange": "",
     "executedRange": "",
     "failedRange": "",
     "startedOnceRange": "0-1",
     "runningInstancesInfo": {
         "perRunningInstanceInfo": [
            {
               "phase": "execution",
               "instanceId": 0,
               "maxFrequencyGHz": 4.0,
               "currentFrequencyGHz": 3900.0,
               "cpuUsage": 0.0,
               "maxMemoryMB": 16384,
               "currentMemoryMB": 0,
               "networkInKbps": 0.0,
               "networkOutKbps": 0.0,
               "progress": 0.0,
               "executionTimeSec": 1132.7,
               "executionTimeGHz": 4368.437,
               "cpuModel": "",
               "activeForwards": [],
               "memoryUsage": 0.0
            },
            {
               "phase": "execution",
               "instanceId": 1,
               "maxFrequencyGHz": 4.0,
               "currentFrequencyGHz": 3900.0,
               "cpuUsage": 0.0,
               "maxMemoryMB": 16384,
               "currentMemoryMB": 0,
               "networkInKbps": 0.0,
               "networkOutKbps": 0.0,
               "progress": 0.0,
               "executionTimeSec": 1132.7,
               "executionTimeGHz": 4368.439,
               "cpuModel": "",
               "activeForwards": [],
               "memoryUsage": 0.0
            }
         ],
         "timestamp": "0001-01-01T00:00:00",
         "averageFrequencyGHz": 3900.0,
         "maxFrequencyGHz": 3900.0,
         "minFrequencyGHz": 3900.0,
         "averageMaxFrequencyGHz": 4.0,
         "averageCpuUsage": 0.0,
         "clusterPowerIndicator": 975.0,
         "averageMemoryUsage": 0.0,
         "averageNetworkInKbps": 0.0,
         "averageNetworkOutKbps": 0.0,
         "totalNetworkInKbps": 0.0,
         "totalNetworkOutKbps": 0.0,
      }
    },
    "state": "FullyExecuting"
  }
]
Returns:
Type
Promise.<Array.<Object>>

(static) paginate() → {Promise.<Array.<Object>>}

Description:
Source:
Examples

Usage

const paginate = await Qarnot.pools.paginate();
console.log(paginate);

Output

[
   {
      data: [
        {
          previousState: 'Submitted',
          stateTransitionTime: '2020-06-02T16:18:08Z',
          previousStateTransitionTime: '2020-06-02T16:17:42Z',
          lastModified: '2020-06-02T17:39:06Z',
          elasticProperty: [Object],
          preparationTask: null,
          constants: [],
          labels: {},
          tags: [],
          errors: [],
          resourceBuckets: [],
          status: null,
          uuid: 'c6f24494-6068-460d-bb3c-c75b08f94e4e',
          name: 'sample17-pool-docker-init-command',
          shortname: 'c6f24494-6068-460d-bb3c-c75b08f94e4e',
          profile: 'docker-batch',
          state: 'PendingDelete',
          instanceCount: 1,
          creationDate: '2020-06-02T16:17:41Z',
          endDate: '0001-01-01T00:00:00Z',
          runningInstanceCount: null,
          runningCoreCount: null,
          executionTime: null,
          wallTime: null
        }
      ],
      count: 1,
      isTruncated: true,
      nextToken: '5ed67ba6d1f1b90d3aff497b'
   }
]
Returns:
Type
Promise.<Array.<Object>>

(static) paginateSummaries() → {Promise.<Array.<Object>>}

Description:
Source:
Examples

Usage

const summaries_paginate = await Qarnot.pools.summaries_paginate();
console.log(summaries_paginate);

Output

[
   {
      data: [
        {
          previousState: 'Submitted',
          stateTransitionTime: '2020-06-02T16:18:08Z',
          previousStateTransitionTime: '2020-06-02T16:17:42Z',
          lastModified: '2020-06-02T17:39:06Z',
          elasticProperty: [Object],
          preparationTask: null,
          constants: [],
          tags: [],
          errors: [],
          resourceBuckets: [],
          status: null,
          uuid: 'c6f24494-6068-460d-bb3c-c75b08f94e4e',
          name: 'sample17-pool-docker-init-command',
          shortname: 'c6f24494-6068-460d-bb3c-c75b08f94e4e',
          profile: 'docker-batch',
          state: 'PendingDelete',
          instanceCount: 1,
          creationDate: '2020-06-02T16:17:41Z',
          endDate: '0001-01-01T00:00:00Z',
          runningInstanceCount: null,
          runningCoreCount: null,
          executionTime: null,
          wallTime: null
        }
      ],
      count: 1,
      isTruncated: true,
      nextToken: '5ed67ba6d1f1b90d3aff497b'
   }
]
Returns:
Type
Promise.<Array.<Object>>

(static) stderr(uuid) → {Promise.<String>}

Description:
Source:
Examples

Usage

const stderr = await Qarnot.pools.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 pool
Returns:
Type
Promise.<String>

(static) stdout(uuid) → {Promise.<String>}

Description:
Source:
Examples

Usage

const stdout = await Qarnot.pools.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 pool
Returns:
Type
Promise.<String>

(static) summaries() → {Promise.<Array.<Object>>}

Description:
Source:
Examples

Usage

const summaries = await Qarnot.pools.summaries();
console.log(summaries);

Output

[
   {
      "name": "my-pool",
      "shortname": "62e80aae-d20a-4608-b873-ec8bff991733",
      "creationDate": "2017-11-24T08:52:58Z",
      "uuid": "62e80aae-d20a-4608-b873-ec8bff991733",
      "instanceCount": 2,
      "profile": "blender",
      "state": "FullyExecuting"
  }
]
Returns:
Type
Promise.<Array.<Object>>

(static) update() → {Promise}

Description:
Source:
Example

Usage

const pool = await Qarnot.pools.get('f7cc95a3-7161-485d-ab2b-b13da6c9c0ea')
pool.elasticProperty.maxTotalSlots = 100;
await Qarnot.pools.update('f7cc95a3-7161-485d-ab2b-b13da6c9c0ea', pool);
Returns:
Type
Promise

(static) updateResources() → {undefined}

Description:
Source:
Example

Usage

await Qarnot.pools.updateResources('f7cc95a3-7161-485d-ab2b-b13da6c9c0ea')
Returns:
Type
undefined

(static) updateResources(uuid) → {undefined}

Description:
Source:
Example

Usage

await Qarnot.pools.update_resources('00181edb-f156-4a06-a5af-54d503b5a7a0')
Parameters:
Name Type Description
uuid String uuid of the pool
Returns:
Type
undefined

(static) updateScalingPolicies(uuid) → {Promise}

Description:
Source:
Example

Usage

const pool = await Qarnot.pools.get('f7cc95a3-7161-485d-ab2b-b13da6c9c0ea')
const policies = {
  "policies": [
    {
      "type": "ManagedTasksQueue",
      "minTotalSlots": 0,
      "maxTotalSlots": 10,
      "minIdleSlots": 1,
      "minIdleTimeSeconds": 90,
      "scalingFactor": 0.5,
      "name": "the-active-policy",
      "enabledPeriods": [
        {
          "type": "Weekly",
          "days": [
            "thursday"
          ],
          "startTimeUtc": "19:30:00",
          "endTimeUtc": "23:59:59",
          "name": "thursday-evening"
        },
        {
          "type": "Weekly",
          "days": [
            "friday"
          ],
          "startTimeUtc": "00:00:00",
          "endTimeUtc": "10:00:00",
          "name": "friday-morning"
        }
      ]
    },
    {
      "type": "Fixed",
      "slotsCount": 19,
      "name": "default-policy",
      "enabledPeriods": [
        {
          "type": "Always",
          "name": "always"
        }
      ]
    }
  ]
}
await Qarnot.pools.update_scaling_policies('f7cc95a3-7161-485d-ab2b-b13da6c9c0ea', policies);
Parameters:
Name Type Description
uuid String uuid of the pool
Returns:
Type
Promise