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

Connect to services over dmsghttp #995

Merged
merged 25 commits into from
Nov 25, 2021
Merged

Connect to services over dmsghttp #995

merged 25 commits into from
Nov 25, 2021

Conversation

ersonp
Copy link
Contributor

@ersonp ersonp commented Nov 10, 2021

Did you run make format && make check?
yes

Fixes #985

Changes:

  • Updated disc.NewHTTP
  • Added http.Client param to dmsgc.New()
  • Update initDmsg() to connect to the dmsg-discovery via HTTP over dmsg if the URL of dmsg-discovery in the config is dmsg://<pk-of-dmsg-discovery>:80
  • Added dmshhttp module
  • Renamed localServers.json to dmsghttp-config.json
  • Changed datatype of DMSGServers from []string to []*disc.Entry

How to test this PR:

On test deployment:

  1. Run
    ./skywire-cli config gen -dirt
    
  2. Run
    ./skywire-visor skywire-config.json
    
  3. Open hypervisor UI and check functionality.

On integration env:
Check #skywire-services-486

Needs:
#dmsg-130

The commit adds dmsg direct client for communication with services via http over dmsg.
The commit adds dmsgHTTPC to the router that enables the visor to connect to the route-finder via http over dmsg.
The commit adds dmsgHTTPC to the router that enables the visor to connect to the route-finder via http over dmsg.
The commit adds the functionality for the tpdclient to connect to the transport-discovery via http over dmsg. It also contains changes to httpauth to accommodate this functionality.
The commit renames dmsgHTTPC to httpC as it better reflects it's use as it can either be a dmsghttp client or just a http client.
The commit adds the functionality for the utclient to connect to the uptime-tracker via http over dmsg.
The commit adds the functionality for the utclient to connect to the uptime-tracker via http over dmsg.
The commit adds the functionality for the appdisc and servicedisc to connect to the service-discovery via http over dmsg.
The commit adds the functionality for the public autoconnect to connect to the service-discovery via http over dmsg.
The commit adds the functionality for the address-resolver client to connect to the address-resolver via http over dmsg.
The commit changes the var disc to serviceURL and also changes the src string of pushCloseStack in initUptimeTracker to uptime_tracker.
@ersonp ersonp marked this pull request as ready for review November 16, 2021 09:14
This commit changes the datatype of dmsg servers from []string to []*disc.Entry to better suit it's usage.
This commit adds dmsghttp module moving the older repetative code to one func. It also incudes the func getHTTPClient which further streamlines the code.

The service modules address-resolver, discovery, transport, dmsg, router and uptime_tracker are are reliant on the new module.

The dClient (dmsg direct client) and dmsgHTTP (dmsghttp client) are added to the Visor struct.
Copy link
Contributor

@mrpalide mrpalide left a comment

Choose a reason for hiding this comment

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

Code is clean and actually work both test, in integration env and locally independent.

pkg/dmsgc/dmsgc.go Outdated Show resolved Hide resolved
This commit renames the config file localServers.json to dmsghttp-config.json along with it's reference in config gen.
This commit changes the data type of DMSGServers from []string to []*disc.Entry.
Copy link
Member

@jdknives jdknives left a comment

Choose a reason for hiding this comment

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

Looks good. Just one small point.

cmd/skywire-cli/commands/config/gen.go Show resolved Hide resolved
@jdknives jdknives merged commit be38adb into skycoin:develop Nov 25, 2021
@ersonp ersonp deleted the feature/dmsghttp branch April 11, 2022 15:38
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.

3 participants