-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
remove install dependency on localstack_client #8307
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
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.
Nice set of changes, kudos for tackling this cleanup @alexrashed ! 🧹 Added two clarification questions at this point.
Overall, I'm super happy that we're getting rid of localstack-client
🚀 and it looks good to me in general, but will let @thrau do the detailed review/signoff.. 👍
localstack/utils/bootstrap.py
Outdated
@@ -213,7 +214,13 @@ def get_enabled_apis() -> Set[str]: | |||
|
|||
The result is cached, so it's safe to call. Clear the cache with get_enabled_apis.cache_clear(). | |||
""" | |||
return resolve_apis(config.parse_service_ports().keys()) | |||
services = os.environ.get("SERVICES", "").strip() |
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.
I guess we still need to split the string here? (similar to what we had in parse_service_ports()
before)
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.
Good point. We would not support the different service ports anyway, but I re-added the parsing (but the ports will just be discarded).
localstack/config.py
Outdated
@@ -1016,6 +1014,44 @@ def get_gateway_listen(gateway_listen: str) -> List[HostAndPort]: | |||
# Whether to return and parse access key ids starting with an "A", like on AWS | |||
PARITY_AWS_ACCESS_KEY_ID = is_env_true("PARITY_AWS_ACCESS_KEY_ID") | |||
|
|||
# List of services supported by LocalStack | |||
SUPPORTED_SERVICES = [ |
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.
Wondering if we should enumerate the list of services explicitly here - would be nice if we can somehow integrate this with the service plugin mechanism (or even enumerate the services from botocore directly). (maybe @thrau has some good ideas here..?)
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.
I thought about this, but the problem is that this is already used when populating the service specific configs (<service>_PROVIDER_OVERRIDE
and others) and this list is actually used in controlling the services which should be loaded. That made it a bit too risky for me in the first iteration...
But I am happy for any suggestions and would love to get rid of this list all together!
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.
Might this be a way forward? 5766efb
- the
populate_config_env_var_names
is mostly used for choosing which env vars should be handed to the container. here it makes sense to not use the service plugin manager yet, since this is called in theconfig.py
. however, i think it would be OK to be a bit more permissive, and just use a heuristic based on the key syntax. worst case the container sees some variables it doesn't need. i feel this is an acceptable trade off if it means we don't need to maintain a list of supported services. - The
get_enabled_apis
control path is only used when already starting the infra andEAGER_SERVICE_LOADING
is set to 1, where we've already calledSERVICE_PLUGINS.list_available()
before, so this seems like a no-brainer
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.
Great! Thanks a lot for the commit. I just directly cherry-picked it from your branch.
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.
Overall the changes look good to me. Quickly tested with the legacy s3 and lambda providers and they still seem to work 👍 I agree with Waldemar that it would be better to use this opportunity to get rid of a static list of services. We don't really need it and if we merge it now it's just going to stick around.
I made a suggestion of how to proceed in an inline comment.
a485f50
to
41c12d7
Compare
I re-added the port parsing in the
|
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.
nice! thanks for going the extra mile here. let's
This PR contains the following changes:
localstack_client
(and its transitive dependencyboto3
frominstall
to theruntime
extra).apispec
toruntime
, removes an unnecessary version pin onamazon_kclpy
).service:port
mapping from thelocalstack-client
with an dynamically detected list of services based on the loaded plugins.localstack-client
does not have to be changed and released when introducing a new service emulator in LocalStack.localstack-client
would only be used with the environment variableUSE_LEGACY_PORTS
, but these wouldn't work with the new "one endpoint for everything" anyways.localstack-client
as well (or maybe completely strip it down to the part patchingboto3
), however, this is out of scope for this PR. It's rather a first step towards that direction.I am happy for any feedback!