Skip to content

feat(plugin): Decouple nemo-platform-plugin from nmp-common#145

Draft
matthewgrossman wants to merge 8 commits into
mainfrom
aircore-707-decouple-plugin-from-nmp-common/mgrossman
Draft

feat(plugin): Decouple nemo-platform-plugin from nmp-common#145
matthewgrossman wants to merge 8 commits into
mainfrom
aircore-707-decouple-plugin-from-nmp-common/mgrossman

Conversation

@matthewgrossman
Copy link
Copy Markdown
Contributor

@matthewgrossman matthewgrossman commented Jun 2, 2026

Summary

Decouples nemo-platform-plugin from nmp-common so plugin authors only depend on the plugin package.

  • Introduces SDKProvider protocol + DefaultSDKProvider (env-var-based) in nemo_platform_plugin.task_sdk
  • nmp-common registers a richer PlatformSDKProvider via entry-point, discovered automatically when installed
  • Moves get_qualified_image, image_builder, make_filter_obj_dep, parse_entity_ref, and config classes into the plugin package
  • Migrates all plugin imports away from nmp.common; backward-compat re-exports remain for services
  • Adds pre-commit hook to prevent future nmp.common imports in plugins

Test plan

  • Unit tests for SDKProvider protocol, default provider, entry-point resolution, and provider override
  • Guardrails header-forwarding tests updated for inlined get_forwarding_headers
  • pre-commit run --all-files --hook-stage pre-push passes
  • Existing unit + integration tests pass

Signed-off-by: Matthew Grossman mgrossman@nvidia.com

🤖 Generated with Claude Code

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Comment thread packages/nemo_platform_plugin/src/nemo_platform_plugin/task_sdk.py Fixed
Comment thread packages/nemo_platform_plugin/src/nemo_platform_plugin/task_sdk.py Fixed
Comment thread packages/nemo_platform_plugin/src/nemo_platform_plugin/task_sdk.py Fixed
Comment thread packages/nemo_platform_plugin/src/nemo_platform_plugin/task_sdk.py Fixed
Comment thread packages/nemo_platform_plugin/src/nemo_platform_plugin/task_sdk.py Fixed
Comment thread packages/nemo_platform_plugin/tests/test_task_sdk.py Fixed
Comment thread packages/nmp_common/src/nmp/common/config/paths.py Dismissed
return _extract_validated_fields(validated, raw)

return _dep
from nemo_platform_plugin.api.filters import make_filter_obj_dep as make_filter_obj_dep
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

False positive — this is an intentional backward-compat re-export using the import X as X pattern so existing consumers of nmp.common continue to work.

return f"{effective_registry}/{name}:{effective_tag}"

return _build
from nemo_platform_plugin.config import get_qualified_image as get_qualified_image
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

False positive — this is an intentional backward-compat re-export using the import X as X pattern so existing consumers of nmp.common continue to work.


return _build
from nemo_platform_plugin.config import get_qualified_image as get_qualified_image
from nemo_platform_plugin.config import image_builder as image_builder
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

False positive — this is an intentional backward-compat re-export using the import X as X pattern so existing consumers of nmp.common continue to work.

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Suite Lines Covered Line Rate Branch Rate
Unit Tests 18539/24548 75.5% 62.0%
Integration Tests 11886/23325 51.0% 26.2%

- Remove redundant `...` from Protocol methods (docstrings suffice)
- Replace global variables with dict-based state to avoid false
  "unused global variable" warnings

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
return dict(sdk._custom_headers)


__all__ = [
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

why do we need this all?

# ---------------------------------------------------------------------------


class PlatformTaskSDKProvider:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

more broadly: does this really need to be a TaskSdkProvider? why not just SDKProvider?

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
…mgrossman

Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
Comment thread packages/nemo_platform_plugin/src/nemo_platform_plugin/task_sdk.py Fixed
Comment thread packages/nemo_platform_plugin/src/nemo_platform_plugin/task_sdk.py Fixed
# Fall back to the built-in default.
logger.debug("No entry-point task SDK provider found; using DefaultSDKProvider")
default = DefaultSDKProvider()
_provider = default
logger.debug("No entry-point task SDK provider found; using DefaultSDKProvider")
default = DefaultSDKProvider()
_provider = default
_resolved = True
Signed-off-by: Matthew Grossman <mgrossman@nvidia.com>
obj = obj()
if isinstance(obj, SDKProvider):
logger.debug("Using SDK provider from entry-point %r", ep.name)
_provider = obj
if isinstance(obj, SDKProvider):
logger.debug("Using SDK provider from entry-point %r", ep.name)
_provider = obj
_resolved = True
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.

2 participants