Build from Source
2 minute read
Building Drasi Server Drasi Server A standalone Data Change Processing server running as a process or Docker container. Learn more from source gives you full control over the build process and allows you to contribute to the project or create custom builds.
Prerequisites
- Rust 1.88 or later
- Git
- C compiler (for native dependencies)
Install Rust
Install Rust using rustup, the official Rust toolchain installer. Follow the instructions for your platform on the rustup website.
After installation, verify Rust is available:
rustc --version
cargo --version
Native Dependencies
Building drasi-server requires several native C libraries. Install the dependencies for your platform:
macOS
Install Xcode Command Line Tools to get clang and perl.
Then install the remaining dependencies with Homebrew:
brew install protobuf
brew install jq
Debian / Ubuntu
perl is pre-installed. Install everything else with:
sudo apt-get install -y libssl-dev pkg-config clang libclang-dev libjq-dev libonig-dev protobuf-compiler
Windows
Building natively on Windows requires the Visual Studio 2022 Build Tools (for the MSVC toolchain):
winget install --id Microsoft.VisualStudio.2022.BuildTools -e `
--override "--quiet --wait --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended"
Then install the pinned Rust MSVC toolchain:
rustup toolchain install 1.88.0-x86_64-pc-windows-msvc
Clone the Drasi Server Repository
git clone https://github.com/drasi-project/drasi-server.git
cd drasi-server
Build Options
Debug Build
For development and debugging (faster compile, slower runtime):
cargo build
The binary will be at target/debug/drasi-server.
Release Build
For production use (optimized, faster runtime):
cargo build --release
The binary will be at target/release/drasi-server.
Configuration
Create Configuration File
Drasi Server requires a configuration file that defines your sources, queries, and reactions.
Create a configuration yaml file for Drasi Server. See the Configuration Reference for details on all available configuration options.
Alternatively, use the init command to create a starter configuration file:
cargo run --release -- init --output config/server.yaml
Validate Configuration
Check your configuration file without starting the server:
cargo run --release -- validate --config config/server.yaml
# Show resolved environment variables
cargo run --release -- validate --config config/server.yaml --show-resolved
Check System Dependencies
cargo run --release -- doctor
# Include optional dependencies
cargo run --release -- doctor --all
Run Drasi Server
Using Cargo
# Debug mode
cargo run -- --config config/server.yaml
# Release mode
cargo run --release -- --config config/server.yaml
Using the Binary Directly
# After building
./target/release/drasi-server --config config/server.yaml
Feedback
Was this page helpful?
Glad to hear it! Please tell us what you found helpful.
Sorry to hear that. Please tell us how we can improve.