Dria Compute Node serves the computation results within Dria Knowledge Network.
Use the Dria Compute Launcher to run a compute node with many more features!
For production images:
- Versioned: With each release, a versioned image is deployed on Docker hub with the version tag
:vX.X.X. - Latest: The latest production image is always under the
:latesttag.
For development images:
- Master: On each push to
masterbranch, a new image is created with the tagmaster-<commit>-<timestamp>. - Unstable: The latest development image is always under the
:unstabletag.
You can see the list of deployed images on Docker Hub.
If you have a feature that you would like to add with respect to its respective issue, or a bug fix, feel free to fork & create a PR!
If you would like to run the node from source (which is really handy during development), you can use our shorthand scripts within the Makefile. You can see the available commands with:
make helpYou can run the binary as is:
cargo run
# specify custom .env file
DKN_COMPUTE_ENV=./path/to/.env cargo runIf you have a valid .env file, you can run the latest Docker image via compose as well:
docker compose up
# Ollama without any GPUs
docker compose --profile=ollama-cpu up
# Ollama for NVIDIA gpus
docker compose --profile=ollama-cuda up
# Ollama for AMD gpus
docker compose --profile=ollama-rocm upTip
You can specify a custom initial RPC address with DKN_INITIAL_RPC_ADDR.
You can the tests as follows:
cargo test --workspaceWe also have some benchmarking and profiling scripts, see node performance for more details.
You can view the entire crate-level documentation with:
cargo doc --open --no-deps --document-private-itemsLint and format with:
cargo clippy --workspace
cargo fmt -vWe have scripts to profile both CPU and Memory usage. A special build is created for profiling, via a custom profiling feature, such that the output inherits release mode but also has debug symbols.
Furthermore, the profiling build will exit automatically after a certain time, as if CTRL+C has been pressed. This is needed by the memory profiling tool in particular.
CPU Profiling: To create a flamegraph of the application, the command below will create a profiling build that inherits release mode, except with debug information:
DKN_EXIT_TIMEOUT=120 cargo flamegraph --root --profile=profiling --bin dkn-computeNote
CPU profiling may require super-user access.
Memory Profiling: To profile memory usage, we make use of cargo-instruments:
DKN_EXIT_TIMEOUT=120 cargo instruments --profile=profiling -t Allocations --bin dkn-computeTip
You can adjust the profiling duration via the DKN_EXIT_TIMEOUT variable, which takes a number of seconds until termination.
This project is licensed under the Apache License 2.0.