feat(files): Add OTLP to new nemoclient endpoints - #576
Conversation
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
📝 WalkthroughWalkthroughRemoves the Stainless SDK's ChangesOTLP Logs Client Migration
Sequence Diagram(s)sequenceDiagram
participant Caller
participant JobLogsClient
participant AsyncFilesClient
Caller->>JobLogsClient: query_logs(filters, limit, page_cursor)
JobLogsClient->>AsyncFilesClient: query_otlp_logs(name, workspace, body)
AsyncFilesClient-->>JobLogsClient: resp
JobLogsClient-->>Caller: resp.data()
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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/files/endpoints.py`:
- Around line 95-97: The OTLP logs upload path is missing the request payload,
so the parsed log content is never sent. Update the `upload_otlp_logs` abstract
method in `endpoints.py` to accept a payload/body argument, then thread that
value through the CLI command in
`nemo_platform_ext/cli/commands/api/files/otlp/logs.py` so the parsed
`--input-file/--input-data` content is passed into the upload call. Make sure
the implementation and interface stay aligned for `upload_otlp_logs` and the
related request-building code.
🪄 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: f5d9eea2-96db-4be4-8ada-9c62efd2d429
⛔ Files ignored due to path filters (1)
sdk/python/nemo-platform/src/nemo_platform/filesets/resources.pyis excluded by!sdk/**
📒 Files selected for processing (7)
packages/filesets/src/filesets/resources.pypackages/nemo_platform_ext/src/nemo_platform_ext/cli/commands/api/files/otlp/logs.pypackages/nemo_platform_plugin/src/nemo_platform_plugin/files/client.pypackages/nemo_platform_plugin/src/nemo_platform_plugin/files/endpoints.pypackages/nemo_platform_plugin/src/nemo_platform_plugin/files/types.pypackages/nmp_common/src/nmp/common/jobs/log_client.pypackages/nmp_common/tests/jobs/test_log_client.py
💤 Files with no reviewable changes (1)
- packages/filesets/src/filesets/resources.py
|
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
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/files/endpoints.py`:
- Around line 97-99: The shared upload signature still allows
AsyncIterable[bytes], but FilesClient passes request.content into
httpx.Client.request(), which only supports bytes or sync iterables. Update
upload_otlp_logs to remove AsyncIterable[bytes] from this shared endpoint
signature, and keep async streaming separate if needed by a different path or
overload. Make sure the types used by upload_otlp_logs and any callers in the
FilesClient flow match the actual httpx.Client.request() contract.
🪄 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: 6e666ead-ea62-4161-9b07-cd52abe7cf86
📒 Files selected for processing (1)
packages/nemo_platform_plugin/src/nemo_platform_plugin/files/endpoints.py
* feat(files): Add OTLP to new nemoclient endpoints Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * lint Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> * remove these Signed-off-by: Matthew Grossman <mgrossman@nvidia.com> --------- Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Summary
Part 1 of AIRCORE-840. Migrates OTLP log operations from the Stainless SDK resource chain (
sdk.files.otlp.logs.*) to typed NemoClient endpoints, and removes the_raw_client/.otlpshims introduced in #429.upload_otlp_logsandquery_otlp_logstyped endpoints + types tonemo_platform_plugin.filesJobLogsClientto useAsyncFilesClient.query_otlp_logsinstead ofsdk.files.otlp.logs.querynemo files otlp logs create/querycommands to useFilesClientviaclient_from_platform_raw_clientand.otlpproperty fromFilesResource/AsyncFilesResource(bothpackages/filesetsand vendored SDK)test_log_client.pyto mockAsyncFilesClientinstead of Stainless SDK, use pluginNotFoundErrorTest plan
packages/nmp_common/tests/jobs/test_log_client.py— 9/9 passservices/core/jobs/tests/test_job_logs.py— 7/7 pass (API-level tests)e2e/test_jobs.py --run-e2e— 10/10 pass, includingtest_job_logs_across_multiple_batcheswhich exercises the full OTLP pipeline end-to-end throughJobLogsClient→AsyncFilesClient.query_otlp_logs→ files service🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes