-
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.
Merge pull request #165 from DLTcollab/develop
Pre-release v0.4.0
- Loading branch information
Showing
27 changed files
with
1,466 additions
and
36 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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "deps/libtuv"] | ||
path = deps/libtuv | ||
url = https://github.com/DLTcollab/libtuv.git | ||
[submodule "deps/rabbitmq-c"] | ||
path = deps/rabbitmq-c | ||
url = https://github.com/alanxz/rabbitmq-c.git |
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
Submodule libtuv
updated
4 files
+6 −1 | cmake/config/config_arm-linux.cmake | |
+12 −3 | cmake/option/option_arm-linux.cmake | |
+2 −0 | include/uv.h | |
+8 −0 | src/threadpool.c |
Submodule rabbitmq-c
added at
75a21e
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
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 asynchronous remote procedure call, remote interface in dcurl provides an interface named as `Remote_ImplContext` to implement it. dcurl currently uses RabbitMQ C client to implement asynchronous RPC in remote interface. Remote interface provides thread management to support an asynchronous RPC per thread. | ||
|
||
Here are detailed implementations of the RabbitMQ-provided RPC pattern as follows: | ||
* Asynchronous RPC requests are inserted into the message queue, `incoming_queue`, in RabbitMQ broker | ||
* Asynchronous RPCs with exclusive private queues (callback queues) with TTL = 10s property | ||
* Correlation ID is not used | ||
* An asynchronous 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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Build remote-worker | ||
$(OUT)/worker-%.o: $(SRC)/%.c $(LIBTUV_PATH)/include $(LIBRABBITMQ_PATH)/build/include | ||
$(VECHO) " CC\t$@\n" | ||
$(Q)$(CC) -o $@ $(WORKER_CFLAGS) $(LIBTUV_INCLUDE) $(LIBRABBITMQ_INCLUDE) -c -MMD -MF $@.d $< | ||
|
||
$(OUT)/remote-worker: $(OUT)/remote_worker.o $(WORKER_OBJS) $(LIBTUV_LIBRARY) $(LIBRABBITMQ_LIBRARY) | ||
$(VECHO) " LD\t$@\n" | ||
$(Q)$(CC) -o $@ $^ $(LDFLAGS) $(LIBRABBITMQ_LINK) |
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.