feat: add automatic Docker service endpoint resolution#75
Merged
Conversation
- Add endpoint resolution for Docker service names - Implement connection testing with fallback strategies - Support localhost, host.docker.internal, and bridge IP fallbacks - Add socket-based connectivity testing - Resolve S3 filesystem endpoints automatically in Docker environments
- Add type annotations to _resolve_endpoint, _is_docker_service_name, _resolve_docker_service, and _test_connection methods - Add ValueError for invalid endpoint URLs in _resolve_endpoint - Improve null safety with proper None checks - Use default port 443 for socket connections when port is None - Simplify variable assignments by removing unnecessary parentheses - Add SLF001 exception to ruff config for test files to allow private member access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add automatic Docker service endpoint resolution
Key Changes:
Added:
_resolve_endpoint()static method for endpoint resolution_is_docker_service_name()to detect Docker service names_resolve_docker_service()with multiple fallback strategies_test_connection()for socket-based connectivity testingChanged:
configure()methodRemoved:
Generated Summary:
_resolve_endpoint: Resolves the provided endpoint URL._is_docker_service_name: Detects if a hostname is a Docker service name._resolve_docker_service: Attempts to resolve service name to actual address using multiple strategies._test_connection: Conducts a simple connectivity test on the given endpoint.configuremethod to use the new endpoint resolution logic when connecting to S3 storage.This summary was generated with ❤️ by rigging
This PR addresses connectivity issues when running Dreadnode in Docker environments where service names need to be resolved to accessible endpoints. The implementation tries multiple resolution strategies (original service name, localhost, host.docker.internal, Docker bridge IP) and automatically selects the first working connection.