Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ async def execute(enclave_name: str) -> bool:

enclave = enclaves[enclave_name]
print(f"Requesting shutdown from enclave: {enclave_name}")
shutdown_result = shutdown(enclave.cid)
shutdown_result = await shutdown(enclave.cid)
print(f"Enclave shut down: {shutdown_result}")
return shutdown_result
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _create_run_enclave_command(enclave_name: str, memory_mb: int) -> List[str]:
f"{TEE_CPU_COUNT}",
"--memory",
f"{memory_mb}",
"--debug-mode",
# "--debug-mode",
"--eif-path",
f"{enclave_name}.eif",
]
Expand Down
13 changes: 10 additions & 3 deletions verified-inference/host/api/repository/vsock_repository.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import errno
import socket
from enum import Enum
from typing import Optional
Expand All @@ -22,9 +23,15 @@ async def request_attestation(enclave_cid: int) -> str:


async def shutdown(enclave_cid: int) -> bool:
response = _send_request(
enclave_cid, VsockRequestType.SHUTDOWN, receive_response=True
)
try:
response = _send_request(
enclave_cid, VsockRequestType.SHUTDOWN, receive_response=True
)
except OSError as e:
if e.errno == errno.ENOTCONN:
# The enclave closed the connection, which is expected
return True
return False
if response is None:
raise Exception("No response received from shutdown request")
return True
Expand Down
2 changes: 1 addition & 1 deletion verified-inference/host/api/service/tee/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TeeTerminateRequest(BaseModel):


class TeeTerminateResponse(BaseModel):
result: Dict = Field(description="Termination result")
result: bool = Field(description="Termination result")


class TeeGetEnclaveResponse(BaseModel):
Expand Down
Loading