-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
426ca9b
commit 5c31ca7
Showing
6 changed files
with
1,710 additions
and
3 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,4 @@ | ||
FROM rust:latest | ||
RUN cargo install mdbook-mermaid | ||
RUN cargo install mdbook --no-default-features --features search --vers "^0.4" --locked | ||
CMD ["mdbook", "build", "doc"] |
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 @@ | ||
mermaid.initialize({startOnLoad:true}); |
Large diffs are not rendered by default.
Oops, something went wrong.
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,50 @@ | ||
# Development | ||
|
||
## Build | ||
|
||
(lolraft crate only) The proto file should be compiled manually if you changed the proto file. | ||
In this case, please run `cargo run -p codegen`. | ||
|
||
## Test | ||
|
||
For testing, lolraft makes use of docker-compose. | ||
|
||
A docker image called testapp is built and the tests create some instances of it for testing: test code is running on dev container and it accesses the docker deamon in the host. In GHA, the tests are run in the same way. | ||
|
||
The log output in the stdout/stderr is collected into the log container. This is quite useful for debugging. So here is how you can run the tests for development. | ||
|
||
- `docker compose build` to build test application. | ||
- TERM1: `./log` to start log watcher. | ||
- TERM2: `./dev` to start the dev container. | ||
- TERM2: `cargo test`. | ||
|
||
```mermaid | ||
graph | ||
subgraph raft_network | ||
subgraph cluster | ||
APP1(testapp-1) | ||
APP2(testapp-2) | ||
APP3(testapp-3) | ||
end | ||
DEV(dev) | ||
LOG(log) | ||
end | ||
APP1 -->|log| LOG | ||
APP2 -->|log| LOG | ||
APP3 -->|log| LOG | ||
DEV -->|command| APP1 | ||
DEV -->|command| APP2 | ||
DEV -->|command| APP3 | ||
``` | ||
|
||
## Documentation | ||
|
||
You can modify the documentations. | ||
|
||
For editing the mdbook under doc/ directory, | ||
you can run `mdbook serve doc` to start the local mdbook server. |