Skip to navigation

Building RMS

View as Markdown

Make sure you have the build prerequisites installed first.

Cloning the RMS repo

git clone https://github.com/dsx-ai-factory/nv-rms.git
cd nv-rms

The librms gRPC definitions are fetched automatically by Cargo (pinned by rev in Cargo.toml) on the first build - there is no submodule to initialize.

Building the binaries

The workspace produces two binaries: rackmanagementservice (the service) and nvfwupd (the bundled firmware-update CLI, used for operator diagnostics).

Release build

Recommended, via the Justfile:

just build

Or directly with Cargo:

cargo build --release --workspace

Optimized binaries land under target/release/ and match what the container image ships:

target/release/rackmanagementservice
target/release/nvfwupd

Debug build

For faster iteration during development:

cargo build --workspace

Unoptimized binaries with debug symbols land under target/debug/.

Code quality checks

just check
just docs-api

Container images

RMS ships a multi-stage Dockerfile:

  • Stage 1 - builder (rust:1.96-bookworm): the full build environment (Rust toolchain, protoc, linkers). Produces the workspace release binaries and pre-compiled test binaries. This stage is the base for CI lint, test, and coverage jobs.
  • Stage 2 - release (debian:bookworm-slim): a minimal runtime image containing only the rackmanagementservice and nvfwupd binaries plus ca-certificates and ipmitool. It excludes the Rust toolchain and is the artifact for production deployments. It exposes port 8801 and its entrypoint is rackmanagementservice.

The Justfile injects git version metadata so the binary reports a real version (the image is tagged rms-api:<git-describe>):

# Release image (rms-api:<git-describe>)
just docker-build
# Builder-stage image (rms-builder:<git-describe>)
just docker-build-builder

The .git directory is excluded from the Docker build context, so vergen cannot read it at compile time. The Justfile passes VERGEN_GIT_SHA and VERGEN_GIT_DESCRIBE as build args to compensate.

Build with raw docker

The raw commands work too, but without the --build-arg VERGEN_* values the binary’s git version fields show VERGEN_IDEMPOTENT_OUTPUT:

# Minimal release image
docker build --target release -t rms-release .
# Builder-stage image
docker build --target builder -t rms-builder .

Standalone nvfwupd binaries

The nvfwupd CLI can be built on its own. The workspace provides Makefile targets for x86_64 and arm64 Linux musl builds, as described in the README:

make -C crates/rust_nvfwupd nvfwupd-x86
make -C crates/rust_nvfwupd nvfwupd-arm64

The binaries are written to target/x86_64-unknown-linux-musl/release/nvfwupd and target/aarch64-unknown-linux-musl/release/nvfwupd, respectively. See the Development reference for the required toolchains and equivalent Cargo commands.

Next steps