Skip to content

test(deploy): port operator DGDR e2e coverage to pytest - #11946

Merged
sttts merged 20 commits into
ai-dynamo:mainfrom
sttts:sttts-port-operator-e2e-pytest
Aug 10, 2026
Merged

sttts merged 20 commits into
ai-dynamo:mainfrom
sttts:sttts-port-operator-e2e-pytest

Conversation

@sttts

@sttts sttts commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Depends on #11949.

  • Supersedes ci(operator): run GPU-free deploy e2e tests #11235 by moving all 39 DGDR live-cluster tests from Ginkgo to tests/deploy.
  • This PR enables CPU-only CI coverage: 27 gpu_0 cases run against mocked hardware in isolated, always-cleaned namespaces.
  • The 12 real-GPU cases are ported but not scheduled in CI. Enabling the two gpu_1 and ten H100 gpu_8 cases will follow after a GPU-capacity discussion.
  • Leaves the legacy Kind smoke test deprecated and retains the profiling RBAC fix.

The CPU job is independent of the vLLM, SGLang, and TensorRT-LLM deploy-test jobs.

Validation

  • 39 tests collected; 27 CPU cases selected in CI
  • pre-commit, marker report, and workflow lint
  • legacy Go package compile

@sttts
sttts temporarily deployed to external_collaborator July 21, 2026 12:28 — with GitHub Actions Inactive
@sttts
sttts temporarily deployed to external_collaborator July 21, 2026 12:28 — with GitHub Actions Inactive
@github-actions github-actions Bot added documentation Improvements or additions to documentation deployment::k8s Relates to dynamo deployment in kubernetes actions labels Jul 21, 2026
@github-actions

github-actions Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot added external-contribution Pull request is from an external contributor test labels Jul 21, 2026
Comment thread tests/deploy/README.md Resolved
@sttts
sttts temporarily deployed to external_collaborator July 21, 2026 12:45 — with GitHub Actions Inactive
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test e395cda

@datadog-official

datadog-official Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Pipelines

