Build from Source

Compile Drasi Server from source code

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.95 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

Drasi Server requires Rust 1.95 or later, and building with an older toolchain will fail. Confirm rustc --version reports at least 1.95.0; if it is older, update with rustup update.

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 jq oniguruma

The build links against Homebrew’s libjq and libonig, but these are not on the compiler’s default search path (on Apple Silicon, Homebrew installs under /opt/homebrew), so the build fails with Unable to find libjq or ld: library 'onig' not found unless you point the toolchain at them. Set the following in the same terminal you build from (add them to your shell profile to make them permanent):

export JQ_LIB_DIR="$(brew --prefix jq)/lib"
export LIBRARY_PATH="$(brew --prefix jq)/lib:$(brew --prefix oniguruma)/lib:${LIBRARY_PATH:-}"

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 

The libjq-dev package does not ship a pkg-config file, so the jq-sys crate cannot locate libjq automatically and the build fails with Unable to find libjq unless you tell it where the library is. Set JQ_LIB_DIR to your architecture’s multiarch library directory in the same terminal you build from (add it to your shell profile to make it permanent):

export JQ_LIB_DIR="/usr/lib/$(uname -m)-linux-gnu"

Windows

Building natively on Windows requires the Visual Studio 2022 Build Tools (for the MSVC toolchain):

winget install --id Microsoft.VisualStudio.2022.BuildTools -e --source winget `
    --accept-source-agreements --accept-package-agreements --disable-interactivity `
    --override "--quiet --wait --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended"

Then install the pinned Rust MSVC toolchain:

rustup toolchain install 1.95.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 and Install Drasi Server

Build Drasi Server and install the compiled binary into a local ./bin directory:

cargo install --path . --root . --locked

The first build downloads and compiles all dependencies, so it can take several minutes. Subsequent builds are much faster thanks to Cargo’s build cache. The --root . flag tells Cargo to place the compiled drasi-server binary in the ./bin directory.

Verify the Build

./bin/drasi-server --version

You should see output showing the version number, for example:

drasi-server 0.2.1
rustc: rustc 1.95.0
plugin-sdk: 0.9.1

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:

./bin/drasi-server init --output config/server.yaml

Validate Configuration

Check your configuration file without starting the server:

./bin/drasi-server validate --config config/server.yaml

# Show resolved environment variables
./bin/drasi-server validate --config config/server.yaml --show-resolved

Check System Dependencies

./bin/drasi-server doctor

# Include optional dependencies
./bin/drasi-server doctor --all

Run Drasi Server

Run Drasi Server using the installed binary:

./bin/drasi-server --config config/server.yaml