-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Describe implementation of remote interface
- Loading branch information
Showing
1 changed file
with
67 additions
and
0 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,67 @@ | ||
# Remote interface | ||
## Introduction | ||
|
||
``` | ||
+-----------------------------------------------+ | ||
| remote interface | | ||
| +----------------------------------------+ | | ||
| +----------------------------------------+| | | ||
| +----------------------------------------+|+ | | ||
| | RabbitMQ-provided RPC |+ | | ||
| +----------------------------------------+ | | ||
| | ^ | | ||
+------------|---------------------|------------+ | ||
+------------|---------------------|------------+ | ||
| | RabbitMQ broker | | | ||
| | | | | ||
| | +------------------+ | | ||
| v +------------------+| | | ||
| +------------------+ +------------------+|| | | ||
| | incoming queue | | private queue ||| | | ||
| | | | ||| | | ||
| | - trytes | | - PoW result ||| | | ||
| | - mwm | | ||+ | | ||
| | | | |+ | | ||
| +------------------+ +------------------+ | | ||
| | ^ | | ||
+------------|---------------------|------------+ | ||
v | | ||
+---------------------------------------------+ | ||
+---------------------------------------------+| | ||
+---------------------------------------------+|+ | ||
| remote worker |+ | ||
+---------------------------------------------+ | ||
``` | ||
To support asynchronouse remote procedure call, remote interface, `Remote_ImplContext`, in dcurl provides an interface to implement it. dcurl currently uses RabbitMQ C client to implement asynchronouse RPC in remote interface. Remote interface provides thread management to can run an asynchronouse RPC per thread. | ||
|
||
Here are detailed implementations of the RabbitMQ-provided RPC pattern as follows: | ||
* Asynchronouse RPC requests are inserted into the message queue, `incoming_queue`, in RabbitMQ broker | ||
* Asynchronouse RPCs with exclusive private queues (callback queues) with TTL = 10s property | ||
* Correlation ID is not used | ||
* An asynchronouse RPC uses a connection to RabbitMQ broker | ||
* Remote workers can obtain requests from `incoming_queue` by default exchange of RabbitMQ broker | ||
|
||
## How to test remote interface in localhost | ||
You need to open three terminals | ||
|
||
Terminal 1: Run the RabbitMQ broker You can quickly use docker to run the RabbitMQ broker, rabbitmq | ||
``` | ||
$ sudo docker run -d rabbitmq | ||
``` | ||
|
||
Terminal 2: Run remote workers | ||
``` | ||
$ ./build/remote-worker | ||
``` | ||
How to build remote worker on FPGA board | ||
``` | ||
$ make BUILD_REMOTE=1 BUILD_FPGA_ACCEL=1 BOARD=de10nano | ||
``` | ||
|
||
Terminal 3: Run check | ||
``` | ||
$ make BUILD_REMOTE=1 BUILD_DEBUG=1 check | ||
``` | ||
|
||
## Requirements | ||
Remote interface requires RabbitMQ broker |