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

DOCKER_HOST handling fix #1960

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

AndreiOrmanji
Copy link

@AndreiOrmanji AndreiOrmanji commented Jan 15, 2025

Description of change

fixes #1959

  1. update bollard to latest version
  • modify Cargo.toml
- bollard = "0.15.0"
+ bollard = { version = "0.18.1", features = ["ssl_providerless"] }
  • replace calls of connect_with_unix to connect_with_socket, because it was renamed in new versions
  1. Fix DOCKER_HOST handling
    replace calls of connect_with_local_defaults to connect_with_defaults to fix cases when DOCKER_HOST is set up as tcp/http/https

How has this been tested? (if applicable)

By running tests locally

@AndreiOrmanji AndreiOrmanji changed the title cargo-shuttle DOCKER_HOST handling fix DOCKER_HOST handling fix Jan 15, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR updates Docker connection handling across the codebase to improve compatibility with various Docker host configurations and modernizes the bollard dependency.

  • Updates bollard dependency to v0.18.1 with ssl_providerless feature in Cargo.toml for better SSL handling
  • Replaces connect_with_local_defaults() with connect_with_defaults() in provisioner_server.rs to properly handle tcp/http/https DOCKER_HOST configurations
  • Updates connect_with_unix to connect_with_socket in gateway/src/service.rs to align with bollard's renamed API

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

4 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

gateway/src/service.rs Outdated Show resolved Hide resolved
@AndreiOrmanji AndreiOrmanji force-pushed the cargo-shuttle-docker-host-fix branch from fb8522a to 2f7a0e1 Compare January 15, 2025 15:02
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Based on the latest changes, here's my concise expert review focusing only on new/different aspects not covered in the previous review:

This PR completes the Docker host configuration improvements by updating the remaining connection handling code in the gateway service.

  • Adds Docker connection timeout configuration in gateway/src/service.rs with a 60-second default
  • Implements consistent Docker host handling across test utilities in gateway/src/lib.rs
  • Ensures proper error handling for Docker connection failures in production/staging environments

The changes look well-considered and maintain consistency across the codebase while improving Docker connectivity reliability.

4 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@jonaro00 jonaro00 requested a review from fussybeaver January 15, 2025 16:18
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Based on the latest changes and previous reviews, I'll provide a concise summary focusing only on new modifications:

The PR updates Docker connection handling in the provisioner server to improve compatibility with various host configurations.

  • Updates bollard dependency to v0.18.1 in Cargo.toml with ssl_providerless feature for better Docker host compatibility
  • Improves error messaging in provisioner_server.rs to guide users when Docker connection fails
  • Adds clearer documentation about Docker installation requirements in error handling

The changes are focused and address the core issue while maintaining good error handling practices.

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Based on the latest changes and previous reviews, I'll provide a concise summary focusing only on new modifications:

The PR enhances Docker connection handling in the provisioner server with improved error messaging and documentation.

  • Adds more descriptive error message in provisioner_server.rs when Docker connection fails, pointing users to documentation
  • Updates error handling to specifically catch and handle Docker socket connection failures
  • Maintains consistent error messaging across Docker-related operations in the provisioner server

The changes focus on improving user experience through better error handling and guidance.

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

Based on the provided context and previous reviews, I'll focus on the latest changes in this PR:

The PR continues to refine Docker connection handling in the provisioner server with improved error messaging and documentation.

  • Enhances error handling in provisioner_server.rs with a more user-friendly message directing to Docker installation docs
  • Updates bollard dependency to v0.18.1 in workspace Cargo.toml with ssl_providerless feature for better Docker host compatibility
  • Improves Docker connection error handling to better support various DOCKER_HOST configurations including tcp/http/https

The changes maintain focus on improving Docker connectivity reliability while providing clearer guidance for users encountering issues.

No file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Member

@jonaro00 jonaro00 left a comment

Choose a reason for hiding this comment

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

LGTM! Seems to work as expected now.

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.

[Improvement]: allow using docker locally configured for DOCKER_HOST tcp/http values
3 participants