Skip to main content

prefect_aws.microvm.server

HTTP server for the AWS Lambda MicroVM lifecycle hooks.

Classes

LifecycleHookServer

Serves the MicroVM lifecycle hooks and hands the first valid /run request to the thread that calls wait_for_run_request. Hooks are accepted both at /<hook> and at /aws/lambda-microvms/runtime/v1/<hook>. Methods:

claim_run

Return True for the first /run request and False for every later one.

process_request

process_request_thread

server_bind

stop_serving

Stop accepting hook requests and wait up to timeout seconds for the requests in progress to finish, so that no handler thread holds a lock when the process forks. Requests still in progress after timeout are logged and left running. Args:
  • timeout: The longest time to wait for requests in progress, in seconds.

submit_run

Pass a parsed /run request, or the reason it was rejected, to wait_for_run_request.

wait_for_run_request

Block until the first /run request has been answered, then return it.

LifecycleHookHandler

Request handler for LifecycleHookServer. Methods:

do_GET

do_POST

log_message