Skip to content

Commit

Permalink
Fix formatting and interface issues
Browse files Browse the repository at this point in the history
  • Loading branch information
MHHukiewitz committed Nov 14, 2023
1 parent 0693f70 commit db52fe7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/aleph/sdk/client/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from aleph_message.status import MessageStatus

from ..query.filters import MessageFilter, PostFilter
from ..query.params import VmParams
from ..query.responses import PostsResponse
from ..types import GenericMessage, StorageEnum
from ..utils import Writable
Expand Down Expand Up @@ -368,6 +367,7 @@ async def create_instance(
aleph_api: bool = True,
encoding: Encoding = Encoding.zip,
volumes: Optional[List[Mapping]] = None,
volume_persistence: str = "host",
ssh_keys: Optional[List[str]] = None,
metadata: Optional[Mapping[str, Any]] = None,
) -> Tuple[AlephMessage, MessageStatus]:
Expand All @@ -390,6 +390,7 @@ async def create_instance(
:param aleph_api: Whether the VM needs access to Aleph messages API (Default: True)
:param encoding: Encoding to use (Default: Encoding.zip)
:param volumes: Volumes to mount
:param volume_persistence: Where volumes are persisted, can be "host" or "store", meaning distributed across Aleph.im (Default: "host")
:param ssh_keys: SSH keys to authorize access to the VM
:param metadata: Metadata to attach to the message
"""
Expand Down
13 changes: 5 additions & 8 deletions src/aleph/sdk/client/authenticated_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
AlephMessage,
ForgetContent,
ForgetMessage,
InstanceContent,
InstanceMessage,
ItemType,
MessageType,
PostContent,
PostMessage,
ProgramContent,
ProgramMessage,
StoreContent,
StoreMessage, InstanceMessage, InstanceContent,
StoreMessage,
)
from aleph_message.models.execution.base import Encoding
from aleph_message.models.execution.environment import (
Expand All @@ -35,7 +37,6 @@

from ..conf import settings
from ..exceptions import BroadcastError, InvalidMessageError
from ..query.params import VmParams
from ..types import Account, StorageEnum
from .abstract import AuthenticatedAlephClient
from .http import AlephHttpClient
Expand Down Expand Up @@ -465,9 +466,7 @@ async def create_program(
if runtime == settings.DEFAULT_RUNTIME_ID
else "",
),
volumes=[
MachineVolume.parse_obj(volume) for volume in volumes
],
volumes=[MachineVolume.parse_obj(volume) for volume in volumes],
time=time.time(),
metadata=metadata,
)
Expand Down Expand Up @@ -539,9 +538,7 @@ async def create_instance(
if rootfs == settings.DEFAULT_RUNTIME_ID
else "",
),
volumes=[
MachineVolume.parse_obj(volume) for volume in volumes
],
volumes=[MachineVolume.parse_obj(volume) for volume in volumes],
time=time.time(),
authorized_keys=ssh_keys,
metadata=metadata,
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_asynchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
from aleph_message.models import (
AggregateMessage,
ForgetMessage,
InstanceMessage,
PostMessage,
ProgramMessage,
StoreMessage, InstanceMessage,
StoreMessage,
)
from aleph_message.status import MessageStatus

Expand Down

0 comments on commit db52fe7

Please sign in to comment.