diff --git a/pyproject.toml b/pyproject.toml index 8a70e9c8..bd4ce56c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ classifiers = [ ] dependencies = [ "aiohttp>=3.8.3", - "aleph-message~=0.4.4", + "aleph-message>=0.4.7", "coincurve; python_version<\"3.11\"", "coincurve>=19.0.0; python_version>=\"3.11\"", "eth_abi>=4.0.0; python_version>=\"3.11\"", diff --git a/src/aleph/sdk/client/authenticated_http.py b/src/aleph/sdk/client/authenticated_http.py index 60d42b2b..6d44b526 100644 --- a/src/aleph/sdk/client/authenticated_http.py +++ b/src/aleph/sdk/client/authenticated_http.py @@ -30,6 +30,7 @@ from aleph_message.models.execution.environment import ( FunctionEnvironment, HypervisorType, + InstanceEnvironment, MachineResources, ) from aleph_message.models.execution.instance import RootfsVolume @@ -534,16 +535,17 @@ async def create_instance( timeout_seconds = timeout_seconds or settings.DEFAULT_VM_TIMEOUT payment = payment or Payment(chain=Chain.ETH, type=PaymentType.hold) - hypervisor = hypervisor or HypervisorType.firecracker + + # Default to the QEMU hypervisor for instances. + selected_hypervisor: HypervisorType = hypervisor or HypervisorType.qemu content = InstanceContent( address=address, allow_amend=allow_amend, - environment=FunctionEnvironment( - reproducible=False, + environment=InstanceEnvironment( internet=internet, aleph_api=aleph_api, - hypervisor=hypervisor, + hypervisor=selected_hypervisor, ), variables=environment_variables, resources=MachineResources( diff --git a/tests/unit/test_asynchronous.py b/tests/unit/test_asynchronous.py index 0fa0df38..0f909408 100644 --- a/tests/unit/test_asynchronous.py +++ b/tests/unit/test_asynchronous.py @@ -157,7 +157,7 @@ async def test_create_instance_no_hypervisor(mock_session_with_post_success): hypervisor=None, ) - assert instance_message.content.environment.hypervisor == HypervisorType.firecracker + assert instance_message.content.environment.hypervisor == HypervisorType.qemu assert mock_session_with_post_success.http_session.post.assert_called_once assert isinstance(instance_message, InstanceMessage)