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

Add allow_amend, internet and aleph_api parameters to create_program #77

Merged
merged 1 commit into from
Nov 17, 2023
Merged
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
6 changes: 6 additions & 0 deletions src/aleph/sdk/client/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ async def create_program(
vcpus: Optional[int] = None,
timeout_seconds: Optional[float] = None,
persistent: bool = False,
allow_amend: bool = False,
internet: bool = True,
aleph_api: bool = True,
encoding: Encoding = Encoding.zip,
volumes: Optional[List[Mapping]] = None,
subscriptions: Optional[List[Mapping]] = None,
Expand All @@ -335,6 +338,9 @@ async def create_program(
:param vcpus: Number of vCPUs to allocate (Default: 1)
:param timeout_seconds: Timeout in seconds (Default: 30.0)
:param persistent: Whether the program should be persistent or not (Default: False)
:param allow_amend: Whether the deployed VM image may be changed (Default: False)
:param internet: Whether the VM should have internet connectivity. (Default: True)
: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 subscriptions: Patterns of aleph.im messages to forward to the program's event receiver
Expand Down
9 changes: 6 additions & 3 deletions src/aleph/sdk/client/authenticated_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,9 @@ async def create_program(
vcpus: Optional[int] = None,
timeout_seconds: Optional[float] = None,
persistent: bool = False,
allow_amend: bool = False,
internet: bool = True,
aleph_api: bool = True,
encoding: Encoding = Encoding.zip,
volumes: Optional[List[Mapping]] = None,
subscriptions: Optional[List[Mapping]] = None,
Expand Down Expand Up @@ -434,7 +437,7 @@ async def create_program(
content = ProgramContent(
type="vm-function",
address=address,
allow_amend=False,
allow_amend=allow_amend,
code=CodeContent(
encoding=encoding,
entrypoint=entrypoint,
Expand All @@ -444,8 +447,8 @@ async def create_program(
on=triggers,
environment=FunctionEnvironment(
reproducible=False,
internet=True,
aleph_api=True,
internet=internet,
aleph_api=aleph_api,
),
variables=environment_variables,
resources=MachineResources(
Expand Down
Loading