Skip to content

Commit

Permalink
Fix: Qemu was not the default hypervisor for instances.
Browse files Browse the repository at this point in the history
  • Loading branch information
hoh committed Jun 21, 2024
1 parent 2a50be6 commit de6a6aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/aleph/sdk/client/authenticated_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,15 +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=InstanceEnvironment(
internet=internet,
aleph_api=aleph_api,
hypervisor=hypervisor,
hypervisor=selected_hypervisor,
),
variables=environment_variables,
resources=MachineResources(
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_asynchronous.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit de6a6aa

Please sign in to comment.