-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed several issues and the emulator runs now
- Loading branch information
Showing
16 changed files
with
267 additions
and
63 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Running Edge Example with Hierarchical Clients | ||
|
||
Please follow these steps to run the Edge device emulator, | ||
|
||
## Provision | ||
|
||
Use tree_prov.py to generate a hierarchical NVFlare system with 2 levels and 2 clients at each level, | ||
|
||
python tree_prov.py -p /tmp/edge_example -d 2 -w 2 | ||
|
||
This will create a deployment with 2 clients, 4 leaf-clients, 2 relays, 1 server. | ||
|
||
This file needs to be copied to the `local` folder of each leaf clients, C11, C12, C21 and C22. | ||
|
||
`edge__p_resources.json`: | ||
|
||
``` | ||
{ | ||
"format_version": 2, | ||
"components": [ | ||
{ | ||
"id": "web_agent", | ||
"path": "nvflare.edge.widgets.web_agent.WebAgent", | ||
"args": {} | ||
}, | ||
{ | ||
"id": "etd", | ||
"path": "nvflare.edge.widgets.etd.EdgeTaskDispatcher", | ||
"args": {} | ||
} | ||
] | ||
} | ||
``` | ||
|
||
To start the system, just run the following command, | ||
./start_all.sh | ||
|
||
## Starting Web Proxy | ||
|
||
To route devices to different LCP, routing_proxy is used. It's a simple proxy that routes the request to | ||
different LCP based on checksum of the device ID. It can be started like this, | ||
|
||
python routing_proxy.py 8000 /tmp/edge_example/lcp_map.json | ||
|
||
The lcp_map.json file is generated by tree_prov.py. | ||
|
||
## Example Job | ||
|
||
The `hello_mobile` is a very simple job to test the edge functions. It only sends one task "train" and | ||
print the aggregated results. | ||
|
||
The job can be started as usual in NVFlare admin console. | ||
|
||
## Run Edge Emulator | ||
|
||
The emulator can be used to test all the features of the edge system. It handles 'train' task by simply doubling every values | ||
in the weights. | ||
|
||
To start the emulator, give it an endpoint URL and number of devices like this, | ||
|
||
python run_emulator.py http://localhost:8000 16 | ||
|
||
The emulator keeps polling the LCP for job assignment. It only runs one job then quits. | ||
|
||
|
||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.