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:
@@ -33,6 +33,7 @@ from gpu_rent.inventory import (
|
||||
resolve_flavor,
|
||||
)
|
||||
from gpu_rent.ux import print_up_preview
|
||||
from gpu_rent.pools import best_offer, format_pool_scan, scan_pools
|
||||
from gpu_rent.lock import SessionLock
|
||||
from gpu_rent.os_client import (
|
||||
KEYPAIR_NAME,
|
||||
@@ -172,6 +173,21 @@ def cmd_up(
|
||||
vtype = pick_volume_type(list(iter_volume_types(conn)), cfg.gpu_rent_az)
|
||||
spot = cfg.default_spot and not no_spot
|
||||
|
||||
try:
|
||||
offers = scan_pools(cfg)
|
||||
for line in format_pool_scan(offers, cfg.flavor_preference):
|
||||
log(line)
|
||||
best = best_offer(offers)
|
||||
if best and best.region != cfg.os_region_name:
|
||||
log(
|
||||
f"! сейчас OS_REGION_NAME={cfg.os_region_name}, "
|
||||
f"а предпочтение лучше закрывается в {best.region} — "
|
||||
f"поставь OS_REGION_NAME={best.region} и GPU_RENT_AZ={best.region}a "
|
||||
f"в .env (диски ещё не созданы) и повтори up"
|
||||
)
|
||||
except Exception as exc:
|
||||
log(f"скан пулов: {exc}")
|
||||
|
||||
print_up_preview(cfg, flavors, picked=picked, spot=spot, log=log)
|
||||
|
||||
prompt = (
|
||||
|
||||
Reference in New Issue
Block a user