Skip to content

Commit

Permalink
Revert "Fix: max value of PersistentVolumeSizeMib to 512 GB (#112)"
Browse files Browse the repository at this point in the history
This reverts commit 66b53cf.
  • Loading branch information
nesitor authored Oct 31, 2024
1 parent 66b53cf commit 81e2092
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion aleph_message/models/execution/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RootfsVolume(HashableModel):
persistence: VolumePersistence
# Use the same size constraint as persistent volumes for now
size_mib: int = Field(
gt=-1, le=gigabyte_to_mebibyte(Gigabytes(512)), strict=True # Limit to 1GiB
gt=-1, le=gigabyte_to_mebibyte(Gigabytes(100)), strict=True # Limit to 1GiB
)
forgotten_by: Optional[List[str]] = None

Expand Down
2 changes: 1 addition & 1 deletion aleph_message/models/execution/volume.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class PersistentVolume(AbstractVolume):
persistence: Optional[VolumePersistence] = None
name: Optional[str] = None
size_mib: int = Field(
gt=0, le=gigabyte_to_mebibyte(Gigabytes(512)), strict=True # Limit to 512GiB
gt=0, le=gigabyte_to_mebibyte(Gigabytes(100)), strict=True # Limit to 100GiB
)

def is_read_only(self):
Expand Down
6 changes: 3 additions & 3 deletions aleph_message/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,10 @@ def test_volume_size_constraints():
# A ValidationError should be raised if the size negative
with pytest.raises(ValidationError):
_ = create_test_rootfs(size_mib=-1)
size_mib_rootfs: Mebibytes = gigabyte_to_mebibyte(Gigabytes(512))
# A size of 512 GiB should be allowed
size_mib_rootfs: Mebibytes = gigabyte_to_mebibyte(Gigabytes(100))
# A size of 100GiB should be allowed
_ = create_test_rootfs(size_mib=size_mib_rootfs)
# A ValidationError should be raised if the size is greater than 512 GiB
# A ValidationError should be raised if the size is greater than 100GiB
with pytest.raises(ValidationError):
_ = create_test_rootfs(size_mib=size_mib_rootfs + 1)

Expand Down

0 comments on commit 81e2092

Please sign in to comment.