🎯 Code Coverage (details)
• Patch Coverage: 30.19%
• Overall Coverage: 46.25% (-11.76%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: a4d2332 | Docs | Datadog PR Page | Give us feedback!

@sttts
sttts marked this pull request as ready for review July 21, 2026 13:24
@sttts
sttts requested review from a team as code owners July 21, 2026 13:24

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 potential issue.

Open in Devin Review

Comment thread tests/deploy/dgdr_utils.py Resolved
@sttts
sttts temporarily deployed to external_collaborator July 21, 2026 13:32 — with GitHub Actions Inactive
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test b449eca

@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Adds reusable DGDR deployment workflows, planner image copying, a Python live-cluster test harness with CPU and H100 coverage, removal of legacy DGDR Go tests, and restricted profiling-job RBAC permissions.

Changes

CI DGDR deployment flow

Layer / File(s) Summary
Shared workflow contracts and DGDR execution
.github/actions/dynamo-deploy-test/action.yml, .github/workflows/shared-copy.yml, .github/workflows/shared-dgdr-deploy-test.yml
Adds configurable planner image copying, DGDR workflow inputs and secrets, test execution, diagnostics artifacts, and namespace cleanup controls.
Pipeline job wiring
.github/workflows/post-merge-ci.yml, .github/workflows/pr.yaml
Adds planner-copy and DGDR deployment jobs and connects them to build, status, cleanup, and builder dependencies.

Live-cluster DGDR test migration

Layer / File(s) Summary
Python DGDR test harness
tests/deploy/conftest.py, tests/deploy/dgdr_utils.py
Adds configurable pytest fixtures, Kubernetes resource management, DGDR lifecycle orchestration, output validation, cleanup, and inference checks.
DGDR pytest coverage
tests/deploy/test_dgdr.py, tests/deploy/test_dgdr_h100.py, tests/deploy/README.md, tests/deploy/test_dgd.py
Adds validation, lifecycle, planner, backend, SLA, hardware, persistence, CPU, and H100 real-GPU coverage.
Legacy test path retirement
deploy/operator/Makefile, deploy/operator/test/e2e/doc.go, tests/utils/managed_deployment.py
Deprecates the legacy smoke-test path and removes the former DGDR Makefile target, helper class, and Go test suite files.

Profiling job RBAC

Layer / File(s) Summary
ClusterRole node access removal
deploy/helm/charts/platform/components/operator/templates/profiling-job-rbac.yaml, deploy/helm/charts/platform/tests/profiling_job_rbac_test.yaml
Removes profiling-job permissions on Kubernetes nodes and adds a Helm assertion that the rule is absent.

Estimated code review effort: 5 (Critical) | ~120 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.13% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description is missing the required Overview, Details, Reviewer start, and Related Issues sections from the template. Rewrite it to match the template, add the required issue link or confirmation, and include what changed plus where reviewers should focus.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly summarizes the main change: porting DGDR e2e coverage from Ginkgo to pytest.

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.

🧹 Nitpick comments (1)
tests/deploy/dgdr_utils.py (1)

152-161: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use explicit raise instead of assert for external-data validation.

dgdr_utils.py is a helper module (not a test module or registered plugin), so pytest does not rewrite these asserts, and under python -O the assert statements are stripped — parse_final_dgd would then skip both checks and return a possibly non-DGD document silently. The same pattern recurs in get_output_dgd (Lines 360-362) and run_lifecycle (Lines 610, 629); prefer explicit if/raise there too.

As per path instructions (.ai/python-guidelines.md): "never use assert for runtime validation—use explicit if/raise."

♻️ Proposed fix for `parse_final_dgd`
 def parse_final_dgd(content: str) -> dict[str, Any]:
     """Return the last YAML document and assert that it is a DGD."""

     documents = [document for document in yaml.safe_load_all(content) if document]
-    assert documents, "final_config.yaml must contain at least one YAML document"
+    if not documents:
+        raise AssertionError("final_config.yaml must contain at least one YAML document")
     result = documents[-1]
-    assert (
-        result.get("kind") == "DynamoGraphDeployment"
-    ), "last final_config.yaml document must be a DynamoGraphDeployment"
+    if result.get("kind") != "DynamoGraphDeployment":
+        raise AssertionError(
+            "last final_config.yaml document must be a DynamoGraphDeployment"
+        )
     return result
🤖 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 `@tests/deploy/dgdr_utils.py` around lines 152 - 161, Replace the runtime
assert checks in parse_final_dgd with explicit if/raise validation so they
remain active under optimization: reject empty YAML documents and any final
document whose kind is not DynamoGraphDeployment. Apply the same
assert-to-if/raise conversion to the validation checks in get_output_dgd and
run_lifecycle, preserving their existing conditions and error behavior.

Source: Path instructions

🤖 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.

Nitpick comments:
In `@tests/deploy/dgdr_utils.py`:
- Around line 152-161: Replace the runtime assert checks in parse_final_dgd with
explicit if/raise validation so they remain active under optimization: reject
empty YAML documents and any final document whose kind is not
DynamoGraphDeployment. Apply the same assert-to-if/raise conversion to the
validation checks in get_output_dgd and run_lifecycle, preserving their existing
conditions and error behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1b6a9d75-bd58-4954-a915-52bee58fe1c3

📥 Commits

Reviewing files that changed from the base of the PR and between 1ebabd4 and b449eca.

📒 Files selected for processing (25)
  • .github/actions/dynamo-deploy-test/action.yml
  • .github/workflows/post-merge-ci.yml
  • .github/workflows/pr.yaml
  • .github/workflows/shared-copy.yml
  • .github/workflows/shared-dgdr-deploy-test.yml
  • deploy/helm/charts/platform/components/operator/templates/profiling-job-rbac.yaml
  • deploy/helm/charts/platform/tests/profiling_job_rbac_test.yaml
  • deploy/operator/Makefile
  • deploy/operator/test/e2e/dgdr/README.md
  • deploy/operator/test/e2e/dgdr/dgdr_h100_e2e_test.go
  • deploy/operator/test/e2e/dgdr/dgdr_lifecycle_spec_test.go
  • deploy/operator/test/e2e/dgdr/dgdr_test.go
  • deploy/operator/test/e2e/dgdr/helpers_test.go
  • deploy/operator/test/e2e/dgdr/lifecycle_test.go
  • deploy/operator/test/e2e/dgdr/profiling_test.go
  • deploy/operator/test/e2e/dgdr/suite_test.go
  • deploy/operator/test/e2e/dgdr/validation_test.go
  • deploy/operator/test/e2e/doc.go
  • tests/deploy/README.md
  • tests/deploy/conftest.py
  • tests/deploy/dgdr_utils.py
  • tests/deploy/test_dgd.py
  • tests/deploy/test_dgdr.py
  • tests/deploy/test_dgdr_h100.py
  • tests/utils/managed_deployment.py
💤 Files with no reviewable changes (11)
  • deploy/operator/test/e2e/dgdr/dgdr_h100_e2e_test.go
  • deploy/operator/test/e2e/dgdr/README.md
  • deploy/operator/test/e2e/dgdr/lifecycle_test.go
  • deploy/operator/test/e2e/dgdr/dgdr_lifecycle_spec_test.go
  • deploy/operator/test/e2e/dgdr/suite_test.go
  • deploy/operator/test/e2e/dgdr/dgdr_test.go
  • deploy/operator/test/e2e/dgdr/validation_test.go
  • deploy/helm/charts/platform/components/operator/templates/profiling-job-rbac.yaml
  • deploy/operator/test/e2e/dgdr/helpers_test.go
  • tests/utils/managed_deployment.py
  • deploy/operator/test/e2e/dgdr/profiling_test.go

@sttts
sttts temporarily deployed to external_collaborator July 21, 2026 14:02 — with GitHub Actions Inactive
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test c17fd98

@sttts
sttts temporarily deployed to external_collaborator July 21, 2026 14:18 — with GitHub Actions Inactive
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test 7cfd3bf

@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test a39a2ba

@sttts
sttts force-pushed the sttts-port-operator-e2e-pytest branch from a39a2ba to 2b81c01 Compare July 21, 2026 14:54
@sttts

sttts commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 7dc93c5

1 similar comment
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test 7dc93c5

sttts added 20 commits August 10, 2026 10:36
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
Signed-off-by: Dr. Stefan Schimanski <[email protected]>
@sttts
sttts force-pushed the sttts-port-operator-e2e-pytest branch from 7dc93c5 to a4d2332 Compare August 10, 2026 08:42
@sttts
sttts temporarily deployed to external_collaborator August 10, 2026 08:42 — with GitHub Actions Inactive
@sttts

sttts commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test a4d2332

1 similar comment
@dynamo-ops

Copy link
Copy Markdown
Contributor

/ok to test a4d2332

@sttts
sttts merged commit a3e69ab into ai-dynamo:main Aug 10, 2026
197 of 199 checks passed
jh-nv added a commit that referenced this pull request Aug 12, 2026
#11946 moved tests/utils/managed_deployment.py to tests/deploy/dgd_utils.py,
so the import here stopped resolving once main was merged in. This is what the
pytest-marker-report hook was failing on: CI builds the PR merged with main, so
it saw the rename while a branch based on the older main did not.

Import DeploymentSpec/ManagedDeployment from their new home.

Signed-off-by: Jie Hao <[email protected]>

This branch was previously deployed

1 inactive deployment
external_collaborator — a4d23329 Deployed Aug 10, 2026 by sttts via ok-to-test #8090
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

actions deployment::k8s Relates to dynamo deployment in kubernetes documentation Improvements or additions to documentation external-contribution Pull request is from an external contributor planner size/XXL test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants