Skip to content

Commit 7fbe239

Browse files
authored
docs: fix docs build and add migration skill (#148)
#### Overview Fix the documentation build configuration and add a migration skill for updating NeMo Flow references and APIs to NeMo Relay. - [x] I confirm this contribution is my own work, or I have the right to submit it under this project's license. - [x] I searched existing issues and open pull requests, and this does not duplicate existing work. #### Details - Adds blame-ignore entries for repository-wide rename and migration revisions. - Updates `docs/conf.py` so generated API docs build cleanly with the renamed package surfaces. - Registers the new migration skill in `skills/README.md`. - Adds `skills/nemo-relay-migrate-from-flow/` with workflow guidance and a helper script for migrating NeMo Flow names, imports, package references, and docs text to NeMo Relay. - Validation: `just docs` passed. - Breaking changes: none. #### Where should the reviewer start? Start with `docs/conf.py` for the docs-build behavior, then review `skills/nemo-relay-migrate-from-flow/SKILL.md` and `skills/nemo-relay-migrate-from-flow/scripts/migrate_from_nemo_flow.py` for the migration workflow and helper implementation. #### Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to) - Relates to: none ## Summary by CodeRabbit ## Release Notes * **New Features** * Added an automated migration tool to help transition NeMo Flow codebases to NeMo Relay, supporting identifier renaming, file path restructuring, and verification workflows. * **Documentation** * Added comprehensive migration skill documentation with step-by-step instructions, language-specific cleanup guidance, and best practices for upgrading from NeMo Flow to NeMo Relay. [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/NVIDIA/NeMo-Relay/pull/148?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) Authors: - Will Killian (https://github.com/willkill07) Approvers: - David Gardner (https://github.com/dagardner-nv) URL: #148
1 parent 8f096e7 commit 7fbe239

5 files changed

Lines changed: 471 additions & 7 deletions

File tree

.git-blame-ignore-revs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# refactor: rename to NeMo Relay (#141)
5+
8f096e7f7aac9a7bcad069bae310c37a7499a802

docs/conf.py

Lines changed: 64 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,38 @@
1010
import shutil
1111
import subprocess
1212
from pathlib import Path
13+
from typing import NamedTuple
1314

1415
import sphinx_js
1516
from packaging.version import InvalidVersion, Version
1617

17-
project = "NVIDIA NeMo Relay"
18+
19+
class _RuntimeDocsProfile(NamedTuple):
20+
project_title: str
21+
github_url: str
22+
python_module: str
23+
rust_core_crate: str
24+
rust_adaptive_crate: str
25+
26+
27+
_RELAY_RUNTIME_DOCS_PROFILE = _RuntimeDocsProfile(
28+
project_title="NVIDIA NeMo Relay",
29+
github_url="https://github.com/NVIDIA/NeMo-Relay",
30+
python_module="nemo_relay",
31+
rust_core_crate="nemo-relay",
32+
rust_adaptive_crate="nemo-relay-adaptive",
33+
)
34+
_FLOW_RUNTIME_DOCS_PROFILE = _RuntimeDocsProfile(
35+
project_title="NVIDIA NeMo Flow",
36+
github_url="https://github.com/NVIDIA/NeMo-Flow",
37+
python_module="nemo_flow",
38+
rust_core_crate="nemo-flow",
39+
rust_adaptive_crate="nemo-flow-adaptive",
40+
)
41+
_DEFAULT_RUNTIME_DOCS_PROFILE = _RELAY_RUNTIME_DOCS_PROFILE
42+
43+
44+
project = _DEFAULT_RUNTIME_DOCS_PROFILE.project_title
1845
copyright = "Copyright (c) 2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved."
1946
author = "NVIDIA CORPORATION & AFFILIATES"
2047

@@ -112,7 +139,7 @@
112139
rust_generate_mode = "always"
113140

114141
html_theme = "nvidia_sphinx_theme"
115-
html_title = "NVIDIA NeMo Relay"
142+
html_title = _DEFAULT_RUNTIME_DOCS_PROFILE.project_title
116143
html_static_path = ["_static"]
117144
html_css_files = ["extra.css"]
118145
html_js_files = ["version-switcher.js"]
@@ -129,7 +156,7 @@
129156
"icon_links": [
130157
{
131158
"name": "GitHub",
132-
"url": "https://github.com/NVIDIA/NeMo-Relay",
159+
"url": _DEFAULT_RUNTIME_DOCS_PROFILE.github_url,
133160
"icon": "fa-brands fa-github",
134161
}
135162
],
@@ -363,11 +390,41 @@ def _resolve_runtime_paths(source_docs_dir: Path) -> None:
363390
SPHINX_JS_WORK_DIR = DOCS_DIR / "_build" / ".tooling" / "sphinx-js"
364391

365392

393+
def _detect_runtime_docs_profile(repo_root: Path) -> _RuntimeDocsProfile:
394+
# sphinx-multiversion runs the current conf.py against historical source
395+
# trees, so API package names must come from the source tree being built.
396+
if (repo_root / "python" / _RELAY_RUNTIME_DOCS_PROFILE.python_module).is_dir():
397+
return _RELAY_RUNTIME_DOCS_PROFILE
398+
if (repo_root / "python" / _FLOW_RUNTIME_DOCS_PROFILE.python_module).is_dir():
399+
return _FLOW_RUNTIME_DOCS_PROFILE
400+
401+
raise RuntimeError(
402+
"Unable to locate a Python package for docs generation. "
403+
f"Expected {repo_root / 'python' / _RELAY_RUNTIME_DOCS_PROFILE.python_module} "
404+
f"or {repo_root / 'python' / _FLOW_RUNTIME_DOCS_PROFILE.python_module}."
405+
)
406+
407+
408+
def _with_runtime_github_url(theme_options, github_url: str):
409+
updated_options = dict(theme_options)
410+
icon_links = [dict(link) for link in updated_options.get("icon_links", [])]
411+
for link in icon_links:
412+
if link.get("name") == "GitHub":
413+
link["url"] = github_url
414+
break
415+
updated_options["icon_links"] = icon_links
416+
return updated_options
417+
418+
366419
def _wire_runtime_config(config) -> None:
367-
config.autoapi_dirs = [str(REPO_ROOT / "python" / "nemo_relay")]
420+
profile = _detect_runtime_docs_profile(REPO_ROOT)
421+
config.project = profile.project_title
422+
config.html_title = profile.project_title
423+
config.html_theme_options = _with_runtime_github_url(config.html_theme_options, profile.github_url)
424+
config.autoapi_dirs = [str(REPO_ROOT / "python" / profile.python_module)]
368425
config.rust_crates = {
369-
"nemo-relay": str(RUST_API_SOURCE_DIR / "core"),
370-
"nemo-relay-adaptive": str(RUST_API_SOURCE_DIR / "adaptive"),
426+
profile.rust_core_crate: str(RUST_API_SOURCE_DIR / "core"),
427+
profile.rust_adaptive_crate: str(RUST_API_SOURCE_DIR / "adaptive"),
371428
}
372429
config.rust_doc_dir = str(RUST_API_GENERATED_DIR)
373430

@@ -465,7 +522,7 @@ def _nemo_relay_mangle_signature(sig: str, *args, **kwargs) -> str:
465522

466523

467524
def _skip_imported_type_aliases(_app, what, _name, obj, skip, _options):
468-
if what == "module" and getattr(obj, "id", None) == "nemo_relay._native":
525+
if what == "module" and getattr(obj, "id", None) in {"nemo_relay._native", "nemo_flow._native"}:
469526
return False
470527

471528
if skip:

skills/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ documentation, embed those details directly in the skill.
1919
Use these skills for tasks such as:
2020

2121
- Getting started with a binding
22+
- Migrating NeMo Flow codebases to NeMo Relay
2223
- Instrumenting tool and LLM calls
2324
- Choosing the current primary documentation track: Rust, Python, or Node.js
2425
- Tuning performance with adaptive features
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
name: nemo-relay-migrate-from-flow
3+
description: Migrate applications, examples, integrations, documentation, package manifests, and repository code from NeMo Flow naming and packages to NeMo Relay across Python, Rust, Node.js, Go, WebAssembly, C FFI, CLI, config, and observability surfaces; use when a user asks to rename nemo_flow/nemo-flow/NeMo Flow APIs, automate a migration, update imports or dependencies, or validate a Flow-to-Relay conversion
4+
license: Apache-2.0
5+
---
6+
7+
# Migrate From NeMo Flow To NeMo Relay
8+
9+
Use this skill when a user has existing NeMo Flow code or documentation and
10+
wants it converted to NeMo Relay. Treat the migration as a mechanical rename
11+
plus language-specific validation, not a behavior rewrite.
12+
13+
## Default Workflow
14+
15+
1. Inspect the working tree and identify touched surfaces: Rust, Python,
16+
Node.js, Go, WebAssembly, C FFI, CLI/config, docs, or integration patches.
17+
2. Run the bundled helper in dry-run mode before editing:
18+
`python skills/nemo-relay-migrate-from-flow/scripts/migrate_from_nemo_flow.py <path> --rename-paths`
19+
3. Review the reported text edits and path renames. If the scope is correct,
20+
rerun with `--write --rename-paths`.
21+
4. Apply language-specific cleanup for package manager lockfiles, generated
22+
artifacts, and public API examples.
23+
5. Search for remaining Flow names and verify the affected language surfaces.
24+
25+
## Mechanical Rename Map
26+
27+
- Brand and repository: `NeMo Flow` -> `NeMo Relay`,
28+
`NeMo-Flow` -> `NeMo-Relay`
29+
- Python: `nemo-flow` -> `nemo-relay`, `nemo_flow` -> `nemo_relay`,
30+
`python/nemo_flow` -> `python/nemo_relay`
31+
- Rust: `nemo-flow` -> `nemo-relay`, `nemo-flow-adaptive` ->
32+
`nemo-relay-adaptive`, `nemo_flow::` -> `nemo_relay::`
33+
- Node.js and WebAssembly: `nemo-flow-node` -> `nemo-relay-node`,
34+
`nemo-flow-wasm` -> `nemo-relay-wasm`, and related entry points such as
35+
`/typed`, `/plugin`, `/adaptive`, and `/observability`
36+
- Go: `github.com/NVIDIA/NeMo-Flow/go/nemo_flow` ->
37+
`github.com/NVIDIA/NeMo-Relay/go/nemo_relay`, package aliases
38+
`nemo_flow` -> `nemo_relay`, and source directories `go/nemo_flow` ->
39+
`go/nemo_relay`
40+
- C FFI: `nemo_flow.h` -> `nemo_relay.h`, `nemo_flow_*` ->
41+
`nemo_relay_*`, `NemoFlow*` -> `NemoRelay*`, and `NEMO_FLOW_*` ->
42+
`NEMO_RELAY_*`
43+
- CLI/config: `nemo-flow` -> `nemo-relay`, `.nemo-flow` -> `.nemo-relay`,
44+
`~/.config/nemo-flow` -> `~/.config/nemo-relay`, `NEMO_FLOW_*` ->
45+
`NEMO_RELAY_*`, and `x-nemo-flow-*` -> `x-nemo-relay-*`
46+
47+
Do not replace bare `flow`, `Flow`, or `FlowError`. Those can be domain words
48+
or intentional compatibility names.
49+
50+
## Language Cleanup
51+
52+
- **Python**: update `pyproject.toml`, imports, type stubs, integration
53+
package paths, extras, and native module names. Regenerate or refresh lockfiles
54+
with the user's package workflow after source edits.
55+
- **Rust**: update `Cargo.toml` crate names, workspace dependencies, package
56+
references, and `use nemo_relay::...` imports. Let Cargo regenerate
57+
`Cargo.lock` when dependencies changed.
58+
- **Node.js**: update `package.json`, workspace names, package-lock entries,
59+
native addon artifact names, and imports from `nemo-relay-node` or
60+
`nemo-relay-wasm`. Run the package manager to refresh locks.
61+
- **Go**: update `go.mod`, import paths, package declarations, aliases, and any
62+
local directory layout under `go/nemo_relay`.
63+
- **C FFI**: update header includes, exported symbol names, status and callback
64+
type names, macro constants, loader paths, and downstream bindings.
65+
- **Docs and examples**: update badges, package install commands, repository
66+
links, hosted docs URLs, CLI commands, config paths, and integration patch
67+
names.
68+
69+
## Automation Helper
70+
71+
Use `scripts/migrate_from_nemo_flow.py` for first-pass edits. It:
72+
73+
- runs as a dry run unless `--write` is passed
74+
- skips common vendor, build, cache, and generated directories
75+
- skips lockfiles unless `--include-lockfiles` is passed
76+
- can report or perform path renames with `--rename-paths`
77+
- rewrites only explicit NeMo Flow identifiers, package names, repository names,
78+
config paths, headers, environment variables, and FFI type prefixes
79+
80+
Run it from either the source repository or the user's target project:
81+
82+
```bash
83+
python skills/nemo-relay-migrate-from-flow/scripts/migrate_from_nemo_flow.py . --rename-paths
84+
python skills/nemo-relay-migrate-from-flow/scripts/migrate_from_nemo_flow.py . --write --rename-paths
85+
```
86+
87+
Use `--include-lockfiles` only when the user wants lockfiles edited directly;
88+
otherwise regenerate them with Cargo, uv/pip, npm, or Go tooling.
89+
90+
## Verification
91+
92+
- Search for remaining explicit Flow identifiers:
93+
`rg -n "NeMo Flow|NeMo-Flow|nemo_flow|nemo-flow|NEMO_FLOW|NemoFlow|nemo_flow\\.h|nemo_flow_"`
94+
- Run targeted tests for every affected language surface.
95+
- For Rust changes, run `cargo test` or the repository's Rust test recipe.
96+
- For Python changes, run the relevant import check and tests in the target
97+
environment.
98+
- For Node.js or WebAssembly changes, run package install, type checks, and
99+
package tests.
100+
- For Go changes, run `go test ./...` from the updated module.
101+
- For docs-only migrations, build or link-check docs if the site navigation,
102+
install commands, or API references changed.
103+
104+
## Related Skills
105+
106+
- `nemo-relay-start`
107+
- `nemo-relay-instrument-calls`
108+
- `nemo-relay-debug-runtime-integration`

0 commit comments

Comments
 (0)