keeper
resource_tracker.keeper
#
Functions:
Name | Description |
---|---|
keeper_request |
Fetch data from a SC Keeper URL with a custom header. |
get_instance_price |
Get the on-demand price for a specific instance type in a region. |
get_recommended_cloud_servers |
Get the cheapest cloud servers for the given resources from Spare Cores. |
keeper_request
#
Fetch data from a SC Keeper URL with a custom header.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path
|
str
|
The path to fetch data from. |
required |
timeout
|
int
|
The timeout for the request. |
2
|
endpoint
|
str
|
The endpoint to fetch data from. |
'https://keeper.sparecores.net'
|
Returns:
Type | Description |
---|---|
Optional[dict]
|
The JSON-decoded response data, or None if an error occurs. |
Source code in resource_tracker/keeper.py
get_instance_price
#
Get the on-demand price for a specific instance type in a region.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vendor_id
|
The ID of the vendor (e.g. "aws", "azure", "gcp") |
required | |
region_id
|
The ID of the region (e.g. "us-east-1", "us-west-2") |
required | |
instance_type
|
The type of instance (e.g. "t3.micro", "m5.large") |
required |
Returns:
Type | Description |
---|---|
Optional[float]
|
The on-demand price for the instance type in the region, or None if no price is found. |
Source code in resource_tracker/keeper.py
get_recommended_cloud_servers
#
Get the cheapest cloud servers for the given resources from Spare Cores.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cpu
|
int
|
The minimum number of vCPUs. |
required |
memory
|
int
|
The minimum amount of memory in MB. |
required |
gpu
|
Optional[int]
|
The minimum number of GPUs. |
None
|
vram
|
Optional[int]
|
The minimum amount of VRAM in GB. |
None
|
n
|
int
|
The number of recommended servers to return. |
10
|
Returns:
Type | Description |
---|---|
List[Dict]
|
A list of recommended server configurations ordered by price. |
References
- https://sparecores.com/servers