Repository: aiidalab/aiidalab-launch (language: python)

Issue:
Feature: extra mounts
Closes #130 

This needs tests and probably more error handling, but I'd like to have some eyes on this early to confirm if I am on the right track here.

CC @csadorf 


Discussion / hints:

Fix patch:
diff --git a/aiidalab_launch/instance.py b/aiidalab_launch/instance.py
index 1c76f2d..fe83d4d 100644
--- a/aiidalab_launch/instance.py
+++ b/aiidalab_launch/instance.py
@@ -128,7 +128,10 @@ def configuration_changes(self) -> Generator[str, None, None]:
 
         try:
             for mount in self._mounts():
-                if docker_mount_for(self.container, mount["Target"]) != mount["Source"]:
+                if (
+                    str(docker_mount_for(self.container, mount["Target"]))
+                    != mount["Source"]
+                ):
                     raise ValueError
         except ValueError:
             yield "Mount configuration has changed."


Test patch:
diff --git a/tests/test_instance.py b/tests/test_instance.py
index c337137..03d2a6d 100644
--- a/tests/test_instance.py
+++ b/tests/test_instance.py
@@ -73,6 +73,7 @@ async def test_instance_home_bind_mount(instance):
     instance.create()
     assert await instance.status() is instance.AiidaLabInstanceStatus.CREATED
     assert instance.profile == Profile.from_container(instance.container)
+    assert not any(instance.configuration_changes())
 
 
 async def test_profile_configuration_changes(instance):