---
title: "Collector binaries and HPC runners"
description: "Reference for the Go collector tier (novafabric-collector, verifier and HPC hub, built from source), Slurm integration, and the PBS and LSF runners."
canonical: https://novafabric.ai/docs/cli-reference/cluster-and-hpc/
last_updated: 2026-11-21
source: https://github.com/MSKazemi/novafabric/blob/main/docs/cli-reference.md
---

# Collector binaries and HPC runners

Part of the [NovaFabric CLI reference](https://novafabric.ai/docs/cli-reference/). Both `nova` and `novafabric` run the same binary.

## Collector binaries (Phase 2 — cluster scale)

Phase 2 ships three Go binaries (`collector/`) that form the cluster-deployable
evidence ingestion tier. They are separate from the Python `nova` CLI and need
Go 1.26.5 or newer. Install one directly:

```bash
go install github.com/MSKazemi/novafabric/collector/cmd/novafabric-collector@latest
go install github.com/MSKazemi/novafabric/collector/cmd/novafabric-verifier@latest
go install github.com/MSKazemi/novafabric/collector/cmd/novafabric-hpc-hub@latest
```

`@latest` resolves to the newest commit on `main`; the collector module has no
release tags of its own yet. Or build all three from a checkout:

```bash
cd collector
go build -o bin/novafabric-collector ./cmd/novafabric-collector
go build -o bin/novafabric-verifier  ./cmd/novafabric-verifier
go build -o bin/novafabric-hpc-hub   ./cmd/novafabric-hpc-hub
```

These binaries complement the Python SDK: agents continue to emit events via the
existing `nova capture` / hook path; the collector tier signs and forwards those
events to Kafka at cluster scale.

---

### novafabric-collector

Start the OTel Collector with the `novaseal_batch_signer` processor pre-bundled.
Suitable for both K8s (Deployment) and bare-metal gateway deployments.

```bash
novafabric-collector --config collector.yaml
novafabric-collector --config /etc/novafabric/collector.yaml
```

**experimental.** Two builds exist, and neither runs the reference pipeline below as written:
`collector/cmd/novafabric-collector` registers **only** the `novaseal_batch_signer` processor (no
receivers or exporters), and the OCB build (`collector/ocb/builder-config.yaml`) adds the `otlp`
receiver, `batch` and the `debug`/`otlp` exporters — but no `kafka` exporter (**planned**). Use the
OCB build and an `otlp` exporter until then.

**Reference pipeline** (see `deploy/k8s/configmap-collector.yaml`):
```yaml
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: "0.0.0.0:4317"
      http:
        endpoint: "0.0.0.0:4318"
processors:
  batch:
    send_batch_size: 1000
    timeout: 5s
  novaseal_batch_signer:
    keystore_endpoint: "${NOVASEAL_KMS_ENDPOINT}"   # not yet usable — see below
    fail_open: false          # default: fail-closed — unsigned batches are refused
    cache_ttl: 5m
    key_rotation_interval: 1h
    local_wal: false          # true only in dev
exporters:
  kafka:
    brokers: ["${KAFKA_BOOTSTRAP_SERVERS}"]
    topic: "nova.evidence"
service:
  pipelines:
    logs:
      receivers: [otlp]
      processors: [batch, novaseal_batch_signer]
      exporters: [kafka]
```

**`novaseal_batch_signer` processor options:**

| Option | Default | Description |
|---|---|---|
| `keystore_endpoint` | — | NovaSeal KMS mTLS endpoint. **Not yet usable** (**planned**): the KMS keystore needs an mTLS client certificate the processor config has no fields for, so a set `keystore_endpoint` makes the collector refuse to start rather than ignore it |
| `fail_open` | `false` | `false` = fail-closed: with no signer the collector **refuses to start**, and a batch that fails to sign is dropped; `true` = forward without a signature (logged as `forwarding batches UNSIGNED`) |
| `cache_ttl` | `5m` | How long a fetched key is cached |
| `key_rotation_interval` | `1h` | How often to rotate signing key |
| `local_wal` | `false` | **Dev only.** Use a local Ed25519 key from `~/.novafabric/dev-keys/`. Emits a WARN on every signing call. Refuses when `NOVAFABRIC_ENV=production`. |

Today the only working signer is `local_wal: true`. Releases up to v0.107.0 built **no** signer from
the config in any build: every batch was forwarded unsigned, also with `fail_open: false`.

The processor places each batch's signature and key ID in `Resource.attributes`:
- `nova.batch.signature` — base64-encoded Ed25519 signature (88 chars)
- `nova.batch.signing_key_id` — UUID of the signing key

Prometheus metrics exposed at `:8888/metrics`:
- `nova_batch_sign_latency_seconds` — histogram of per-batch signing time
- `nova_batch_sign_errors_total{reason="..."}` — counter by error category
- `nova_collector_forwarded_events_total` — events forwarded to Kafka

**K8s deployment:** see `deploy/k8s/` for a complete namespace, ConfigMap,
Deployment, DaemonSet (Fluent Bit node collector), and Service manifest set.

---

### novafabric-verifier

Verify a NovaSeal Ed25519 batch signature offline. Returns exit 0 if the
signature is valid, exit 1 if invalid or an input cannot be read, exit 2 on a usage error.
Releases up to v0.107.0 panicked on every signed batch (a nil context reached `Verify`) and could
never print `OK`; they also refused a standard SPKI public-key PEM as the wrong size.

```bash
# Verify with a PEM public key from the KMS
novafabric-verifier --batch batch.pb --pubkey kms-public.pem --key-id <key-uuid>

# Verify with the local dev key (matches what local_wal=true used to sign)
novafabric-verifier --batch batch.pb --local-wal
```

**Flags:**

| Flag | Required | Description |
|---|---|---|
| `--batch PATH` | yes | Path to a serialized OTLP `ResourceLogs` proto file |
| `--pubkey PATH` | one of | PEM Ed25519 public key: the standard SPKI `PUBLIC KEY` encoding a KMS exports, or a raw 32-byte body |
| `--key-id UUID` | with `--pubkey` | Key ID to verify against |
| `--local-wal` | one of | Use the dev key from `~/.novafabric/dev-keys/` |

**Output:**

```
# Success
OK key_id=a1b2c3d4-...

# Failure
INVALID key_id=a1b2c3d4-... error=signature mismatch
```

The verifier re-runs the same canonical-encoding pre-pass that the signer used
(ADR-001: strip `nova.batch.signature` + `nova.batch.signing_key_id`, sort
`Resource.attributes` by key, sort each `LogRecord.attributes` by key, marshal
with `proto.MarshalOptions{Deterministic: true}`). If the bytes differ between
signer and verifier, the signature will fail.

---

### novafabric-hpc-hub

**planned — not implemented.** The binary exists so the build target and the Prolog hook are in
place, but it does nothing yet: it parses the flags below and **exits `1`** with
`novafabric-hpc-hub is not implemented`. It does not subscribe to NATS, sign, or publish to Kafka,
and it does not read or create a signing key or contact a KMS. (Up to v0.107.0 it took a key,
logged "starting" and waited for a signal while processing nothing.)

The intended design — **future design**, no implementation — is a cluster-boundary hub that
subscribes to `nova.<cluster_id>.aggregate`, signs each batch with NovaSeal and publishes the signed
batches to a Kafka regional topic, so compute nodes (leaf NATS instances) never touch the NovaSeal
keystore and only the hub node needs KMS network access.

**Flags** (accepted today so an existing invocation gets the message above, not a flag error):

| Flag | Env override | Default | Description |
|---|---|---|---|
| `--cluster-id` | `NOVAFABRIC_CLUSTER_ID` | — | **Required** (exit `2` without it). Cluster identifier |
| `--hub` | `NOVAFABRIC_HUB_ADDRESS` | — | NATS hub address (`nats://...`) — unused |
| `--kms` | `NOVASEAL_KMS_ENDPOINT` | — | NovaSeal KMS endpoint — unused |
| `--local-wal` | `NOVAFABRIC_KMS_LOCAL_WAL=1` | false | Dev key — unused |
| `--job-id` | `SLURM_JOB_ID` | — | Slurm job ID |
| `--spool` | — | — | Spool directory for this job |

For signing batches today, use the collector's `novaseal_batch_signer` processor
(`local_wal: true`; see [novafabric-collector](#novafabric-collector)).

---

### HPC Slurm integration

For Slurm cluster deployments, the collector provides Prolog/Epilog scripts that
initialize a per-job NATS leaf node and bounded-flush on job exit.

**Installation** (run on all Slurm compute nodes):
```bash
# 1. Copy scripts to compute nodes
cp deploy/hpc/prolog.sh /etc/novafabric/prolog.sh
cp deploy/hpc/epilog.sh /etc/novafabric/epilog.sh
chmod 755 /etc/novafabric/prolog.sh /etc/novafabric/epilog.sh

# 2. Add to slurm.conf (requires Slurm admin)
Prolog=/etc/novafabric/prolog.sh
Epilog=/etc/novafabric/epilog.sh
PrologFlags=Alloc
```

**Per-job lifecycle:**
1. **Prolog** — creates `/tmp/novafabric/$SLURM_JOB_ID/` and, if a `novafabric-hpc-hub` binary is on `PATH`, starts it. **planned:** that binary is not implemented yet (it exits `1`), so no leaf NATS instance is started by it today. Exits 0.
2. **Job runs** — agents write events to the spool via SDK hooks; the leaf node buffers and forwards to the cluster hub.
3. **Epilog** — calls `nats stream flush --timeout=${NOVAFABRIC_EPILOG_FLUSH_TIMEOUT:-50}s` to drain the spool, stops the leaf process. **Always exits 0** to prevent Slurm from draining the node.

**Lustre/NFS safety:** The spool uses `rename(2)` as its only atomic commit primitive. No `flock`, `mmap`, or `fcntl` calls are used — these are unsafe on shared network filesystems. On nodes without local NVMe, set `NOVAFABRIC_HPC_STORAGE=spool` to use the JSONL spool as the NATS leaf store directory.

**Reference:** `deploy/hpc/README.md`, `deploy/hpc/ansible/`, ADR-0028, ADR-0043.

---

## HPC runner commands (v0.16)

### PBSRunner (Python API)

Run a capsule job on a PBS/Torque cluster:

```python
from novafabric.runners import PBSRunner
from novafabric.runners.spec import RunnerSpec

runner = PBSRunner(RunnerSpec(image=None, command=["python", "agent.py"]))
result = runner.run(capsule_dir=Path(".novafabric/runs/01HXAY7M"))
```

The runner submits via `qsub`, polls via `qstat`, and cancels via `qdel` on timeout or signal. Job script is injected at `PBS_JOBSCRIPT`. A job that `qstat -f` no longer lists is looked up with `qstat -x -f` (OpenPBS shows finished jobs only there; Torque's XML form is read too), and OpenPBS's `Exit_status` is read as the exit code. Logs are written to `stdout.<run_id>.log` / `stderr.<run_id>.log` in `output_dir`, so captures sharing an `output_dir` never read each other's output. Releases up to v0.107.0 polled a finished OpenPBS job until the timeout and used one `stdout.log` for every job.

### LSFRunner (Python API)

Run a capsule job on an IBM Spectrum LSF cluster:

```python
from novafabric.runners import LSFRunner

runner = LSFRunner(RunnerSpec(image=None, command=["python", "agent.py"]))
result = runner.run(capsule_dir=Path(".novafabric/runs/01HXAY7M"))
```

The runner submits via `bsub`, polls via `bjobs`, and cancels via `bkill`. The job script shell-quotes every exported value (the capsule path, `PYTHONPATH`, `extra_env`); `#BSUB` directive values cannot be quoted, so a `job_name`, `queue`, `walltime` or `output_dir` (which defaults to the capsule directory) containing whitespace or a line break is refused with `failed_setup` before anything is submitted, and `resource_requirement` is wrapped in double quotes. The PBS runner applies the same rules to its `#PBS` lines. Releases up to v0.107.0 interpolated these unquoted, so a capsule path with a space silently produced an empty capture. Only the job's own `stdout.<jobid>.log` / `stderr.<jobid>.log` is read; a missing one is empty (releases up to v0.107.0 fell back to another job's log in a shared `output_dir`). The job script is piped to `bsub` on stdin; it is never written to disk or put on a command line, because it carries the `extra_env` values.

---
