Skip to content

fix(deployments): move port range to DockerExecutorConfig (AIRCORE-858) - #522

Merged
tylersbray merged 3 commits into
mainfrom
858-port-range-executor-config/tbray
Jun 30, 2026
Merged

fix(deployments): move port range to DockerExecutorConfig (AIRCORE-858)#522
tylersbray merged 3 commits into
mainfrom
858-port-range-executor-config/tbray

Conversation

@tylersbray

@tylersbray tylersbray commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move port_range_start / port_range_end from entity DockerDeploymentConfig to executor-level DockerExecutorConfig so platform YAML controls host port allocation
  • Wire create_deployment and find_available_port to read the executor port range; entity backend_config.docker retains only deployment-specific overrides like network
  • Regenerate deployments OpenAPI, add inverted-range validation on DockerExecutorConfig, and document executor YAML in the plugin README

Test plan

  • uv run pytest plugins/nemo-deployments/tests/unit/ -q (153 passed)
  • make refresh-openapi (deployments spec updated; port_range_* removed from entity schema)
  • uv run ruff check on changed files
  • Integration tests with Docker daemon (optional): uv run pytest plugins/nemo-deployments/tests/integration/ -v

Summary by CodeRabbit

  • New Features
    • Added a Docker executor “port range” configuration with inclusive bounds for host port publishing.
  • Bug Fixes
    • Docker deployments now allocate host ports using the executor-configured port range.
    • Added validation to reject inverted port ranges.
  • Documentation
    • Updated the Docker executors documentation to describe port range behavior and configuration scope.
  • Other
    • Updated OpenAPI schema to reflect removed deployment-level port-range fields.
    • Refreshed Docker-related tests to match the new allocation inputs and configuration behavior.

Host port allocation now reads port_range_start/end from executor YAML
instead of entity backend_config.docker, which was silently ignored.
Removes port range fields from the entity schema and OpenAPI, adds range
validation on DockerExecutorConfig, and updates tests and README docs.

Signed-off-by: Tyler Bray <tbray@nvidia.com>
@tylersbray
tylersbray requested review from a team as code owners June 30, 2026 17:28
@github-actions github-actions Bot added the fix label Jun 30, 2026
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2622bb1c-644d-4c95-8c54-1c78aebf73b8

📥 Commits

Reviewing files that changed from the base of the PR and between b5e6028 and 31b802d.

📒 Files selected for processing (1)
  • plugins/nemo-deployments/README.md
✅ Files skipped from review due to trivial changes (1)
  • plugins/nemo-deployments/README.md

📝 Walkthrough

Walkthrough

Docker host port range configuration moves from DockerDeploymentConfig to DockerExecutorConfig. find_available_port now takes explicit bounds, backend wiring uses executor config values, and tests plus docs are updated for the new placement.

Changes

Port range migration to executor config

Layer / File(s) Summary
Schema and executor config
plugins/nemo-deployments/src/nemo_deployments_plugin/entities.py, plugins/nemo-deployments/openapi/openapi.yaml, plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/config.py
DockerDeploymentConfig drops port_range_start/port_range_end. DockerExecutorConfig adds those fields and validates port_range_start <= port_range_end.
Port allocation wiring
plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/ports.py, plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/backend.py
find_available_port accepts explicit range bounds, uses them in allocation and errors, and create_deployment passes executor-configured bounds.
Tests and README
plugins/nemo-deployments/tests/unit/backends/docker/test_executor_config.py, plugins/nemo-deployments/tests/unit/backends/docker/test_ports.py, plugins/nemo-deployments/tests/unit/backends/docker/test_backend_mocked.py, plugins/nemo-deployments/tests/unit/test_registry.py, plugins/nemo-deployments/tests/integration/..., plugins/nemo-deployments/README.md
Tests switch to executor-level bounds, add executor config validation coverage, verify allocation uses configured ranges, and document the new Docker executor config.

Possibly related PRs

  • NVIDIA-NeMo/nemo-platform#280: Introduced the deployments plugin scaffolding that this PR extends by moving Docker port range config into executor settings.
  • NVIDIA-NeMo/nemo-platform#399: Added the original Docker backend and port allocation path that this PR refactors to use executor-level bounds.

Suggested reviewers

  • benmccown
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 clearly matches the main change: moving port range configuration to DockerExecutorConfig.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 858-port-range-executor-config/tbray

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

@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

🤖 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 `@plugins/nemo-deployments/README.md`:
- Around line 29-31: Clarify the docker executor port allocation docs by stating
that port_range_end is inclusive in the named executor config description and
the example text. Update the README wording around port_range_start and
port_range_end so it explicitly says the allocator scans the full range from
start through end, using the existing executor/config terminology to avoid
misreading the valid port count.
🪄 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: 55eac895-9c58-42c0-9ec6-58e368a2d0cb

📥 Commits

Reviewing files that changed from the base of the PR and between 8797bfc and b5e6028.

📒 Files selected for processing (12)
  • plugins/nemo-deployments/README.md
  • plugins/nemo-deployments/openapi/openapi.yaml
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/backend.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/config.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/backends/docker/ports.py
  • plugins/nemo-deployments/src/nemo_deployments_plugin/entities.py
  • plugins/nemo-deployments/tests/integration/backends/docker/test_docker_backend.py
  • plugins/nemo-deployments/tests/integration/test_reconcile_docker.py
  • plugins/nemo-deployments/tests/unit/backends/docker/test_backend_mocked.py
  • plugins/nemo-deployments/tests/unit/backends/docker/test_executor_config.py
  • plugins/nemo-deployments/tests/unit/backends/docker/test_ports.py
  • plugins/nemo-deployments/tests/unit/test_registry.py
💤 Files with no reviewable changes (4)
  • plugins/nemo-deployments/src/nemo_deployments_plugin/entities.py
  • plugins/nemo-deployments/openapi/openapi.yaml
  • plugins/nemo-deployments/tests/integration/backends/docker/test_docker_backend.py
  • plugins/nemo-deployments/tests/integration/test_reconcile_docker.py

Comment thread plugins/nemo-deployments/README.md Outdated
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 22044/29217 75.4% 60.3%
Integration Tests 12715/27897 45.6% 19.1%

Address CodeRabbit review on PR #522: document that the allocator scans
port_range_start through port_range_end inclusively.

Signed-off-by: Tyler Bray <tbray@nvidia.com>
The README follow-up commit cancelled the prior CI run via concurrency;
push an empty commit to produce a single clean check rollup on PR #522.

Signed-off-by: Tyler Bray <tbray@nvidia.com>

@mckornfield mckornfield 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.

ugh this container port thing

@tylersbray
tylersbray added this pull request to the merge queue Jun 30, 2026
Merged via the queue into main with commit b8569d5 Jun 30, 2026
94 of 96 checks passed
@tylersbray
tylersbray deleted the 858-port-range-executor-config/tbray branch June 30, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants