Skip to content
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

Add configurations for aws-replicator proxy container #54

Merged
merged 2 commits into from
Feb 12, 2024
Merged

Conversation

whummer
Copy link
Member

@whummer whummer commented Feb 9, 2024

Add configurations for aws-replicator proxy container. These were added as part of a debugging session with a user who was using Linux with docker-compose networking, which caused the proxy container to not communicate properly with the LS main container.

The following configuration options have been added, to allow custom settings in different environments, and to improve debuggability:

  • REPLICATOR_CLEANUP_PROXY_CONTAINERS: whether to clean up (remove) the proxy Docker containers once they shut down (default 1). Can be set to 0 to help debug issues, e.g., if a proxy container starts up and exits immediately.
  • REPLICATOR_LOCALSTACK_HOST: the target host to use when the proxy container connects to the LocalStack main container (automatically determined by default)
  • REPLICATOR_PROXY_DOCKER_FLAGS: additional flags that should be passed when creating the proxy Docker containers

Note that transitional versions 0.1.8 and 0.1.9 have already been published to pypi during the debugging session with the user - not an ideal pattern, but this helped significantly speed up the process, and we were able to get it working in the end. Once this PR is merged, we can release new version 0.1.10.

So far these changes were tested manually - no automated test have been added so far. This is something we can look into as a follow-up iteration, potentially.

@whummer whummer requested a review from lakkeger February 9, 2024 16:28
@@ -346,7 +349,13 @@ def start_aws_auth_proxy_in_container(
]
env_vars = env_vars or os.environ
env_vars = select_attributes(dict(env_vars), env_var_names)
env_vars["LOCALSTACK_HOST"] = "host.docker.internal"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this doesn't work in some Linux environments - we now leverage the get_docker_host_from_container() utility further below, which internally also returns host.docker.internal if that host resolves / is accessible.

Copy link
Contributor

@lakkeger lakkeger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@whummer whummer merged commit 58d07a1 into main Feb 12, 2024
1 check passed
@whummer whummer deleted the proxy-configs branch February 12, 2024 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants