Skip to content

Commit

Permalink
Doc: Add docstring to settings.setup(), .check()
Browse files Browse the repository at this point in the history
  • Loading branch information
hoh authored and olethanh committed Apr 10, 2024
1 parent f096134 commit 6d1482d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/aleph/vm/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ def update(self, **kwargs):
raise ValueError(msg)

def check(self):
"""Check that the settings are valid. Call this method after self.setup()."""
assert Path("/dev/kvm").exists(), "KVM not found on `/dev/kvm`."
assert isfile(self.FIRECRACKER_PATH), f"File not found {self.FIRECRACKER_PATH}"
assert isfile(self.JAILER_PATH), f"File not found {self.JAILER_PATH}"
Expand Down Expand Up @@ -363,6 +364,7 @@ def check(self):
), "Command `qemu-system-x86_64` not found, run `apt install qemu-system-x86`"

def setup(self):
"""Setup the environment defined by the settings. Call this method after loading the settings."""
os.makedirs(self.MESSAGE_CACHE, exist_ok=True)
os.makedirs(self.CODE_CACHE, exist_ok=True)
os.makedirs(self.RUNTIME_CACHE, exist_ok=True)
Expand Down

0 comments on commit 6d1482d

Please sign in to comment.