Context API¶
Context API allows the user to get information about the resources available to be requested for a session on the CANFAR Science Platform. This information can be used to configure the session to request the appropriate resources for your
Getting Reosources Information¶
Get context information
from skaha.context import Context
context = Context()
context.resources()
{
"defaultCores": 2,
"defaultCoresHeadless": 1,
"availableCores": [1, 2, 4, 8, 16],
"defaultRAM": 16,
"defaultRAMHeadless": 4,
"availableRAM": [1, 2, 4, 8, 16, 32, 64, 128, 192],
"availableGPUs": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ...],
}
Bases: SkahaClient
Get available resources from the skaha server.
Source code in skaha/context.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
resources()
¶
Get available resources from the skaha server.
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
A dictionary of available resources. |
Examples:
>>> from skaha.context import Context
>>> context = Context()
>>> context.resources()
{'defaultCores': 2,
'defaultCoresHeadless': 1,
'availableCores': [1, 2, 4, 8, 16],
'defaultRAM': 16,
'defaultRAMHeadless': 4,
'availableRAM': [1, 2, 4, 8, 16, 32, 64, 128, 192],
'availableGPUs': [1,2,3,...],
}
Source code in skaha/context.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|