-
Notifications
You must be signed in to change notification settings - Fork 79
docs: refactor tonbo docs #298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7e6bd69
docs: outline
crwen c012169
add tonbo api doc
crwen 859f192
add building doc
crwen c977380
docs: add faq section
crwen b931985
docs: add configuration
crwen 6f877a5
docs: add tonbolite document
crwen 2a644e7
docs: update getting started
crwen a1c537a
docs: update contributionm docs
crwen 2319fb7
docs: add tonbolite start page
crwen e85268b
docs: add advance usage for tonbo
crwen cb92faa
docs: init python binding doc
crwen 15f5d2f
fix(docs): executor example
crwen a2dd7c7
docs: persist metadata to s3
crwen 76b2deb
Apply suggestions from code review
ethe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,6 +1,8 @@ | ||
/target | ||
target | ||
/.idea | ||
Cargo.lock | ||
db_path | ||
bindings/python/target | ||
guide/book | ||
guide/book | ||
__pycache__ | ||
|
||
.DS_Store |
This file contains hidden or 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 hidden or 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 hidden or 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,93 @@ | ||
# Building Tonbo | ||
# Building and Testing | ||
<!-- toc --> | ||
|
||
TODO | ||
To get started using tonbo you should make sure you have [Rust](https://www.rust-lang.org/tools/install) installed on your system. If you haven't alreadly done yet, try following the instructions [here](https://www.rust-lang.org/tools/install). | ||
|
||
## Building and Testing for Rust | ||
|
||
### Building and Testing with Non-WASM | ||
|
||
To use local disk as storage backend, you should import [tokio](https://github.com/tokio-rs/tokio) crate and enable "tokio" feature (enabled by default) | ||
|
||
```bash | ||
cargo build | ||
``` | ||
|
||
If you build Tonbo successfully, you can run the tests with: | ||
|
||
```bash | ||
cargo test | ||
``` | ||
|
||
### Building and Testing with WASM | ||
|
||
If you want to build tonbo under wasm, you should add wasm32-unknown-unknown target first. | ||
|
||
```bash | ||
# add wasm32-unknown-unknown target | ||
rustup target add wasm32-unknown-unknown | ||
# build under wasm | ||
cargo build --target wasm32-unknown-unknown --no-default-features --features wasm | ||
``` | ||
|
||
Before running the tests, make sure you have installed [wasm-pack](https://github.com/rustwasm/wasm-pack) and run `wasm-pack build` to build the wasm module. If you build successfully, you can run the tests with: | ||
|
||
```bash | ||
wasm-pack test --chrome --headless --test wasm --no-default-features --features aws,bytes,opfs | ||
``` | ||
|
||
|
||
## Building and Testing for Python | ||
|
||
### Building | ||
We use the [pyo3](https://github.com/PyO3/pyo3) to generate a native Python module and use [maturin](https://github.com/PyO3/maturin) to build Rust-based Python packages. | ||
|
||
First, follow the commands below to build a new Python virtualenv, and install maturin into the virtualenv using Python's package manager, pip: | ||
|
||
```bash | ||
# setup virtualenv | ||
python -m venv .env | ||
# activate venv | ||
source .env/bin/activate | ||
|
||
# install maturin | ||
pip install maturin | ||
# build bindings | ||
maturin develop | ||
|
||
``` | ||
|
||
Whenever Rust code changes run: | ||
|
||
```bash | ||
maturin develop | ||
``` | ||
|
||
### Testing | ||
|
||
If you want to run tests, you need to build with "test" options: | ||
|
||
```base | ||
maturin develop -E test | ||
``` | ||
|
||
After building successfully, you can run the tests with: | ||
|
||
```bash | ||
# run tests except benchmarks(This need duckdb to be installed) | ||
pytest --ignore=tests/bench -v . | ||
|
||
# run all tests | ||
pip install duckdb | ||
python -m pytest | ||
``` | ||
|
||
## Building and Testing for JavaScript | ||
To build tonbo for JavaScript, you should install [wasm-pack](https://github.com/rustwasm/wasm-pack). If you haven't already done so, try following the instructions [here](https://rustwasm.github.io/wasm-pack/installer/). | ||
|
||
```bash | ||
# add wasm32-unknown-unknown target | ||
rustup target add wasm32-unknown-unknown | ||
# build under wasm | ||
wasm-pack build --target web | ||
``` |
This file contains hidden or 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,36 @@ | ||
# Submitting a Pull Request | ||
|
||
Thanks for your contribution! The Tonbo project welcomes contribution of various types -- new features, bug fixes and reports, typo fixes, etc. If you want to contribute to the Tonbo project, you will need to pass necessary checks. If you have any question, feel free to start a new discussion or issue, or ask in the Tonbo [Discord](https://discord.gg/j27XVFVmJM). | ||
|
||
## Running Tests and Checks | ||
This is a Rust project, so [rustup](https://rustup.rs/) and [cargo](https://doc.rust-lang.org/cargo/) are the best place to start. | ||
|
||
- `cargo check` to analyze the current package and report errors. | ||
- `cargo +nightly fmt` to format the current code. | ||
- `cargo build` to compile the current package. | ||
- `cargo clippy` to catch common mistakes and improve code. | ||
- `cargo test` to run unit tests. | ||
- `cargo bench` to run benchmark tests. | ||
|
||
|
||
> **Note**: If you have any changes to *bindings/python*, please make sure to run checks and tests before submitting your PR. If you don not know how to build and run tests, please refer to the [Building Tonbo for Python](./build.md#building-tonbo-for-python) section. | ||
|
||
## Pull Request title | ||
As described in [here](https://gist.github.com/joshbuchea/6f47e86d2510bce28f8e7f42ae84c716), a valid PR title should begin with one of the following prefixes: | ||
- feat: new feature for the user, not a new feature for build script | ||
- fix: bug fix for the user, not a fix to a build script | ||
- doc: changes to the documentation | ||
- style: formatting, missing semi colons, etc; no production code change | ||
- refactor: refactoring production code, eg. renaming a variable | ||
- test: adding missing tests, refactoring tests; no production code change | ||
- chore: updating grunt tasks etc; no production code change | ||
|
||
Here is an example of a valid PR title: | ||
``` | ||
feat: add float type | ||
^--^ ^------------^ | ||
| | | ||
| +-> Summary in present tense. | ||
| | ||
+-------> Type: chore, docs, feat, fix, refactor, style, or test. | ||
``` |
This file contains hidden or 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,6 @@ | ||
# Testing | ||
|
||
|
||
## Testing Tonbo in Rust | ||
|
||
## Testing Tonbo in WASM |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.