Skip to content

Preserve CRUD workload and collector compatibility for internal migration - #1363

Draft
Diamond (diamondpowell) wants to merge 16 commits into
mainfrom
dipowell/crud-collector-contract
Draft

Diamond (diamondpowell) wants to merge 16 commits into
mainfrom
dipowell/crud-collector-contract

Conversation

@diamondpowell

@diamondpowell Diamond (diamondpowell) commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add optional historical Azure workload and result-format compatibility to the shared CRUD package. Existing callers keep their current defaults.

Callers can select the compatibility profile through the CLI without maintaining their own workload templates, readiness loops, or result conversion.

What changes

  1. Historical workload compatibility: add the optional Azure --workload-profile legacy-shell profile for historical Deployment, Job, and StatefulSet workload shapes, images, completion criteria, and polling rules.
  2. Historical output compatibility: add optional collect --legacy-output support for historical operation names, timing aliases, and pipeline context while retaining canonical operation data.
  3. Supporting correctness fixes: include the historical templates in the installed package, validate and atomically publish compatibility results without overwriting source records, and forward configured provisioning timeouts through shared SDK/VirtualMachines instrumentation without shortening the existing 1,800-second ARM allowance. Fully managed GPU creation uses a separate, unchanged CLI helper and is not covered by this timeout forwarding. Public CLI-helper boolean retry contracts remain unchanged.

Default workload templates/execution and default collector schema/append behavior remain unchanged. This PR does not redesign the benchmarks or change ADX tables, ingestion connections, or dashboards.

Compatibility boundaries

The legacy profile defines historical workload and polling contracts. It does not change the default profile's behavior.

  • Completion counts Running pods for Deployments/StatefulSets and Succeeded pods for Jobs. Existing Job/StatefulSet pool targeting is retained; the historical Deployment placement limitation is unchanged.
  • The polling counter advances by two per poll and sleeps one second, including on success. A budget of 60 permits 30 polls, not a 60-second elapsed deadline. Shell and Python API overhead can differ.
  • Compatibility workload time uses historical readiness timing when recorded; canonical duration remains the overall operation metric.
  • Legacy Job reruns delete the previous fixed-name controller and wait for it and its pods to disappear before starting submission/readiness timing. Cleanup has a separate --step-timeout-second polling allowance; errors or timeout fail the operation without submitting a new Job. Default Job execution is unchanged.

Changed-file guide

The 16-file diff includes six regression-test files and documentation. The largest test diff protects compatibility and publication failure paths; it is not an additional CRUD implementation.

File Change and why it is needed
crud/azure/node_pool_crud.py Execute the optional historical profile: batch submission, completion counts, polling budget, and readiness timestamps. Templates alone cannot preserve execution/timing semantics. Default execution stays separate; rendering/submission is shared.
legacy/deployment.yml Preserve historical Deployment/Service names, labels, and image instead of silently adopting the OSS default manifest. No new Deployment pool selector.
legacy/job.yml Preserve the parallel Perl calculation and pool targeting; the OSS default Job runs a different command with different concurrency.
legacy/statefulset.yml Preserve parallel pod management, pool targeting, and a 5-GiB managed disk per replica. The OSS default does not exercise this storage workload.
pyproject.toml Include historical templates in the installed package; checkout-only tests would not catch missing wheel assets.
crud/main.py Wire optional CLI/profile arguments and compatibility collection. Validate context, retain canonical fields/failures, protect source records, and publish compatibility output atomically, including symlink handling. Preserve default collection behavior.
clients/aks_client.py Forward provisioning allowances for create/direct/progressive scale using shared instrumentation, preserving the existing ARM floor while honoring longer configurations. Fully managed GPU creation's separate CLI helper is unchanged and outside this forwarding path.
utils/azure_node_pool_cli.py Supply timestamps/retry status to instrumentation while preserving public boolean returns. Repairs the real VirtualMachines boolean-versus-tuple integration failure; forwards timeouts and retains failure timestamps.
utils/provisioning_instrumentation.py Enforce the forwarded timeout in SDK polling rather than accepting configuration that never reaches the wait loop. Retain the default allowance.
tests/crud/test_azure_node_pool_crud.py Verify historical manifests, batching, failures, validation, timing, and polling edge cases. Deterministic API mocks do not prove live elapsed-time parity.
tests/crud/test_legacy_job_reruns.py Verify fresh Job creation on repeated runs, waiting for old controllers/pods, missing-resource handling, cleanup errors/timeouts, and exclusion of cleanup from readiness timing. Kept separate to respect the repository's test-module size limit.
tests/crud/test_main.py Largest test change: protect CLI dispatch, default schema/append/order, compatibility aliases/context, failed records, reruns, malformed inputs, atomic failures, source collisions, and symlinks.
tests/clients/test_aks_client_virtual_machines.py Exercise actual instrumentation with cloud boundaries mocked, so a mocked timing layer cannot hide return-contract defects; cover readiness failures and timeout forwarding.
tests/utils/test_azure_node_pool_cli.py Protect public boolean/internal timing contracts, retry/failure timestamps, and timeout forwarding.
tests/utils/test_provisioning_instrumentation.py Verify default/custom polling limits are actually enforced, including longer allowances.
crud/README.md Explain profile selection, output contracts, timing boundaries, and provisioning allowances for callers.

