Skip to content

Make targets ​

The Makefile is the entry point for building, testing and running the local lab. This page lists the targets; the lab targets are covered in detail in Run the local lab.

Build & test ​

TargetWhat it does
make buildBuild the binary to bin/northwatch (ensures a UI dist exists first).
make ensure-ui-distEnsure a UI dist exists, writing a placeholder if the frontend has not been built. A prerequisite of make build.
make build-uiBuild the Svelte frontend (npm ci && npm run build).
make build-allbuild-ui then build.
make dev-uiRun the frontend dev server.
make testRun all Go tests with the race detector (go test -race ./...).
make coverage-checkBuild the merged coverage profile (same -coverpkg set as CI) and enforce the per-package 85% floor for the core packages via scripts/covcheck.sh.
make lintRun golangci-lint.
make vetRun go vet ./....
make docs-checkFail if a CLI flag or make target is undocumented in docs/reference/.
make cleanRemove bin/, dist/ (the .deb output) and frontend build artifacts.

Code generation ​

TargetWhat it does
make generateRegenerate the OVSDB models (NB, SB and Open_vSwitch) from the schemas, removing models of tables the schemas no longer have. Runs the modelgen version pinned in go.mod.
make schema-downloadDownload the pinned OVN NB/SB and Open_vSwitch schemas (OVN_VERSION / OVS_VERSION in the Makefile). The pins are the oldest supported releases; see Supported versions.
make openapi-exportWrite the OpenAPI spec to openapi.json.
make ovnsimBuild the ovnsim load generator to bin/ovnsim.

Packaging ​

TargetWhat it does
make debBuild a Debian .deb for linux/$(GOARCH) into dist/. Cross-builds the static binary, then runs nfpm.

make deb requires nfpm on PATH:

bash
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.47.0

Override the package version with VERSION (it defaults to git describe with the leading v stripped) and the target architecture with GOARCH:

bash
make deb VERSION=0.3.0 GOARCH=arm64

The package layout, install steps and service lifecycle are documented in Install on Debian/Ubuntu. On a tagged release the same .debs are built, signed and attached automatically by the release workflow.

macOS note ​

make unquarantine strips the macOS quarantine attribute from bin/northwatch* so a freshly built binary runs without a Gatekeeper prompt.

Lab targets ​

TargetWhat it does
make lab-compose-up / lab-compose-downStart / stop the Docker Compose lab. lab-compose-up reuses existing images (building only missing ones, with no forced rebuild), so it works without registry access once the images exist; add KERNEL=1 to layer in the kernel-datapath override.
make lab-compose-buildForce-rebuild the Compose lab images (needs registry access). Run after changing a Dockerfile or entrypoint.
make lab-composeCompose up, wait for OVN, then seed.
make lab-up / lab-downStart / stop the containerlab lab (Linux).
make lablab-up + lab-seed.
make lab-seedCreate the baseline OVN topology.
make lab-bind / lab-unbindBind / unbind seeded VIFs onto chassis.
make lab-reseedlab-clean + lab-seed + lab-bind.
make lab-simContinuously mutate the topology (foreground).
make lab-cleanRemove everything ovnsim created.
make lab-api-tokenGenerate a bearer token for the mutating routes into lab/.api-tokens.json (git-ignored) and print it with the matching --api-tokens-file start command. Idempotent; delete the file to rotate.
make lab-nbctl ARGS=... / lab-sbctl ARGS=...Run ovn-nbctl / ovn-sbctl in the central container.
make lab-multi-up / lab-multi-downStart / stop a second independent cluster.
make lab-imagesBuild the central and chassis images.
make lab-install-toolsInstall containerlab (Linux).

OSISM testbed ​

make testbed builds Northwatch and runs it against the OSISM testbed control plane, with OpenStack name resolution enabled and the Keystone API verified against the private testbed CA (contrib/testbed.pem, the clouds.yaml cacert). It connects to the three control-plane nodes with NB/SB failover and enables write operations by default. The target fails fast if the CA bundle at OS_CACERT is missing.

Every value is overridable on the command line, for example make testbed TESTBED_CP1=10.0.0.1 OS_PASSWORD=secret, or by sourcing an OpenStack RC file first (the OS_* defaults honour the environment):

VariableDefaultPurpose
TESTBED_CP1 / TESTBED_CP2 / TESTBED_CP3192.168.16.10 / .11 / .12Control-plane node addresses.
TESTBED_NBfailover across CP1/2/3:6641Northbound address.
TESTBED_SBfailover across CP1/2/3:6642Southbound address.
OS_AUTH_URL … OS_CACERTvalues from clouds.yamlOpenStack credentials and the CA bundle.
NORTHWATCH_WRITE_ENABLEDtrueEnable write operations.
NORTHWATCH_LISTEN:8080Dashboard / API listen address.
TESTBED_OVS_ENABLEDtrueEnable per-chassis OVS visibility (writes the mapping file and passes --ovs-mgmt-addr-file).
TESTBED_OVS_NODES0 1 2 3 4 5Node indices included in the OVS mapping.
TESTBED_OVS_IP_PREFIX / TESTBED_OVS_IP_BASE192.168.16 / 10Mgmt-addr IP is <prefix>.<base + index>.
TESTBED_OVS_NAME_PREFIX / TESTBED_OVS_PORTtestbed-node- / 6640Chassis system-id is <name-prefix><index>; OVSDB port.
TESTBED_OVS_MAP_FILEovs-mgmt-addr.testbed.jsonGenerated system-id → mgmt-addr mapping file.

make testbed-ovs-map (re)generates the OVS system-id → mgmt-addr mapping file on its own. Each chassis must export its OVSDB first (ovs-vsctl set-manager ptcp:6640); unreachable nodes are retried in the background and the reachable ones are served. The mapping uses plaintext tcp: addresses; ssl: endpoints also need the --ovs-tls-* flags.

Useful variables ​

VariableDefaultPurpose
NBtcp:127.0.0.1:6641Northbound address used by lab targets.
SBtcp:127.0.0.1:6642Southbound address used by lab targets.
LAB_NAMEnw-labLab name (container name prefix).
KERNEL(unset)KERNEL=1 layers in the kernel-datapath Compose override for real HA failover.
bash
# Re-seed a second lab cluster:
make lab-seed NB=tcp:127.0.0.1:6643

# Real HA failover on a Linux host:
make lab-compose-up KERNEL=1