Skip to content

Commit db52fe7

Browse files
committed
Fix formatting and interface issues
1 parent 0693f70 commit db52fe7

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/aleph/sdk/client/abstract.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from aleph_message.status import MessageStatus
2727

2828
from ..query.filters import MessageFilter, PostFilter
29-
from ..query.params import VmParams
3029
from ..query.responses import PostsResponse
3130
from ..types import GenericMessage, StorageEnum
3231
from ..utils import Writable
@@ -368,6 +367,7 @@ async def create_instance(
368367
aleph_api: bool = True,
369368
encoding: Encoding = Encoding.zip,
370369
volumes: Optional[List[Mapping]] = None,
370+
volume_persistence: str = "host",
371371
ssh_keys: Optional[List[str]] = None,
372372
metadata: Optional[Mapping[str, Any]] = None,
373373
) -> Tuple[AlephMessage, MessageStatus]:
@@ -390,6 +390,7 @@ async def create_instance(
390390
:param aleph_api: Whether the VM needs access to Aleph messages API (Default: True)
391391
:param encoding: Encoding to use (Default: Encoding.zip)
392392
:param volumes: Volumes to mount
393+
:param volume_persistence: Where volumes are persisted, can be "host" or "store", meaning distributed across Aleph.im (Default: "host")
393394
:param ssh_keys: SSH keys to authorize access to the VM
394395
:param metadata: Metadata to attach to the message
395396
"""

src/aleph/sdk/client/authenticated_http.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@
1313
AlephMessage,
1414
ForgetContent,
1515
ForgetMessage,
16+
InstanceContent,
17+
InstanceMessage,
1618
ItemType,
1719
MessageType,
1820
PostContent,
1921
PostMessage,
2022
ProgramContent,
2123
ProgramMessage,
2224
StoreContent,
23-
StoreMessage, InstanceMessage, InstanceContent,
25+
StoreMessage,
2426
)
2527
from aleph_message.models.execution.base import Encoding
2628
from aleph_message.models.execution.environment import (
@@ -35,7 +37,6 @@
3537

3638
from ..conf import settings
3739
from ..exceptions import BroadcastError, InvalidMessageError
38-
from ..query.params import VmParams
3940
from ..types import Account, StorageEnum
4041
from .abstract import AuthenticatedAlephClient
4142
from .http import AlephHttpClient
@@ -465,9 +466,7 @@ async def create_program(
465466
if runtime == settings.DEFAULT_RUNTIME_ID
466467
else "",
467468
),
468-
volumes=[
469-
MachineVolume.parse_obj(volume) for volume in volumes
470-
],
469+
volumes=[MachineVolume.parse_obj(volume) for volume in volumes],
471470
time=time.time(),
472471
metadata=metadata,
473472
)
@@ -539,9 +538,7 @@ async def create_instance(
539538
if rootfs == settings.DEFAULT_RUNTIME_ID
540539
else "",
541540
),
542-
volumes=[
543-
MachineVolume.parse_obj(volume) for volume in volumes
544-
],
541+
volumes=[MachineVolume.parse_obj(volume) for volume in volumes],
545542
time=time.time(),
546543
authorized_keys=ssh_keys,
547544
metadata=metadata,

tests/unit/test_asynchronous.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
from aleph_message.models import (
66
AggregateMessage,
77
ForgetMessage,
8+
InstanceMessage,
89
PostMessage,
910
ProgramMessage,
10-
StoreMessage, InstanceMessage,
11+
StoreMessage,
1112
)
1213
from aleph_message.status import MessageStatus
1314

0 commit comments

Comments
 (0)