Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Fix: max value of PersistentVolumeSizeMib to 512 GB" #113

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading