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 compatibility with Docker dns servers #1290

Merged
merged 11 commits into from
Feb 14, 2024

Conversation

moreno-michael
Copy link
Contributor

@moreno-michael moreno-michael commented Feb 1, 2024

resolves #1239

@moreno-michael moreno-michael requested a review from dyc3 as a code owner February 1, 2024 03:11
Copy link
Contributor

coderabbitai bot commented Feb 1, 2024

Important

Auto Review Skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

To trigger a single review, invoke the @coderabbitai review command.

Walkthrough

This update introduces a new module dns within the ott-balancer crate for handling DNS-related functionality. It includes features for configuring, discovering, querying, and retrieving monolith connection configurations.

Changes

File Path Change Summary
.../discovery.rs Added a new module dns for DNS-related functionality, including structures for configuration, a discoverer implementation, and methods for querying and retrieving monolith connection configurations.

🐇✨
In the realm of code, where discoveries are bold,
A rabbit hopped in, with a story untold.
"Through DNS, we seek, for monoliths grand,
A magical quest, at your command."
🌟🐾

Assessment against linked issues

Objective Addressed Explanation
Add Monolith Discoverer that works for any dns server (Issue #1239)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 3

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 42c6c8e and cab961c.
Files selected for processing (1)
  • crates/ott-balancer/src/discovery/dns.rs (1 hunks)

crates/ott-balancer/src/discovery/dns.rs Outdated Show resolved Hide resolved
crates/ott-balancer/src/discovery/dns.rs Outdated Show resolved Hide resolved
crates/ott-balancer/src/discovery/dns.rs Outdated Show resolved Hide resolved
@moreno-michael moreno-michael marked this pull request as draft February 1, 2024 03:15
Copy link

codecov bot commented Feb 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (42c6c8e) 61.5596% compared to head (c8d2457) 47.1016%.
Report is 30 commits behind head on master.

❗ Current head c8d2457 differs from pull request most recent head 4adb46f. Consider uploading reports for the commit 4adb46f to get more accurate results

Additional details and impacted files
@@                Coverage Diff                @@
##             master      #1290         +/-   ##
=================================================
- Coverage   61.5596%   47.1016%   -14.4580%     
=================================================
  Files           118        151         +33     
  Lines          9438      18114       +8676     
  Branches       1161       1233         +72     
=================================================
+ Hits           5810       8532       +2722     
- Misses         3628       9582       +5954     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

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

Please fix the pr title, and don't forget to update the discovery diagrams before tomorrow.

crates/ott-balancer/src/discovery/dns.rs Outdated Show resolved Hide resolved
crates/ott-balancer/src/discovery/dns.rs Outdated Show resolved Hide resolved
@moreno-michael moreno-michael changed the title added-compatibility-with-dns-servers Added compatibility with Docker dns servers Feb 1, 2024
@moreno-michael moreno-michael changed the title Added compatibility with Docker dns servers Add compatibility with Docker dns servers Feb 1, 2024
@moreno-michael moreno-michael marked this pull request as ready for review February 8, 2024 17:30
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 5

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between cab961c and 89212db.
Files selected for processing (1)
  • crates/ott-balancer/src/discovery/dns.rs (1 hunks)

crates/ott-balancer/src/discovery/dns.rs Outdated Show resolved Hide resolved
crates/ott-balancer/src/discovery/dns.rs Outdated Show resolved Hide resolved
crates/ott-balancer/src/discovery/dns.rs Show resolved Hide resolved
crates/ott-balancer/src/discovery/dns.rs Outdated Show resolved Hide resolved
crates/ott-balancer/src/discovery/dns.rs Show resolved Hide resolved
Copy link
Owner

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

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

Took a closer look, and this module isn't being included. add mod dns to discovery.rs, update DiscoveryConfig and fix the compiler errors.

You should be able to run the balancer with the following configuration:

[discovery]
method = "dns"
query = "foo"

I think The demo we did during today's meeting worked because I had the balancer configured with the manual discoverer. That or I forgot to rebuild the container

crates/ott-balancer/src/discovery/dns.rs Outdated Show resolved Hide resolved
crates/ott-balancer/src/discovery/dns.rs Outdated Show resolved Hide resolved
crates/ott-balancer/src/discovery/dns.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 89212db and c796217.
Files selected for processing (2)
  • crates/ott-balancer/src/discovery.rs (1 hunks)
  • crates/ott-balancer/src/discovery/dns.rs (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • crates/ott-balancer/src/discovery/dns.rs
Additional comments: 2
crates/ott-balancer/src/discovery.rs (2)
  • 10-10: The addition of the dns module is noted. Ensure that the implementation within this module aligns with the objectives of enhancing compatibility with Docker DNS servers and follows best practices for DNS queries, especially considering the IPv4 address requirement.
  • 7-13: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-120]

Overall, the file maintains a clear structure and separation of concerns among different discovery methods. Ensure that the dns module is properly integrated and utilized within the DiscoveryTask and start_discovery_task functions, following the async and trait-based patterns established in the file. This integration is crucial for the DNS-based discovery to function as intended within the system's architecture.

Copy link
Owner

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

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

Per my previous review:

You should be able to run the balancer with the following configuration:

[discovery]
method = "dns"
query = "foo"

crates/ott-balancer/src/discovery/dns.rs Outdated Show resolved Hide resolved
crates/ott-balancer/src/discovery/dns.rs Outdated Show resolved Hide resolved
crates/ott-balancer/src/discovery/dns.rs Show resolved Hide resolved
crates/ott-balancer/src/discovery/dns.rs Outdated Show resolved Hide resolved
crates/ott-balancer/src/discovery/dns.rs Show resolved Hide resolved
@moreno-michael moreno-michael marked this pull request as draft February 13, 2024 19:11
@moreno-michael moreno-michael marked this pull request as ready for review February 14, 2024 17:31
@moreno-michael

This comment was marked as outdated.

This comment was marked as outdated.

@dyc3

This comment was marked as outdated.

crates/ott-balancer/src/discovery/dns.rs Outdated Show resolved Hide resolved
@dyc3 dyc3 enabled auto-merge (squash) February 14, 2024 18:01
@dyc3 dyc3 merged commit a4cd92c into dyc3:master Feb 14, 2024
13 of 16 checks passed
Copy link

cypress bot commented Feb 14, 2024

1 failed test on run #996 ↗︎

1 69 1 0 Flakiness 0

Details:

Add compatibility with Docker dns servers (#1290)
Project: OpenTogetherTube Commit: a4cd92c1f5
Status: Failed Duration: 03:05 💡
Started: Feb 14, 2024 6:08 PM Ended: Feb 14, 2024 6:11 PM
Failed  client/tests/e2e/component/ShareInvite.cy.ts • 1 failed test • Component - electron

View Output Video

Test Artifacts
An uncaught error was detected outside of a test Screenshots Video

Review all test suite changes for PR #1290 ↗︎

dyc3 added a commit that referenced this pull request Feb 17, 2024
* added dns.rs, adds compatibility with dns servers

* Adjusted format for Docker DNS

* added missing field

* made suggested changes, working on resolving
compiler issues

* fixed compiler issues

* ran cargo fmt

* made most suggested changes

* fixing compiler issues

* update balancer config for docker

* Update crates/ott-balancer/src/discovery/dns.rs

---------

Co-authored-by: Carson McManus <[email protected]>
Co-authored-by: Carson McManus <[email protected]>
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.

Add Monolith Discoverer that works for any dns server
2 participants