Skip to navigation

Build and publish images

View as MarkdownOpen in Claude

Build the NVIDIA Remediation Orchestrator (NRO) container image from source. Then load it into Docker or push it to a registry. NRO supplies no published image, so each deployment needs an image that you build or one that you already have.

This guide applies to any deployment method. Sections that apply only to Helm say so. To package the image with both Helm charts in one OCI bundle, follow Build and consume artifacts.

Before you begin

You need:

  • An application source checkout. Use the Remediation Orchestrator source or a module that depends on nv_maestro. The Helm module alone has no image target.
  • Bazel at the version in the checkout’s .bazelversion. Bazelisk selects that version for you. The Helm module’s tool versions apply to Helm tooling only.
  • A Linux C/C++ toolchain. The build uses cgo (Toolchain and architecture).
  • A running Docker daemon to load the image locally.
  • Push access to a registry to publish the image.

maestro is NRO’s historical runtime name. It remains in the application binary, Bazel target names, and the locally loaded image tag. All of these refer to NRO.

Build the NRO image

Skip the build if you already have a compatible image. For Helm deployments on a shared cluster, put its repository and tag or digest in your state file (Write your state file). For the local Helm quick start, make it available in Docker as maestro:latest, for example with docker pull and docker tag.

A compatible image contains /bin/maestro and the UI assets. For Helm deployments, it must also contain a /bin/database-ready probe that accepts the retry flags the bootstrap chart passes. Without that probe, the bootstrap wait-postgres init container fails. This includes a bare NRO binary and an image built before those flags existed.

Run the build from the application source root, the directory that contains cmd/maestro/. From a module that depends on the application module, use the @nv_maestro labels instead:

Source checkoutLocal Docker load targetRegistry push target
Remediation Orchestrator source root, with cmd/maestro///cmd/maestro:maestro.image.local_load//cmd/maestro:maestro.image.push
A module that depends on nv_maestro@nv_maestro//cmd/maestro:maestro.image.local_load@nv_maestro//cmd/maestro:maestro.image.push

If you are following a Helm quick start, run this block while you are still in the Helm module root. It records that directory so that you can return to it (Where to keep your state file). Skip it if you do not deploy with Helm:

# Record the Helm module root while you are in it.
nro_helm_dir="$PWD"

Change to the application source root. Then build the image and load it into Docker:

# Build the image and load it into Docker as maestro:latest.
bazel run //cmd/maestro:maestro.image.local_load
# Print the loaded image's content-addressed ID.
docker image inspect --format '{{.Id}}' maestro:latest

Bazel builds the backend and frontend, assembles the image, and loads it into Docker as maestro:latest. The image includes /bin/maestro and the standalone /bin/database-ready probe that bootstrap uses. Both binaries use the application’s pinned pgx dependency. Rebuild this image when you change the probe. PostgreSQL readiness needs no separate image.

The first build can take several minutes. What comes next depends on how you deploy:

Build and publish your image

A shared cluster pulls the image from a registry. You need permission to push to the repository, and the cluster must be able to pull from it. For Helm deployments with a private registry, configure pull credentials in Create the namespace and Secrets.

The push target builds Linux amd64 and arm64 images, so it needs the image-build toolchain for both. In the example below, replace registry.example.invalid with your registry host in both commands, team/remediation-orchestrator with your repository path, and 1.0.0 with a new release tag. From the application source root, sign in to your registry and push:

# Sign in to your registry.
docker login registry.example.invalid
# Build and push Linux amd64 and arm64 images.
bazel run //cmd/maestro:maestro.image.push -- \
--repository registry.example.invalid/team/remediation-orchestrator \
--tag 1.0.0

Always supply your registry repository and a new explicit release tag with --tag. Do not reuse a release tag for different image content. Unless your registry enforces tag immutability, a later push can overwrite any tag. For production deployments, deploy the pushed image index by digest.

The target pushes --tag together with two generated tags, 0.0.0 and commit. Every unstamped push overwrites those two tags, so do not deploy them. A registry that forbids tag overwrites rejects the generated tags on a later push. The push applies your explicit tag first, so a failed push can still leave that tag published. Check the registry before you retry.

With --config=stamp, the generated tags become the Git version identifier and the commit SHA. tools/workspace_status.sh reports both. The version identifier follows these rules:

  • It starts with the nearest tag that matches v[0-9]*, annotated or lightweight.
  • When the commit comes after that tag, -<commit count>-g<abbreviated hash> follows it, as in v1.2.0-3-gabc1234.
  • With no matching tag, it is the abbreviated hash alone.
  • A .dirty suffix marks uncommitted changes to tracked files.

The push target accepts the runtime flags of the pinned rules_oci push implementation.

To deploy the image with Helm, change to the Helm module root. Then set the repository and your explicit tag in your state file (Write your state file). For a digest, set tag: "" and digest: sha256:<64 hex>.

Toolchain and architecture

The image build enables cgo, so it needs a C/C++ toolchain for each target Linux architecture:

TargetLinux architectures built
Local Docker loadThe host’s architecture: linux/arm64 on an ARM64 host, linux/amd64 on an x86-64 host, including macOS hosts
Registry pushBoth linux/amd64 and linux/arm64

The application source module registers hermetic Zig cross-compilers for both Linux architectures. Use the checkout’s toolchain configuration. Do not assume that your host compiler targets Linux. Helm render tests do not check image builds or host-platform compatibility.

The go_binary(name = "maestro", oci = True, ...) macro in cmd/maestro/BUILD.bazel generates the image targets, so they do not appear there by name. The binary-only target, //cmd/maestro:maestro, does not package a deployable image.

Bootstrap runtime

This section applies to Helm deployments. The Temporal bootstrap Job runs a POSIX sh script in the public admin-tools image. The chart inlines the script, so you do not build or load a separate image for it.

By default, Helmfile uses the locked admin-tools image from the same Temporal release as the server. To select a mirror or a compatible override, set upstreamImages.temporalAdminTools. The selected image must meet the bootstrap chart’s image contract.

PostgreSQL readiness uses /bin/database-ready in the NRO application image. Rebuild that image to include the retry flags that the bootstrap chart requires.

Next steps