Skip to content

fix: move nss jobs into plugin, update docs - #195

Merged
mckornfield merged 6 commits into
mainfrom
nss-docs/mck
Jun 8, 2026
Merged

fix: move nss jobs into plugin, update docs#195
mckornfield merged 6 commits into
mainfrom
nss-docs/mck

Conversation

@mckornfield

@mckornfield mckornfield commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added Safe Synthesizer SDK: resources (sync/async jobs), SafeSynthesizerJob wrapper (polling/status/logs/data/summary/report/Notebook display), ReportHtml, and a fluent SafeSynthesizerJobBuilder for building/submitting jobs and reusing pretrained jobs.
  • Bug Fixes
    • Fixed pretrained-model config handling at runtime and tightened local-run env isolation to avoid leaking parent context.
  • Documentation
    • Revised tutorials, CLI/README, workflows, and site nav to clarify local vs platform flows and document SDK.
  • Tests / Chores
    • Added unit tests, packaging entry points, and third‑party license entries.

@mckornfield
mckornfield requested review from a team as code owners June 4, 2026 22:07
Signed-off-by: mkornfield <mkornfield@nvidia.com>
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 18720/24769 75.6% 62.1%
Integration Tests 11999/23533 51.0% 26.2%

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Documentation preview is ready

Preview: https://nvidia-nemo.github.io/nemo-platform/pr-preview/pr-195/pr-195/

Built from b27c305 in workflow run.

This preview is deployed from this PR branch, updates when docs changes are pushed, and will be removed when the PR closes.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Lost in the diff? Review this PR in Change Stack to follow the change map from intent to exact ranges.

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds Safe Synthesizer plugin SDK (resources, job builder, job wrapper), job-config validators for pretrained-adapter reuse, tests, packaging/entry-point and manifest updates, and documentation clarifying local execution and Jobs API/SDK workflows.

Changes

Safe Synthesizer SDK rollout

