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

feat: automatic SDN config with node-api and local_ip #455

Merged
merged 16 commits into from
Nov 26, 2024

Conversation

giangndm
Copy link
Contributor

@giangndm giangndm commented Nov 18, 2024

Description

This PR added two config mechanisms for making it easier to deploy to some cloud provider.

1. Seed generate mechanism

Seed generate mechanism by requesting a node-address HTTP API. This mechanism is helpful with cloud environment when we have auto-generate public IP.

Now instead of manual point to specific node_id and address like

--seeds 1@/ip4/127.0.0.1/udp/10001

We can use more convenience way:

--seeds-from-url "http://localhost:3000/api/node/address"

Or from console endpoint

--seeds-from-url "http://localhost:8080/cluster/seeds?zone_id=0&node_type=Gateway"

2. Generate node_id from local_ip

The idea is simple: most cloud providers or bare-metal servers will assign a unique private IP to each machine, typically in the form of 10.10.10.x, 192.168.1.x, etc.

We can use the last octet of the IP as the node_id.

Related Issue

If this pull request is related to any issue, please mention it here.

Checklist

  • I have tested the changes locally.
  • I have reviewed the code changes.
  • I have updated the documentation, if necessary.
  • I have added appropriate tests, if applicable.

Screenshots

If applicable, add screenshots to help explain the changes made.

Additional Notes

Add any additional notes or context about the pull request here.

Copy link

codecov bot commented Nov 18, 2024

Codecov Report

Attention: Patch coverage is 4.62963% with 309 lines in your changes missing coverage. Please review.

Project coverage is 35.77%. Comparing base (7b55a39) to head (2360ca2).

Files with missing lines Patch % Lines
bin/src/http.rs 0.00% 65 Missing ⚠️
bin/src/main.rs 0.00% 36 Missing ⚠️
packages/media_record/bin/convert_record_worker.rs 0.00% 33 Missing ⚠️
bin/src/server/media.rs 0.00% 31 Missing ⚠️
bin/src/lib.rs 0.00% 26 Missing ⚠️
bin/src/http/api_node.rs 0.00% 24 Missing ⚠️
bin/src/server/gateway.rs 0.00% 24 Missing ⚠️
bin/src/server/connector.rs 0.00% 23 Missing ⚠️
bin/src/server/console.rs 0.00% 14 Missing ⚠️
bin/src/http/api_console/cluster.rs 0.00% 12 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #455      +/-   ##
==========================================
- Coverage   36.24%   35.77%   -0.48%     
==========================================
  Files         177      179       +2     
  Lines       18053    18317     +264     
==========================================
+ Hits         6544     6552       +8     
- Misses      11509    11765     +256     

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


🚨 Try these New Features:

@giangndm giangndm marked this pull request as ready for review November 18, 2024 06:50
@giangndm giangndm changed the title feat: SDN discovery over node http-api feat: automatic SDN config with node-api and local_ip Nov 18, 2024
@giangndm giangndm merged commit 2f3381d into 8xFF:master Nov 26, 2024
9 checks passed
@giangndm giangndm deleted the feat-sdn-discovery-over-http branch November 26, 2024 16:48
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.

1 participant