Repository navigation
feat(crud-machine): AKS Machine API client + CRUD layer + CLI - #1187
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Python-based foundation for AKS “Machine API” perf-test operations by introducing a dedicated Machine API client, a thin CRUD facade, and CLI wiring, along with unit tests validating key behaviors (including P99 readiness gating and HTTP session pool sizing).
Changes:
- Introduces
AKSMachineClientto drive Machine API create/scale flows, including a sizedrequestsconnection pool and P99-based readiness gating (P100 recorded but not a hard failure gate). - Adds
MachineCRUDas a thin Azure CRUD facade and extendscrud/main.pywithcreate-machineandscale-machinesubcommands plus dispatch logic. - Adds unit tests covering the new client behaviors, CRUD facade forwarding/error-swallowing, and CLI dispatch/tag parsing.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| modules/python/clients/aks_machine_client.py | Adds HTTP session pool sizing and changes readiness hard-gate from P100 to P99 (logging P100 as best-effort). |
| modules/python/crud/azure/machine_crud.py | New Azure Machine CRUD facade wrapping AKSMachineClient for CLI consumption. |
| modules/python/crud/main.py | Adds Machine API CLI subcommands and dispatch path. |
| modules/python/tests/test_aks_machine_client.py | Adds tests for P99/P100 readiness semantics and session adapter pool sizing. |
| modules/python/tests/test_machine_crud.py | Adds tests for MachineCRUD forwarding/defaults/exception swallowing. |
| modules/python/tests/test_crud_main.py | Adds tests for Machine CLI dispatch, exit-code semantics, and --tags JSON parsing. |
Karen Chen (karenychen)
force-pushed
the
feat/aks-machine-client
branch
from
May 22, 2026 00:18
3ac6dc6 to
d8ac1b2
Compare
Contributor
Author
Code reviewFound 1 issue:
telescope/modules/python/crud/main.py Lines 405 to 468 in d8ac1b2 |
Port the k8s-cluster-crud-machine perf-test code path from
ado-telescope. This PR is the Python-only foundation; scenario YAMLs,
step templates, terraform inputs, and the staging pipeline land in
follow-up PRs.
Layers in this change:
* AKSMachineClient (modules/python/clients/aks_machine_client.py)
Subclasses AKSClient. Drives the AKS Machine API
(api-version 2025-06-02-preview): create-machine agentpool,
PUT/BatchPutMachine, agentpool provisioning wait, percentile-based
node-readiness wait. BatchPutMachine HEADER pattern with shared
Session + sized urllib3 pool (HTTPAdapter pool_maxsize=64) so 64
concurrent workers do not starve. 429 retries with exponential
backoff (1s/2s/4s/8s, max 5). Per-request timeout cap. Hard gate
requires all nodes Ready within readiness_wait_timeout; all
reached percentiles (P50/P70/P90/P99/P100) are emitted to
metadata ('percentile_node_readiness_times') for trending.
* MachineCRUD (modules/python/crud/azure/machine_crud.py)
Thin facade that constructs an AKSMachineClient and exposes
create_machine_agentpool / scale_machine for the CLI.
* CLI (modules/python/crud/main.py)
New 'create-machine' and 'scale-machine' subcommands. Azure-only
today; AWS/GCP do not expose an equivalent Machine API.
Existing CRUD subcommands are unchanged.
Tests (43 new):
- tests/test_aks_machine_client.py: 28 tests covering single-PUT,
batch chunking, 429 retry, pool sizing, percentile envelope.
- tests/test_machine_crud.py: 15 tests on the facade.
- tests/test_crud_main.py: CLI dispatch coverage for both new
subcommands.
CI gates (local):
- pylint 10.00/10 on all touched files
- pytest --cov=. --cov-fail-under=80 from modules/python/:
736 passed, 1 skipped, 83.47% coverage
Karen Chen (karenychen)
force-pushed
the
feat/aks-machine-client
branch
from
May 22, 2026 00:38
d8ac1b2 to
bcfb293
Compare
- Make --scale-machine-count required (no default=0) - Remove unused --region flag (REGION env var already feeds telemetry) - Refactor handle_machine_operation to kwargs-dict pattern matching handle_node_pool_operation - Extract scale-machine subparser into _add_scale_machine_subparser helper - Explicit return True in create_machine_agentpool and scale_machine wrappers to match docstring contract
Vittoria (vittoriasalim)
approved these changes
May 22, 2026
Karen Chen (karenychen)
added a commit
that referenced
this pull request
May 27, 2026
…eline Add scenario, topology, engine step, and pipeline file to exercise the AKS Machine API CLI (`create-machine` and `scale-machine`, shipped in PR #1187) end-to-end in the Telescope CI. Design choices (Option 2 hybrid, intentional divergence from ado-telescope): * Reuse the existing `crud` engine instead of introducing a new `raw` engine path; mirror PR #1187's separate subcommands so create and scale are two discrete observable pipeline steps. * New scenario `scenarios/perf-eval/k8s-cluster-crud-machine/` with `default_node_pool = null` (the Machines-mode pool is born via the ARM PUT performed by `create-machine`). * System pool is injected at job time via the existing `SYSTEM_NODE_POOL` plumbing in `steps/terraform/set-input-variables-azure.yml`. * New topology folder `steps/topology/k8s-crud-machine/` mirroring the `k8s-crud-gpu` shape (validate-resources / execute-crud / collect-crud). * New sibling engine step `steps/engine/crud/k8s/execute-machine.yml` that does NOT modify the existing `execute.yml`. * Teardown via terraform destroy only (no CLI delete step today). * Region: westus2. * `use_batch_api` is gated at the bash level (matching the ado-telescope idiom) because the matrix value is a runtime variable and ADO template conditionals run at compile time.
Karen Chen (karenychen)
added a commit
that referenced
this pull request
May 27, 2026
…eline Add scenario, topology, engine step, and pipeline file to exercise the AKS Machine API CLI (`create-machine` and `scale-machine`, shipped in PR #1187) end-to-end in the Telescope CI. Design choices (Option 2 hybrid, intentional divergence from ado-telescope): * Reuse the existing `crud` engine instead of introducing a new `raw` engine path; mirror PR #1187's separate subcommands so create and scale are two discrete observable pipeline steps. * New scenario `scenarios/perf-eval/k8s-cluster-crud-machine/` with `default_node_pool = null` (the Machines-mode pool is born via the ARM PUT performed by `create-machine`). * System pool is injected at job time via the existing `SYSTEM_NODE_POOL` plumbing in `steps/terraform/set-input-variables-azure.yml`. * New topology folder `steps/topology/k8s-crud-machine/` mirroring the `k8s-crud-gpu` shape (validate-resources / execute-crud / collect-crud). * New sibling engine step `steps/engine/crud/k8s/execute-machine.yml` that does NOT modify the existing `execute.yml`. * Teardown via terraform destroy only (no CLI delete step today). * Region: westus2. * `use_batch_api` is gated at the bash level (matching the ado-telescope idiom) because the matrix value is a runtime variable and ADO template conditionals run at compile time.
Pablo Trivino (PabloTriv)
pushed a commit
that referenced
this pull request
Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Port the
k8s-cluster-crud-machineperf-test code path from ado-telescope.This PR is the Python-only foundation. Scenario YAMLs, step templates, terraform inputs, and the staging pipeline land in follow-up PRs.
Layers in this change
AKSMachineClient(modules/python/clients/aks_machine_client.py)Subclasses
AKSClient. Drives the AKS Machine API (api-version=2025-06-02-preview):create_machine_agentpool(mode=Machines)PUT machine(single) andBatchPutMachine(multi)BatchPutMachine uses the HEADER pattern with a shared
requests.Session+ sizedurllib3pool (HTTPAdapter(pool_maxsize=64)) so 64 concurrent workers do not starve. 429 retries with exponential backoff (1s / 2s / 4s / 8s, max 5). Per-request timeout cap.Hard gate: all nodes must reach
Readywithinreadiness_wait_timeout. All reached percentiles (P50/P70/P90/P99/P100) are recorded inpercentile_node_readiness_timesmetadata for trending.MachineCRUD(modules/python/crud/azure/machine_crud.py)Thin facade that constructs an
AKSMachineClientand exposescreate_machine_agentpool/scale_machinefor the CLI.CLI (
modules/python/crud/main.py)New
create-machineandscale-machinesubcommands. Azure-only today; AWS/GCP do not expose an equivalent Machine API. Existing CRUD subcommands are unchanged.Tests (43 new)
tests/test_aks_machine_client.py— 28 tests: single-PUT, batch chunking, 429 retry, pool sizing, percentile envelopetests/test_machine_crud.py— 15 tests on the facadetests/test_crud_main.py— CLI dispatch coverage for both new subcommandsCI gates (local)
pylint10.00/10 on all touched filespytest --cov=. --cov-fail-under=80frommodules/python/: 736 passed, 1 skipped, 83.47% coverageIntegration evidence
The full stack (this PR + follow-up YAML/tfvars PRs) was exercised on staging pipeline Run 67988, all 3 stages green (1×1 non-batch, 50×50 non-batch, 200×4 batch).