-
Notifications
You must be signed in to change notification settings - Fork 50
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 #327 from shachlanAmazon/docs
Improve and sort documentation.
- Loading branch information
Showing
7 changed files
with
104 additions
and
64 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
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,7 @@ | ||
# Rust core | ||
|
||
## Recommended VSCode extensions | ||
|
||
[rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) - Rust language server. | ||
[CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb) - Debugger. | ||
[Even Better TOML](https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml) - TOML language support. |
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,11 @@ | ||
# Benchmarks | ||
|
||
[`install_and_test.sh`](./install_and_test.sh) is the benchmark script we use to check performance. run `install_and_test.sh -h` to get the full list of available flags. | ||
|
||
The results of the benchmark runs will be written into .csv files in the `./results` folder. | ||
|
||
If while running benchmarks your redis-server is killed every time the program runs the 4000 data-size benchmark, it might be because you don't have enough available storage on your machine. | ||
To solve this issue, you have two options - | ||
|
||
1. Allocate more storage to your'e machine. for me the case was allocating from 500 gb to 1000 gb. | ||
2. Go to benchmarks/install_and_test.sh and change the "dataSize="100 4000"" to a data-size that your machine can handle. try for example dataSize="100 1000". |
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,7 @@ | ||
# C# wrapper | ||
|
||
The C# wrapper is currently not in a usable state. | ||
|
||
## Recommended VSCode extensions | ||
|
||
[C#](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csharp) - lightweight language server and in-editor test runner. |
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,23 +1,50 @@ | ||
This package contains an internal package under the folder `rust-client`, which is just the Rust library and its auto-generated TS code. The external package, in this folder, contains all wrapping TS code and tests. | ||
# NodeJS wrapper | ||
|
||
### First time install | ||
This package contains an internal package under the folder `rust-client`, which is just the Rust library and its auto-generated TypeSCript code. The external package, in this folder, contains all wrapping TypeSCript code and tests. | ||
|
||
## Building | ||
|
||
### dependency installation | ||
|
||
Homebrew is the easiest way to install node, but you can choose any way you want to install it. | ||
Npm should come as part as node. IMPORTANT - right now we support only npm major version 8. | ||
The default install will be of version 9, so you'll need to downgrade - run `npm i -g npm@8`. | ||
|
||
### Build | ||
### Adding the babushka package to your package | ||
|
||
Before you add the babushka package to your application, make sure to perform the stages in "[Building the wrapper](#building-the-wrapper)". | ||
ATM Babushka isn't on npm, so you'll need to clone this repo to you device, and add the package using a folder path - `npm install <path to Babushka>/node`. | ||
|
||
### Building the wrapper | ||
|
||
Before you start, make sure that you have all dependencies mentioned [here](../README.md#development-pre-requirements), [rustup](../README.md#rustup), [node](../README.md#node-16-or-newer) installed, and all [submodules updated](../README.md#git-submodule). | ||
Enter this folder in your terminal. | ||
On the first install, run `npm i`, to install all dependencies. Also enter the `rust-client` folder, and run `npm i` there, too. | ||
|
||
Run `npm run build-internal` to build the internal package and generates TS code. `npm run build-external` builds the external package without rebuilding the internal package. Run `npm run build-protobuf` to generate node's protobuf files. | ||
Run `npm run build` runs a full build. | ||
make sure that all dependencies, including rustup, have been installed. | ||
Run `npm run build:release` runs a full build in release mode. This might take a while. | ||
|
||
For testing purposes, you can run `npm run build` runs a full, unoptimized build. | ||
If you've only made changes to the Rust code, run `npm run build-internal` to build the internal package and generates TypeSCript code. | ||
If you've only made changes to the TypeScript code, run `npm run build-external` to build the external package without rebuilding the internal package. | ||
Run `npm run build-protobuf` to generate node's protobuf files. | ||
|
||
Once building completed, you'll find the compiled JavaScript code in the ./build-ts folder, | ||
|
||
### Testing | ||
|
||
Run `npm test` after building. | ||
|
||
### [Optional] Manually compile protobuf files | ||
### [Optional] Manually compile protobuf files | ||
|
||
1. Run `npm install protobufjs-cli` to install the JS protobuf command line utility | ||
2. Generate static JS code `pbjs -t static-module -o ProtobufMessage.js ~/babushka/babushka-core/src/protobuf/*.proto` | ||
3. Generates TS definitions from the compiled JS file `pbts -o ProtobufMessage.d.ts ProtobufMessage.js` | ||
3. Generates TypeSCript definitions from the compiled JS file `pbts -o ProtobufMessage.d.ts ProtobufMessage.js` | ||
4. Due to a bug in the autogenerated files (see https://github.com/protobufjs/protobuf.js/issues/1063), manually replace `return this.encode(message, writer).ldelim();` to `return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();` in the encodeDelimited functions of Request and Response under babushka/node/src/ProtobufMessage.js. | ||
|
||
## Recommended VSCode extensions | ||
|
||
[Prettier - Code formatter](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) -JavaScript / TypeScript formatter. | ||
[Jest Runner](https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner) - in-editor test runner. | ||
[Jest Test Explorer](https://marketplace.visualstudio.com/items?itemName=kavod-io.vscode-jest-test-adapter) - adapter to the VSCode testing UI. | ||
[ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - linter. |
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