Rust backend for NaluDAQ
Project description
NaluDAQ_rs
Rust backend for NaluDaq.
Setup
Make sure the Rust toolchain is installed.
Clone the repository to a suitable location:
git clone https://github.com/NaluScientific/naludaq_rs.git
Done!
Building the backend for python
pip install maturin
maturin build
Building the Backend
The backend is easy to build:
cd naludaq_rs
cargo build --release
Developers may ommit the --release
flag for unoptimized builds.
Building for RPI4
Building using docker:
docker build . -t cc/rpi4
to make the container, the build the app with:
docker run --rm -v ${pwd}:/app cc/rpi4
Running the Backend
To run the backend, run the following command:
cargo run --release -- [<ROOT>] [--addr <ADDR>] [-d | --debug] [--api]
Where the arguments are as follows:
<ROOT>
is the root directory to run the server in. By default, it is the current working directory of the terminal it was run from.--addr <ADDR>
is the address to bind the server to in the formatIP:PORT
. If unspecified, the server is bound to an open port on the loopback address.-d | --debug
shows additional debug messages.--api
will open the Swagger UI in the system browser.
Documentation
The documentation can be built using the following command:
cargo doc --document-private-items --no-deps
The API
NaluDAQ_rs is controlled through its REST API over HTTP. This allows it to be controlled from any machine connected to a network.
The backend can be controlled on the fly via Swagger. Use the --api
flag when starting the backend to display the Swagger UI.
Alternatively, the (non-interactive) Swagger UI may be viewed without the backend by running the following command:
cargo run --bin api -- [--output OUTPUT_FILE]
If the --output
argument is provided, the OpenAPI JSON data describing
the API is written to the file and the program will immediately exit.
Developers
Profiling
Use the build profile called `release-with-debug for building release mode with debug symbols.
cargo build --profile release-with-debug
On Windows machines with Intel processors you can use Intel VTune to profile the backend.
Building the Documentation
cargo doc --open
Tweaking Dependencies
The crate depends on a couple crates published to crates.io. If you are touching these dependencies and wish to test out your changes without
publishing the crates, clone the dependencies and change these lines in Cargo.toml
:
# naluacq = "X.X.X"
# ft60x_rs = "X.X.X"
naluacq = { "path" = "path/to/naluacq" }
ft60x_rs = { "path" = "path/to/ft60x-rs" }
Architecture
Below is a non-exhaustive diagram of the architecture of the backend highlighting only the main components and their interactions.
graph LR
Board[Board]
Connection[Connection]
Disk[Disk]
subgraph workers [Workers]
Worker_Connection[Connection Worker]
Worker_Package[Package Worker]
Worker_Storage[Storage Worker]
Worker_Answer[Answer Worker]
Worker_Answer_Buffer[Answer Buffer]
end
subgraph server [Server Endpoints]
Endpt_Configure_Workers[Configure Workers]
Endpt_Send_Command[Send Command]
Endpt_Recv_Answer[Receive Answer]
Endpt_Fetch_Event[Fetch Event]
Endpt_Manage_Connection[Manage Connection]
end
Board -->|Readout/Answer| Connection
Connection -->|Board Output| Worker_Connection
Connection -->|Command| Board
Worker_Connection -->|Board Output| Worker_Package
Worker_Package -->|Event| Worker_Storage
Worker_Package -->|Answer| Worker_Answer
Worker_Storage -->|Event| Disk
Worker_Answer -->|Answer| Worker_Answer_Buffer
Endpt_Send_Command -->|Command| Connection
Worker_Answer_Buffer -->|Answer| Endpt_Recv_Answer
Disk -->|Event| Endpt_Fetch_Event
Endpt_Manage_Connection -->|Configuration| Connection
Endpt_Configure_Workers -->|Configuration| Worker_Package
Endpt_Configure_Workers -->|Configuration| Worker_Storage
Endpt_Configure_Workers -->|Configuration| Worker_Answer
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for naludaq_rs-0.2.6-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58cc479e81921f8dbd5fb89abdd9f21f9b22a9a1a98ba62edd0475b647e81f6d |
|
MD5 | 8516698e3901aa00267ad7a54b5d5c88 |
|
BLAKE2b-256 | f4ce77d3bf20c7f8d9f04cce4c333afb318522551dc56ae0b0caa802229b5ee1 |
Hashes for naludaq_rs-0.2.6-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1516c911ae555eae5638c0967e2d1ed6954d07e170f0b006767fc199b49ba415 |
|
MD5 | 16e478ded341c0aaba4147b206ca603e |
|
BLAKE2b-256 | b4574824bc7c9994e52e8b4545526bab893f2f635058dba9e20bbde1e0509677 |
Hashes for naludaq_rs-0.2.6-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97d639961c53dd420b93eed03fbb71c9cc4352686b063d907268dc5aa1afa61d |
|
MD5 | 8b153dd1ea3abc5a05c6bc2a1b72a1fa |
|
BLAKE2b-256 | 243af1eff2b1dc4487e1352596ca3faa5795c146310560b316ecc4b134ced23f |
Hashes for naludaq_rs-0.2.6-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f515934b979bd61120603ce716dc426a1e35bf16e85a5f7d74b388a0b26d92ce |
|
MD5 | 4a0494fe2dfdb6207d369ade64213979 |
|
BLAKE2b-256 | 5e5cfcc6f48ba96a3ebacdeaaea657dc0d07d0b7be6761bbd7ca74fa444579f3 |
Hashes for naludaq_rs-0.2.6-cp312-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc141e0b340ae217f7dcd07b35b438ae6973daff2b630cb745cc50dcafc71d45 |
|
MD5 | 6aa798ebeb5e292727e78f6f02efbd32 |
|
BLAKE2b-256 | 47a3857300f535c3c52cd57439b982fc2d7f8cd05e96a519746bb2051b4680d4 |
Hashes for naludaq_rs-0.2.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef862893707c504ab4c0054baef50bc8497fc0fab72af7fe1ecf090153815396 |
|
MD5 | e3a66751dbde16dc2a5ca390d0e43e92 |
|
BLAKE2b-256 | a7672eec03347109dfddb2f53e20002d08c8d5a2c54941d5716bdbe6bf5c4f16 |
Hashes for naludaq_rs-0.2.6-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 404e368b4c9404e536f910f1e9ad758d2890afa1d949c3bca12d9241443d7a39 |
|
MD5 | 2b30d01ad6fd29d5f87d166acc52046b |
|
BLAKE2b-256 | 012745b6ec8683a4cc702ad4091ed72a8ca6465a96867f4b29033e4fd43e8346 |
Hashes for naludaq_rs-0.2.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8d1452d258a7bc1ae4bd49a56dccb42d66d4022afe929b9f1cf4c953c048e62 |
|
MD5 | 191ae61dbbcdd7aad805c966e177232e |
|
BLAKE2b-256 | 314858712b0d676c38b010e643ce418744900e7d7de5d15719cd9b8c3df6e46d |
Hashes for naludaq_rs-0.2.6-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e827692c8856f97b9945f7718b0f30b226c0c4907326ee3258b3cb96fcca192 |
|
MD5 | e43d4ed22c8e59477b686838d92d8f9c |
|
BLAKE2b-256 | f209621f1fa456ce1f8eee3376475ad90d53dc4c2efe0547ea2c4dd97e0c58bf |
Hashes for naludaq_rs-0.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7d334056a183021f8c908c7fb2527b4958cb3bba8498376eed94cd0cf91e770 |
|
MD5 | 991d8abceb76aa8a80f9437c13e09070 |
|
BLAKE2b-256 | a68684fb718daee997a03d65f5aa77bf31d5570a149efd0952aa6ff1ffc4760d |
Hashes for naludaq_rs-0.2.6-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79040ad7806fa051d0403bc95bc8e8f63b206531ea47b8370c50f002c71ad2e4 |
|
MD5 | b4cd439bb8396a25635e36683b5134cf |
|
BLAKE2b-256 | 0d8f870f4fb53fcd828a059d55d0eb6aead4cfe6ee3ab19541b7e26f17c40fff |
Hashes for naludaq_rs-0.2.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b60102c191fda4a43fcfa7e92c87ca6875eb76396dd69e68a6ce618d79a65d47 |
|
MD5 | aeac23e86d006a6333394f13fec5e4d4 |
|
BLAKE2b-256 | 0ee03189bd069c047fd0db18c871354824497e06a373b19235a2b5d07fe3dc8e |
Hashes for naludaq_rs-0.2.6-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9deb6e36a8c60a047429c42033cf128a1968d0ef8202b34c69aa1264b900a76 |
|
MD5 | b62ba94fd1e874c5840b0a1b2e66fabd |
|
BLAKE2b-256 | a29b28048f7b875ac955381f46dc7129514abbd0bd05831ee9fd6576cfc440ae |
Hashes for naludaq_rs-0.2.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2906db572f795317fe7bddc0a0575de98cd3afaf494323f633a4f6b0147d5278 |
|
MD5 | e8ad3406c5cc0e151e07fcb24430828e |
|
BLAKE2b-256 | f9174903b9c4664b594f8b57ffe20524daa57fd2fa6c665319825b5e19c2a6ef |
Hashes for naludaq_rs-0.2.6-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 863fc544e179240add70a1cb5eb8c567617299d9e373063d924553f6b9765a01 |
|
MD5 | 259617a2d20b42f13f081718332c874b |
|
BLAKE2b-256 | 29c06cf6cd2cbff6e87269f4e1172527508635218e2b271952eba22fd7830678 |
Hashes for naludaq_rs-0.2.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7a70ab82fa8893c709d0a7de89d030a876f059f3107e419a6eaa7a40d40f229 |
|
MD5 | 82a942b9ae7266448db567a73b85271d |
|
BLAKE2b-256 | 099c483e806f7c0cbc38adbebf02c01158cddbc3ea321f1b50ab996dd6f804ca |