Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,14 @@ rustflags = [
# The rust flags for this would be ["-C", "linker-flavor=lld-link"]

[target.aarch64-unknown-linux-gnu]
# Target Graviton3+
# Keep the default aarch64 Linux build portable. Release jobs that produce a
# Neoverse 512-bit vector/SVE artifact can opt in by setting a full
# CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS replacement that includes
# target-cpu=neoverse-512tvb, plus LORE_AARCH64_NEOVERSE_512TVB=1 for C sources.
rustflags = [
"--cfg", "tokio_unstable",
"-C", "force-unwind-tables=yes",
"-C", "force-frame-pointers=yes",
"-C", "target-cpu=neoverse-512tvb",
# Leave debug symbols in the binary for now, we want these in place for the server binary, but still split them via
# package-cli.sh for CLI binaries.
"-C", "split-debuginfo=off",
Expand Down
7 changes: 2 additions & 5 deletions docs/how-to/deploy-local-lore-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ In this guide, you'll deploy local Lore Servers — with durable storage and a c
The binary and Docker paths are mutually exclusive, and each is complete on its own — follow one top to bottom.

- **[Run from the binary](#run-from-the-binary):** Fewer moving parts and native performance. Pick this to run `loreserver` directly on the host.
- **[Run with Docker](#run-with-docker):** An isolated container. Pick this if you'd rather not put a binary on the host — but note the `linux/amd64` emulation caveat on Apple Silicon in the build step.
- **[Run with Docker](#run-with-docker):** An isolated container. Pick this if you'd rather not put a binary on the host.

## Run from the binary

Expand Down Expand Up @@ -196,12 +196,9 @@ The binary and Docker paths are mutually exclusive, and each is complete on its
This needs Docker (and WSL2 on Windows) and the Lore repository cloned locally. Building the image compiles the server, so it needs several GB of free RAM. From the repository root:

```bash
docker build --platform linux/amd64 -f lore-server/Dockerfile -t lore-server .
docker build -f lore-server/Dockerfile -t lore-server .
```

> [!NOTE]
> On Apple Silicon or Windows (both arm64 and amd64), build and run with `--platform linux/amd64` as shown. The `linux/arm64` server image targets AWS Graviton3 (SVE), an instruction set those CPUs lack.

2. **Run it with default settings.**

Map both the TCP and UDP sides of port `41337` and the HTTP port `41339`:
Expand Down
10 changes: 9 additions & 1 deletion lore-base/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ use std::path::Path;

include!("../build-helper.rs");

const AARCH64_NEOVERSE_512TVB_ENV: &str = "LORE_AARCH64_NEOVERSE_512TVB";

fn main() -> Result<(), Box<dyn std::error::Error>> {
// Populate environment with build details
vergen::Emitter::default()
Expand All @@ -25,7 +27,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.opt_level(3)
.includes(Some(native_dir.join("thirdparty")));

if platform == "linux" && arch == "aarch64" {
println!("cargo:rerun-if-env-changed={AARCH64_NEOVERSE_512TVB_ENV}");

if platform == "linux" && arch == "aarch64" && env_flag_enabled(AARCH64_NEOVERSE_512TVB_ENV) {
cc_builder.flag("-mcpu=neoverse-512tvb");
}

Expand All @@ -48,3 +52,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {

Ok(())
}

fn env_flag_enabled(name: &str) -> bool {
env::var(name).is_ok_and(|value| value == "1" || value.eq_ignore_ascii_case("true"))
}
4 changes: 1 addition & 3 deletions lore-server/DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@ telemetry integration, or replication is configured.
## Prerequisites

- Docker with BuildKit support
- On Apple Silicon (M-series Macs), builds must target `linux/amd64` due to Graviton-specific
compiler flags in `.cargo/config.toml` for `aarch64-unknown-linux-gnu`

## Building

From the repository root:

```sh
docker build --platform linux/amd64 -f lore-server/Dockerfile -t loreserver .
docker build -f lore-server/Dockerfile -t loreserver .
```

The build compiles the `loreserver` binary and generates self-signed TLS certificates for QUIC
Expand Down