Testing

  • Regression coverage includes default-profile preservation, historical workload rendering/batching/polling, CLI argument validation, collector schema/append compatibility, atomic publication/source protection, and provisioning-helper return/timeout contracts.
  • Before the review follow-up, the full OSS Python suite passed: 882 passed, 1 skipped; focused CRUD/client/provisioning regressions: 168 passed.
  • Review follow-up validation: 132 passed across workload, legacy Job rerun, CLI, and collector tests. Covers repeated fresh submissions, controller/pod cleanup, missing Jobs, API errors, cleanup timeout, readiness timing, and preservation of default execution. Repository-configured Pylint on the changed Python implementation/tests: 10/10.
  • Additional downstream consumer tests: 134 passed.
  • Existing-consumer comparison against OSS main (d5f9b06): 18 scenarios passed across baseline source, candidate source, and the extracted candidate wheel. Exercised existing YAML commands, real CLI dispatch, signature-checked CRUD calls, and real default collection/append for AWS GPU (on-demand/spot), Azure GPU (unmanaged/managed MIG), and Machine API (individual/batch). Calls and operation output matched the baseline. Cloud operations and GPU-plugin calls were mocked; this is contract coverage, not live AWS/GPU/Machine validation. All six workload templates were present in the wheel byte-for-byte.
  • Historical polling tests cover all three workload types, odd/even budgets, fast/slow APIs, timeout, and success on the final allowed poll.
  • Repository-configured runtime/test Pylint: 10/10.
  • All six GitHub checks passed at the last check.
  • OSS default-profile live run 87995 passed on the candidate/current-main integration branch. Downloaded published NDJSON was independently verified: exactly seven canonical operation names, all successful, finite nonnegative durations, and no legacy aliases. Cleanup tasks passed and an independent Azure query found no remaining run resource groups.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

For reviewers only: reply /run-tf-integration to trigger the terraform integration pipeline before approving the PR.

Return the successful CLI attempt timestamp and retry flag expected by shared instrumentation. Exercise real instrumentation in create and scale regressions and preserve failure timing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Propagate the client timeout through create, direct scale, and progressive scale on both SDK and VirtualMachines CLI paths while retaining the low-level 30-minute default. Add timeout-boundary and failed-result publishing regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the historical 1800-second ARM allowance when readiness settings are shorter, extend it for longer requests, and preserve default collector source order. Cover default SDK completion beyond ten minutes, both pool types and all provisioning paths, and nonalphabetic collection ordering.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Consolidate compatibility test setup without removing distinct cases. Reject missing or unreadable legacy source directories before publication, preserving default collection behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diamondpowell

