fix(jobs): forward transformed plugin job specs in JSON mode - #748
Merged
Conversation
Cloudpickle metric bundles embed non-UTF-8 bytes in EvaluateSpec payloads. Dumping the transformed spec in Python mode left raw bytes in the body forwarded to core jobs, causing PydanticSerializationError and HTTP 500 on evaluator durable-job submit. Use model_dump(mode="json") so binary fields serialize as base64. NVBugs #6466868 Signed-off-by: Arpit Singh (SW-CLOUD) <arpsingh@nvidia.com>
Signed-off-by: Arpit Singh (SW-CLOUD) <arpsingh@nvidia.com>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughChangesJob specification JSON serialization
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@packages/nemo_platform_plugin/src/nemo_platform_plugin/jobs/api_factory.py`:
- Around line 876-877: Update the transformed-spec handling around job_spec and
spec_dict to enforce JSON-safe output for both BaseModel and raw-dict results
before constructing the SDK body. Configure or apply base64 normalization for
binary fields, including non-UTF-8 bytes, and validate raw transformer
dictionaries rather than passing them through unchanged.
🪄 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: 708c7baf-71bd-433a-8a3a-09c9772b6ce3
📒 Files selected for processing (2)
packages/nemo_platform_plugin/src/nemo_platform_plugin/jobs/api_factory.pypackages/nemo_platform_plugin/tests/test_jobs_create_spec_json.py
Contributor
|
ngoncharenko
approved these changes
Jul 17, 2026
soluwalana
pushed a commit
that referenced
this pull request
Jul 17, 2026
* fix(jobs): forward transformed plugin job specs in JSON mode Cloudpickle metric bundles embed non-UTF-8 bytes in EvaluateSpec payloads. Dumping the transformed spec in Python mode left raw bytes in the body forwarded to core jobs, causing PydanticSerializationError and HTTP 500 on evaluator durable-job submit. Use model_dump(mode="json") so binary fields serialize as base64. NVBugs #6466868 Signed-off-by: Arpit Singh (SW-CLOUD) <arpsingh@nvidia.com> * chore: remove unused AsyncMock import in jobs spec JSON test Signed-off-by: Arpit Singh (SW-CLOUD) <arpsingh@nvidia.com> --------- Signed-off-by: Arpit Singh (SW-CLOUD) <arpsingh@nvidia.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EvaluateSpec).model_dump(mode="json")before forwarding to core jobs sobytesfields serialize as base64 instead of raw bytes.Fixes: https://nvbugspro.nvidia.com/bug/6466868
Root cause
The generated plugin
create_jobroute re-dumped transformed specs in Python mode. Cloudpickle metric bundleblobfields stayed as raw bytes, which failed JSON serialization in the typed jobs client (PydanticSerializationError: invalid utf-8 sequence).Test plan
uv run --frozen pytest packages/nemo_platform_plugin/tests/test_jobs_create_spec_json.py -vuv run python repro_cloudpickle_eval.pyagainst a live local platform (optional manual check)NVBugs #6466868
Summary by CodeRabbit