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
Discover lambda runtime executor using plugins #7034
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some nits, otherwise LGTM 👍
localstack/services/awslambda/invocation/runtime_executor_plugin.py
Outdated
Show resolved
Hide resolved
localstack/services/awslambda/invocation/runtime_executor_plugin.py
Outdated
Show resolved
Hide resolved
localstack/services/awslambda/invocation/runtime_executor_plugin.py
Outdated
Show resolved
Hide resolved
localstack/services/awslambda/invocation/runtime_executor_plugin.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good to me! The plugin should move into its own module though (see explanation in the comments).
localstack/services/awslambda/invocation/runtime_executor_plugin.py
Outdated
Show resolved
Hide resolved
localstack/services/awslambda/invocation/runtime_executor_plugin.py
Outdated
Show resolved
Hide resolved
…ntime executor plugin def to own plugins file
@@ -0,0 +1,12 @@ | |||
from localstack.services.awslambda.invocation.runtime_executor import RuntimeExecutorPlugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're still importing this entire import path when we start localstack. which includes the lambda API, and everything under localstack.services.awslambda.invocation.lambda_models
.
could we just move the RuntimeExecutorPlugin
class here as well, to make sure we have no other imports?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you are of course right. My assumption as that runtime_executor would not import anything as well, but of course it does for the types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great now! plugins ftw
Description
The lambda runtime executor class can now be configured and is loadable using the plux plugin mechanism.
Also introduced an abc to specify the interface for runtime executors.
Introduced configuration options
LAMBDA_RUNTIME_EXECUTOR
: Specify the runtime executor using its plugin name. Will make it possible to switch to another executor (like kubernetes or static executor) specified as plugins.