From 3122f606ed88bb0a7d21c1c991d2911681f0a3eb Mon Sep 17 00:00:00 2001 From: ajin Date: Wed, 10 Apr 2024 15:20:48 +0200 Subject: [PATCH 1/2] Feat: The max size of an instance for PAYG model is too low The PAYG model only allows VMs below 100 Gib. This change will allow bigger VMs (up to 1 TB) being eligible for PAYG model. Solution: Adjust the max size of Persistent Volume to 1TB instead of 100 Gib Same for the Ephemeral volume now its limit is 10GB --- aleph_message/models/execution/volume.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aleph_message/models/execution/volume.py b/aleph_message/models/execution/volume.py index 6102fba..58d655b 100644 --- a/aleph_message/models/execution/volume.py +++ b/aleph_message/models/execution/volume.py @@ -32,7 +32,7 @@ def is_read_only(self): class EphemeralVolumeSize(ConstrainedInt): gt = 0 - le = 1000 # Limit to 1 GiB + le = gigabyte_to_mebibyte(10) # Limit to 10 GB strict = True @@ -60,8 +60,8 @@ class VolumePersistence(str, Enum): class PersistentVolumeSizeMib(ConstrainedInt): gt = 0 - le = gigabyte_to_mebibyte(Gigabytes(100)) - strict = True # Limit to 100 GiB + le = gigabyte_to_mebibyte(Gigabytes(1_000)) + strict = True # Limit to 1 TB class PersistentVolume(AbstractVolume): From 92df358e0dcfe0f33a081e9ade353b82853b03bb Mon Sep 17 00:00:00 2001 From: ajin Date: Wed, 10 Apr 2024 15:32:27 +0200 Subject: [PATCH 2/2] Fix: mypy failed because of invalid type value Mypy failed because a value should be convert to Gigabytes before using the function gigabyte_to_megabyte. Solution: Convert the number to Gigabytes before using the function --- aleph_message/models/execution/volume.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aleph_message/models/execution/volume.py b/aleph_message/models/execution/volume.py index 58d655b..0c5713a 100644 --- a/aleph_message/models/execution/volume.py +++ b/aleph_message/models/execution/volume.py @@ -32,7 +32,7 @@ def is_read_only(self): class EphemeralVolumeSize(ConstrainedInt): gt = 0 - le = gigabyte_to_mebibyte(10) # Limit to 10 GB + le = gigabyte_to_mebibyte(Gigabytes(10)) # Limit to 10 GB strict = True