Skip to content

CLI Reference

The build and publish scripts. Each takes a small set of flags; the rest of the work is path defaults.

scripts/build_managed.py

Thin wrapper around @common/scripts/build_managed.py. Forwards:

  • --csproj PATH — required.
  • --out DIR — output dir for dotnet publish.
  • --config PATH — path to config.json (for last_published.version).
  • --library-version V — override the semver base.

The wrapper adds the per-worker paths: - MANAGED_CSPROJWebSocketManagerController/src/Virtufin.Worker.WebSocketManagerController.Managed/Virtufin.Worker.WebSocketManagerController.Managed.csproj - CONFIGWebSocketManagerController/config/config.json - NUPKG_DIR../build/Virtufin.Worker.WebSocketManagerController.Managed.nupkg (the canonical output dir for the PackageWorker MSBuild target)

scripts/build_aot.py

Thin wrapper around @common/scripts/build_aot.py. Forwards:

  • --managed-csproj PATH — used to auto-discover the AOT csproj.
  • --rids RID1,RID2 — comma-separated (default linux-arm64,linux-x64).
  • --native-csproj PATH — override the auto-discovered AOT csproj.
  • --out DIR — per-RID AOT publish output.
  • --config PATH, --library-version V — same as the managed build.
  • --docker-image IMG — default docker.haenerconsulting.com/library/dotnet-crossbuild:10.0.

The wrapper adds: - MANAGED_CSPROJ → same as above. - NATIVE_CSPROJWebSocketManagerController/src/Virtufin.Worker.WebSocketManagerController.Native/Virtufin.Worker.WebSocketManagerController.Native.csproj. - NUPKG_DIR../build/Virtufin.Worker.WebSocketManagerController.Native.nupkg. - DEFAULT_OUT = os.environ.get("OUT", str(NUPKG_DIR)) — the OUT env var overrides the canonical dir.

scripts/build_both.sh

Thin shell orchestrator that calls build_managed.py and build_aot.py and combines. Flags:

  • --rids RID1,RID2 — comma-separated (default linux-arm64,linux-x64).
  • --out DIR — output dir for the combined nupkg (default ../build/Virtufin.Worker.WebSocketManagerController.nupkg.both/).
  • --no-clean — don't delete the output dir before building.
  • --skip-managed / --skip-aot — skip one of the sub-builds.

scripts/publish.py

Uploads the nupkg to the Gitea NuGet feed. Reads the Gitea credentials from the VIRTUFIN_PACKAGES_USER / VIRTUFIN_PACKAGES_TOKEN env vars. The last_published.version is updated after a successful upload. No flags.

scripts/smoke_test_aot.py

Verifies the AOT path end-to-end. Flags:

  • --rids RID — which RIDs to test (default linux-arm64).
  • --pull-image — pull the cross-build image first (may be slow / hang on slow networks).
  • --image IMG — override the cross-build image (default docker.haenerconsulting.com/library/dotnet-crossbuild:10.0).

Exit code: 0 on success, 1 on any failure.

examples/binance.py

The end-to-end demo. No CLI flags; all configuration via config.json and settings.binance.json in the worker root. Override env vars:

  • VIRTUFIN_LOCAL_API_URL — the API gateway host:port (default localhost:5002).
  • VIRTUFIN_CLUSTER_API_URL — the cluster-internal API gateway (for in-cluster runs).
  • USE_CLUSTER — set to 1 to use the cluster API URL.

See also