Skip to content

Commit fa7b6a6

Browse files
committed
fix: Make it running (part 1)
1 parent 813c313 commit fa7b6a6

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/ai/backend/manager/api/etcd.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ async def get_resource_slots(request: web.Request) -> web.Response:
9090
log.info("ETCD.GET_RESOURCE_SLOTS ()")
9191
root_ctx: RootContext = request.app["_root.context"]
9292
known_slots = await root_ctx.config_provider.legacy_etcd_config_loader.get_resource_slots()
93-
return web.json_response(known_slots, status=HTTPStatus.OK)
93+
serializable_known_slots = {str(k): v.value for k, v in known_slots.items()}
94+
return web.json_response(serializable_known_slots, status=HTTPStatus.OK)
9495

9596

9697
@check_api_params(

src/ai/backend/manager/api/service.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from collections.abc import Iterable, Sequence
44
from dataclasses import dataclass
55
from datetime import datetime
6-
from decimal import Decimal
76
from http import HTTPStatus
87
from typing import TYPE_CHECKING, Any, Optional, Self
98

@@ -30,7 +29,6 @@
3029
from ai.backend.common.types import (
3130
MODEL_SERVICE_RUNTIME_PROFILES,
3231
AccessKey,
33-
BinarySize,
3432
ClusterMode,
3533
ResourceSlot,
3634
RuntimeVariant,
@@ -375,11 +373,11 @@ class ServiceConfigModel(LegacyBaseRequestModel):
375373
)
376374
resources: ResourceSlot = Field(
377375
examples=[
378-
ResourceSlot({
379-
"cpu": Decimal(4),
380-
"mem": Decimal(BinarySize.from_str("32g")),
381-
"cuda.shares": Decimal("2.5"),
382-
})
376+
{
377+
"cpu": 4,
378+
"mem": "32g",
379+
"cuda.shares": "2.5",
380+
}
383381
]
384382
)
385383
resource_opts: dict[str, str | int | bool] = Field(examples=[{"shmem": "2g"}], default={})

0 commit comments

Comments
 (0)