Enhance GPU flavor scanning and update documentation
- Introduced SCAN_POOLS configuration to specify pools for GPU flavor scanning. - Updated the `flavors` command to scan specified pools and list available GPU flavors based on `FLAVOR_PREFERENCE`. - Revised CLI documentation to reflect changes in the `flavors` command behavior. - Enhanced decision documentation to include details about GPU pool scanning. - Updated setup instructions to guide users on selecting appropriate GPU pools.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
from gpu_rent.pools import PoolGpuOffer, format_pool_scan
|
||||
|
||||
|
||||
def test_format_pool_scan_recommends_first_hit():
|
||||
from gpu_rent.inventory import FlavorInfo
|
||||
|
||||
offers = [
|
||||
PoolGpuOffer(region="ru-7", multizone=False, gpu_labels_found=[], matched=[], gpu_types=[]),
|
||||
PoolGpuOffer(
|
||||
region="ru-6",
|
||||
multizone=True,
|
||||
gpu_labels_found=["4090-24", "4090-48"],
|
||||
gpu_types=["4090", "H200"],
|
||||
matched=[
|
||||
FlavorInfo("1", "GL-4090", 4, 16384, False, {}, "4090-24"),
|
||||
],
|
||||
),
|
||||
]
|
||||
text = "\n".join(format_pool_scan(offers, ("4090-24", "4090-48")))
|
||||
assert "ru-6" in text and "multizone" in text
|
||||
assert "типы:" in text
|
||||
assert "рекомендация: OS_REGION_NAME=ru-6" in text
|
||||
Reference in New Issue
Block a user