Layer / File(s) Summary
SDK foundation utilities
plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/http_utils.py, plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/config.py
Adds HTTP URL/helpers (base_url, resolve_workspace, url, job-route builders) and re-exports config types with guarded imports.
Sync and async SDK resources
plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/resources.py, plugins/nemo-safe-synthesizer/pyproject.toml, packages/nemo_platform/pyproject.toml
Implements SafeSynthesizerJobsResource and AsyncSafeSynthesizerJobsResource (create/list/retrieve/status/logs), error-detail enrichment, JSON->object wrappers, and registers nemo.sdk entry points.
Job wrapper and report helpers
plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/job.py
Adds ReportHtml and SafeSynthesizerJob helpers for status polling, incremental log streaming, and downloading/parsing summary/report/synthetic-data.
Fluent job builder and dataset upload
plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/job_builder.py
Implements SafeSynthesizerJobBuilder: DataFrame/file inputs, temp CSV upload to fileset, spec assembly (data/train/generate/evaluate/DP/time-series/PII), HF token secret, pretrained adapter reuse, and create_job submission.
Runtime job-config and pretrained reuse
plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/job_config.py, plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/api/v2/jobs/endpoints.py, plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/tasks/safe_synthesizer/__main__.py
Adds SafeSynthesizerParameters/JobConfig with validators, parse_pretrained_model_job_ref, and _runtime_job_config to strip nested training.pretrained_model when pretrained_model_job is supplied.
SDK and builder unit tests
plugins/nemo-safe-synthesizer/tests/unit/test_sdk.py, plugins/nemo-safe-synthesizer/tests/unit/test_jobs.py
Adds tests covering resource routing/payloads, error detail propagation, async logs, builder upload/spec behavior, pretrained-adapter reuse, job polling terminal states, data/summary/report downloads, and log pagination.
Local execution docs and README
docs/safe-synthesizer/about/host-local-development.md, plugins/nemo-safe-synthesizer/README.md, docs/safe-synthesizer/getting-started.md
Reframes host-local docs as “Local and Subprocess Execution”, documents managed subprocess vs direct task invocation, runtime-Python discovery, and clarifies --data-source behavior.
Docs: SDK import updates & tutorials
docs/safe-synthesizer/about/jobs.md, docs/safe-synthesizer/about/reference.md, docs/safe-synthesizer/tutorials/*, docs/safe-synthesizer/sdk-resources.md
Updates examples to import from nemo_safe_synthesizer_plugin.sdk.*, revises tutorials for provider/token handling and adapter-reuse workflows, and adds SDK resources page.
Docs: Workflows use Jobs API/SDK
plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/skills/safe-synthesizer/workflows/*.md
Replaces CLI-first job submission/status examples with Jobs API/SDK guidance and adds CLI resolution steps.
Documentation site config & navigation
mkdocs.yml, docs/_snippets/nvidia-build-model-provider.md, docs/safe-synthesizer/.gitignore
Adjusts nav/hiding rules, updates NVIDIA provider snippet to default/nvidia-build, and ignores generated tutorials/evaluation_report.html.
Packaging / plugin enablement / manifests
plugins/nemo-safe-synthesizer/pyproject.toml, packages/nemo_platform/pyproject.toml, pyproject.toml, third_party/*, packages/nemo_platform/BUNDLING.md
Registers plugin SDK entry points, enables plugin in enabled-plugins, adds nemo-safe-synthesizer requirement and license/OSV entries, and removes safe_synthesizer_sdk from BUNDLING doc.

Possibly related PRs

Suggested reviewers

  • tylersbray
  • ironcommit
  • SandyChapman
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 53.19% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: moving Safe Synthesizer jobs into the plugin while updating related documentation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch nss-docs/mck

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/safe-synthesizer/about/host-local-development.md`:
- Line 4: Add a blank line before the heading text "# Local and Subprocess
Execution" in the file to satisfy MD022; locate the heading string and insert
one empty line immediately above it so the heading is separated from prior
content.

In `@docs/safe-synthesizer/tutorials/safe-synthesizer-101.md`:
- Around line 77-79: The error message hardcodes product and plugin names;
replace the literal strings "Safe Synthesizer" and "safe-synthesizer" in the
quoted message with the appropriate Sphinx substitutions (e.g. |product| or the
project-specific substitution such as |safe_synthesizer_plugin|) so docs use
configured substitutions consistently; update the three concatenated string
pieces to use the substitution tokens (keeping the same wording and path
structure but substituting the product/plugin tokens) so Sphinx renders the
correct product name across builds.
- Around line 123-124: The current code assumes provider_name contains "/",
causing split("/", 1) to crash for unqualified names; update the logic around
provider_name, provider_workspace, and provider_id so both "provider" and
"workspace/provider" work: if "/" in provider_name then split into
provider_workspace and provider_id, otherwise set provider_id = provider_name
and provider_workspace = None (or an empty value), and call
client.inference.providers.retrieve(provider_id, workspace=provider_workspace)
only when provider_workspace is present (or pass None/omit the workspace
argument as appropriate).

In `@mkdocs.yml`:
- Around line 222-229: Remove the two hidden_docs.paths entries that reference
host-local-development.md and safe-synthesizer-101.md so those files are no
longer included in hidden_docs.paths; specifically edit the mkdocs.yml
hidden_docs.paths list to delete the items
"safe-synthesizer/tutorials/host-local-development.md" and
"safe-synthesizer/tutorials/safe-synthesizer-101.md" (or the exact matching path
strings present) so the hide_unready_docs.py hook no longer filters them out and
the nav entries for host-local-development.md and safe-synthesizer-101.md remain
usable.

In
`@plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/job_builder.py`:
- Around line 159-163: The path branch currently forces all file-path sources
through pd.read_csv which will break parquet/json/jsonl inputs; update the
loader in the method using self._data_source (in job_builder.py / JobBuilder or
the method containing that if-block) to detect the file type via
Path(self._data_source).suffix.lower() and call the appropriate pandas reader:
pd.read_parquet for .parquet, pd.read_json(..., lines=True) for .jsonl,
pd.read_json for .json, and pd.read_csv for .csv (fall back to pd.read_csv for
unknown extensions or raise a clear error). Apply the same change to the other
identical branch around the later occurrence (the block at the 235-240 region).

In `@plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/job.py`:
- Around line 98-103: The status-change prints execute unconditionally (using
current_status_info and previous_status_info), ignoring the verbose flag; wrap
the print block so it only executes when the function/class-level verbose is
True (e.g., if verbose: or if self.verbose:) and ensure the surrounding function
(where current_status_info/previous_status_info are compared) accepts or
references that verbose flag so behavior is unchanged when verbose is False.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: a2f01659-19de-4e38-b14a-6be48c8f8b2b

📥 Commits

Reviewing files that changed from the base of the PR and between 9a7c377 and 2baf8e4.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (28)
  • docs/_snippets/nvidia-build-model-provider.md
  • docs/safe-synthesizer/.gitignore
  • docs/safe-synthesizer/about/host-local-development.md
  • docs/safe-synthesizer/about/jobs.md
  • docs/safe-synthesizer/about/reference.md
  • docs/safe-synthesizer/getting-started.md
  • docs/safe-synthesizer/llms.txt
  • docs/safe-synthesizer/tutorials/differential-privacy.md
  • docs/safe-synthesizer/tutorials/safe-synthesizer-101.md
  • mkdocs.yml
  • packages/nemo_platform/pyproject.toml
  • plugins/nemo-safe-synthesizer/README.md
  • plugins/nemo-safe-synthesizer/pyproject.toml
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/api/v2/jobs/endpoints.py
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/config.py
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/http_utils.py
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/job.py
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/job_builder.py
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/resources.py
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/skills/safe-synthesizer/workflows/diagnose.md
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/skills/safe-synthesizer/workflows/results.md
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/skills/safe-synthesizer/workflows/run.md
  • plugins/nemo-safe-synthesizer/tests/unit/test_jobs.py
  • plugins/nemo-safe-synthesizer/tests/unit/test_sdk.py
  • pyproject.toml
  • third_party/licenses.jsonl
  • third_party/osv-licenses.json
  • third_party/requirements-main.txt

Comment thread docs/safe-synthesizer/about/host-local-development.md
Comment thread docs/safe-synthesizer/tutorials/safe-synthesizer-101.md Outdated
Comment thread docs/safe-synthesizer/tutorials/safe-synthesizer-101.md Outdated
Comment thread mkdocs.yml Outdated
Comment thread plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/job.py Outdated
Signed-off-by: mkornfield <mkornfield@nvidia.com>
Comment thread plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/job_builder.py Dismissed

@anastasia-nesterenko anastasia-nesterenko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some nit-picks

Comment thread docs/safe-synthesizer/tutorials/safe-synthesizer-101.md
Comment thread docs/safe-synthesizer/about/jobs.md Outdated
Comment thread docs/safe-synthesizer/about/reference.md Outdated

@tylersbray tylersbray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agent (pr-review): Full review summary

Solid PR overall — plugin SDK relocation, _runtime_job_config, and scheduler workspace fix are the right moves. Inline comments below are ordered roughly by severity.

Merge blockers / high priority

  1. safe-synthesizer-101.md — classify provider configured but never submitted (missing .with_replace_pii())
  2. nvidia-build-model-provider.mddefault/ vs system/ workspace mismatch with platform-seed

Should fix in this PR
3. Stale "Host-Local Development and Testing" link titles in jobs.md, reference.md, about/index.md
4. Add docs/safe-synthesizer/sdk-resources.md (parity with anonymizer/evaluator/data-designer)
5. AsyncSafeSynthesizerJobsResource.get_logs should be async def
6. Expand tests for SafeSynthesizerJob and _runtime_job_config edge cases

Confirm intent / lower priority
7. mkdocs.yml nav pruning — jobs/reference/DP tutorial removed from published nav
8. job_builder.pywith_classify_model_provider() only applies when PII replacement enabled
9. job.py — broad except Exception in wait_for_completion
10. config.py — silent ImportError leaves empty __all__
11. packages/nemo_platform/BUNDLING.md still references removed safe_synthesizer_sdk vendoring (file not in this PR)

Looks good

  • enabled-plugins addition, SDK entry points, test_sdk.py resource/builder coverage, scheduler workspace test

Comment thread docs/safe-synthesizer/tutorials/safe-synthesizer-101.md
Comment thread docs/_snippets/nvidia-build-model-provider.md Outdated
Comment thread docs/safe-synthesizer/about/jobs.md
Comment thread docs/safe-synthesizer/about/reference.md
Comment thread mkdocs.yml
Comment thread plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/job.py Outdated
Comment thread plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/config.py Outdated
Comment thread pyproject.toml

@tylersbray tylersbray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments...

Signed-off-by: mkornfield <mkornfield@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
docs/safe-synthesizer/sdk-resources.md (1)

10-57: ⚖️ Poor tradeoff

Add CLI examples alongside Python SDK examples.

Coding guidelines require both Python SDK and CLI examples in tab-sets. Document CLI equivalents for job creation and monitoring where available.

As per coding guidelines, provide both Python SDK and CLI examples in tab-sets for consistency and to support multiple user workflows.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/safe-synthesizer/sdk-resources.md` around lines 10 - 57, Add CLI
examples next to the Python SDK examples using tab-sets: keep the existing
Python block (NeMoPlatform and SafeSynthesizerJobBuilder usage) and add a
parallel CLI tab that shows equivalent commands for client.safe_synthesizer
operations (create/list/retrieve/get_status/get_logs) and for the
SafeSynthesizerJobBuilder flow (upload/data-source, synthesize, create-job),
naming commands and flags that map to the SDK method signatures (create with
--spec/--name/--workspace/--project/--timeout, list with --workspace,
retrieve/get_status/get_logs with <name> and --workspace, plus CLI flags for
classify model provider and replace-pii used in the builder). Ensure the docs
mention the async namespace only for SDK and keep CLI examples in their own tab,
matching the same examples/parameters and brief usage notes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/safe-synthesizer/about/index.md`:
- Line 109: The Markdown list item "-   **[Local and Subprocess
Execution](host-local-development.md)**" has three spaces after the list marker;
change it so there is exactly one space after the dash (i.e., "- **[Local and
Subprocess Execution](host-local-development.md)**") to conform to Markdown list
spacing conventions.

---

Nitpick comments:
In `@docs/safe-synthesizer/sdk-resources.md`:
- Around line 10-57: Add CLI examples next to the Python SDK examples using
tab-sets: keep the existing Python block (NeMoPlatform and
SafeSynthesizerJobBuilder usage) and add a parallel CLI tab that shows
equivalent commands for client.safe_synthesizer operations
(create/list/retrieve/get_status/get_logs) and for the SafeSynthesizerJobBuilder
flow (upload/data-source, synthesize, create-job), naming commands and flags
that map to the SDK method signatures (create with
--spec/--name/--workspace/--project/--timeout, list with --workspace,
retrieve/get_status/get_logs with <name> and --workspace, plus CLI flags for
classify model provider and replace-pii used in the builder). Ensure the docs
mention the async namespace only for SDK and keep CLI examples in their own tab,
matching the same examples/parameters and brief usage notes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 8218c7dd-ef80-45a0-b5bd-e48ef1360886

📥 Commits

Reviewing files that changed from the base of the PR and between 4ebd512 and 1bda39a.

📒 Files selected for processing (18)
  • docs/_snippets/nvidia-build-model-provider.md
  • docs/safe-synthesizer/about/index.md
  • docs/safe-synthesizer/about/jobs.md
  • docs/safe-synthesizer/about/reference.md
  • docs/safe-synthesizer/getting-started.md
  • docs/safe-synthesizer/sdk-resources.md
  • docs/safe-synthesizer/tutorials/safe-synthesizer-101.md
  • mkdocs.yml
  • packages/nemo_platform/BUNDLING.md
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/api/v2/jobs/endpoints.py
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/job_config.py
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/config.py
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/job.py
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/job_builder.py
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/resources.py
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/tasks/safe_synthesizer/__main__.py
  • plugins/nemo-safe-synthesizer/tests/unit/test_jobs.py
  • plugins/nemo-safe-synthesizer/tests/unit/test_sdk.py
✅ Files skipped from review due to trivial changes (6)
  • docs/safe-synthesizer/about/jobs.md
  • packages/nemo_platform/BUNDLING.md
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/tasks/safe_synthesizer/main.py
  • docs/_snippets/nvidia-build-model-provider.md
  • docs/safe-synthesizer/getting-started.md
  • docs/safe-synthesizer/tutorials/safe-synthesizer-101.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • docs/safe-synthesizer/about/reference.md
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/api/v2/jobs/endpoints.py
  • mkdocs.yml
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/resources.py
  • plugins/nemo-safe-synthesizer/src/nemo_safe_synthesizer_plugin/sdk/job.py

Comment thread docs/safe-synthesizer/about/index.md
Signed-off-by: mkornfield <mkornfield@nvidia.com>
Signed-off-by: mkornfield <mkornfield@nvidia.com>
@mckornfield
mckornfield enabled auto-merge June 8, 2026 16:22
@mckornfield
mckornfield added this pull request to the merge queue Jun 8, 2026
Merged via the queue into main with commit b363d97 Jun 8, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants