-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Migrate deprecated edge variables #9405
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
Currently, only minor and patch changes are allowed on master. Your PR labels (semver: major) indicate that it cannot be merged into the master at this time. |
fd4e0c1
to
ee81471
Compare
fb5da7d
to
99278b3
Compare
ee81471
to
8b28e56
Compare
8b28e56
to
eecffe7
Compare
069c499
to
42fe64e
Compare
42fe64e
to
dffe61f
Compare
eecffe7
to
1e410df
Compare
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.
Excited to see these changes landing. It's been a while since 2.0 and the logic is much cleaner!
A few comments that I'd like to resolve before we merge, but nothing significant.
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.
Also a change I missed when updating GATEWAY_LISTEN: on config.py
line 671
the type signature of GATEWAY_LISTEN
should be UniqueHostAndPortList
, not List
. Is it ok to update this? (Or remove the dedicated type signature, since it should come from the signature of populate_legacy_edge_configuration
.
I removed the typing. It seems clearer to rely on the correct signature from the function, especially given the tuple. The single typing appears rather confusing. |
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.
Awesome stuff, nice work! I'm super happy to be migrating fully over to GATEWAY_LISTEN
and it's more straightforward to have one variable than the three we used to have!
d891ae6
to
3c270a6
Compare
FYI: I rebased to resolve conflicts (mainly in |
3c270a6
to
3acf501
Compare
New conflicts streaming in 🏃 => new rebase |
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.
Love it, finally getting rid of the confusing EDGE_PORT_HTTP :D
nit: kept the `port` singular to simplify logic for now
Depends on
LOCALSTACK_HOST
migration: #9390Motivation
EDGE_PORT
,EDGE_PORT_HTTP
andEDGE_BIND_HOST
are replaced byGATEWAY_LISTEN
, and have been deprecated since version 2.0. These variables should be removed in a major version, and can be done in version 3.0.Changes
EDGE_PORT
read-only. Internal use is widespread and therefore we consider it as a shortcut for now with the semanticsEDGE_PORT == GATEWAY_LISTEN[0].port
. We also keep exposingEDGE_PORT
in LocalStack compute services because we have not advertised a migration path yet.EDGE_PORT_HTTP
EDGE_BIND_HOST
Background
Announced networking changes upon 2.0: https://discuss.localstack.cloud/t/upcoming-changes-for-localstack-v2/239#networking-7
GATEWAY_LISTEN behavior regarding protocols
http
vshttps
:More details in internal decision document: https://www.notion.so/localstack/Migration-path-for-LOCALSTACK_HOSTNAME-and-EDGE_PORT-9cf800595f854add96ce2788a6d93367?pvs=4
Discussion
localstack/aws/handlers/cors.py
) and the tests required updates (tests/unit/test_cors.py
). Is this ok?GATEWAY_LISTEN
needs to use typed[HostAndPort]
rather than the user-facing string-based API. Does this work properly without side effects? Do we need to provide any guards when used with strings?EDGE_PORT_HTTP
(generated in localstack.services.stepfunctions.stepfunctions_starter.StepFunctionsServer.generate_env_vars) used when starting the Java StepFunctionsLocal.jar ? (I would leave it for now as this StepFunctions implementation will be deprecated anyway).TODO
LOCALSTACK_HOST
migration Migrate endpoints to use LOCALSTACK_HOST only #9390tests.unit.test_config.TestEdgeVariablesDerivedCorrectly.test_localstack_host_overrides_edge_variables
depending on the migration toLOCALSTACK_HOST
https://github.com/localstack/localstack/pull/9390/files#diff-8ee48b2bcad465473db1a1b202781ca2c7c23db7bd1670e79d45668fb2bd718fR616Follow-up
get_edge_port_http()
(this refactoring can also be done post v3 to limit the impact; used 13x in LS + 13x in ext)