Diamond (diamondpowell) commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Validation — b6cf2b66c

  • GitHub CI checks pass.
  • Compatibility checks preserve prior collector behavior and direct CLI-helper boolean returns.
  • Pipeline #189168845 passed for small VMSS and VirtualMachines scenarios, including CRUD, workloads, result collection, and cleanup. All 14 output rows were independently checked; installed runtime files matched this commit.

Keep public helper retry booleans and provide timing tuples only at the instrumentation boundary. Restore default collector environment lookup, exceptions, and streaming append behavior while retaining opt-in legacy output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI 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.

🟡 Changes recommended

Legacy collection accepts invalid cloud_info values and exits successfully while overwriting prior results, so it needs JSON-object validation before publishing and a nonzero exit on invalid input.

1 open issue
What changed in this PR

Adds opt-in legacy CRUD result collection for internal ADX consumers while preserving the default collector’s schema and append behavior.

Changes:

  • Adds legacy aliases, CLI/environment context, and atomic publication of validated legacy results.
  • Aligns VirtualMachines provisioning timing with shared instrumentation and supports longer configured timeouts.
  • Expands compatibility and failure-path tests and documents collector behavior.
File Description
modules/​python/​utils/​provisioning_instrumentation.py Adds configurable SDK polling timeouts.
modules/​python/​utils/​azure_node_pool_cli.py Adds timed CLI operations while preserving public boolean returns.
modules/​python/​tests/​utils/​test_provisioning_instrumentation.py Tests default and custom polling limits.
modules/​python/​tests/​utils/​test_azure_node_pool_cli.py Tests retry timing, return compatibility, and timeout forwarding.
modules/​python/​tests/​crud/​test_main.py Covers legacy output, default compatibility, validation, and atomic publication.
modules/​python/​tests/​clients/​test_aks_client_virtual_machines.py Exercises shared instrumentation and provisioning timeout behavior.
modules/​python/​crud/​README.md Documents legacy collection and provisioning timeouts.
modules/​python/​crud/​main.py Implements opt-in legacy adaptation, context arguments, and atomic output.
modules/​python/​clients/​aks_client.py Extends provisioning limits for longer configured timeouts.

Review effort: Balanced

Comment thread modules/python/crud/main.py Resolved
@diamondpowell
Diamond (diamondpowell) marked this pull request as draft November 3, 2026 18:24
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add opt-in historical benchmark templates and batch execution while preserving existing workload defaults. Package the templates, retain historical timing aliases, and preserve atomic collector output symlinks with regression coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diamondpowell Diamond (diamondpowell) changed the title Add opt-in legacy CRUD collection for internal consumers Preserve CRUD workload and collector compatibility for internal migration Nov 11, 2026
Match the legacy two-unit poll counter and one-second final sleep, excluding API latency from the counter. Keep the default profile unchanged and cover fast/slow APIs, odd/even budgets, success and timeout for all workload types.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diamondpowell
Diamond (diamondpowell) requested a balanced review from Copilot November 25, 2026 16:40

Copilot AI 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.

Copilot was unable to review this pull request due to rate limiting. Please try again later. See Usage limits for GitHub Copilot for details.

Copilot AI 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.

🔵 Needs a closer look

The review remains incomplete because one or more reviewers received a runtime budget-stop instruction.

No open issues 🎉

Review effort: Balanced

Copilot AI 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.

🟡 Changes recommended

Active moderate issues remain because fully managed GPU creates can still invoke untimed subprocess retries, and repeated legacy-shell runs can fail when the fixed Job already exists.

2 open issues

Review effort: Lite

Comment thread modules/python/clients/aks_client.py Resolved
Wait for the previous legacy Job and its pods to disappear before starting a fresh workload. Keep cleanup failures explicit, preserve default behavior and readiness polling, and document the separate fully managed GPU timeout boundary.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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