Skip to content

Commit 6713f9b

Browse files
committed
Fix: Solved not passing tests and returned value as integer instead of decimal.
1 parent 3e33743 commit 6713f9b

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/aleph/vm/orchestrator/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def get_compatible_gpus() -> list[Any]:
109109
return LAST_AGGREGATE_SETTINGS["compatible_gpus"]
110110

111111

112-
def get_execution_disk_size(message: InstanceContent | ProgramContent) -> Decimal:
112+
def get_execution_disk_size(message: InstanceContent | ProgramContent) -> int:
113113
disk_size_mib = 0
114114

115115
# For Programs the disk size depends on the runtime
@@ -123,4 +123,4 @@ def get_execution_disk_size(message: InstanceContent | ProgramContent) -> Decima
123123
if getattr(volume, "size_mib", None):
124124
disk_size_mib += volume.size_mib
125125

126-
return Decimal(disk_size_mib)
126+
return disk_size_mib

tests/supervisor/test_views.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,11 @@ async def test_v2_executions_list_one_vm(aiohttp_client, mock_app_with_pool, moc
389389
assert await response.json() == {
390390
"decadecadecadecadecadecadecadecadecadecadecadecadecadecadecadeca": {
391391
"networking": {},
392+
"resources": {
393+
"vcpus": 1,
394+
"memory": 256,
395+
"disk_mib": 1000,
396+
},
392397
"status": {
393398
"defined_at": str(execution.times.defined_at),
394399
"preparing_at": None,
@@ -464,6 +469,11 @@ async def test_v2_executions_list_vm_network(aiohttp_client, mocker, mock_app_wi
464469
"ipv6_ip": "fc00:1:2:3:3:deca:deca:dec1",
465470
"mapped_ports": {},
466471
},
472+
"resources": {
473+
"vcpus": 1,
474+
"memory": 256,
475+
"disk_mib": 1000,
476+
},
467477
"status": {
468478
"defined_at": str(execution.times.defined_at),
469479
"preparing_at": None,

0 commit comments

Comments
 (0)