Repository navigation
Add live E2E deployment test for Aspire.Hosting.Radius - #18730
Mitch Denny (mitchdenny) merged 13 commits into
Conversation
Follow-up to microsoft#18696. Adds RadiusStarterDeploymentTests, which deploys the Aspire starter template to a live Radius environment on AKS and verifies the deployed app runs (rad resources present, pods ready, HTTP 200) — proving the `aspire publish` + `rad deploy app.bicep` path works end to end rather than only validating serializer output via snapshot/unit tests. - New test builds/pushes the starter images to ACR and attaches them with WithContainerImage (the Radius publisher does not push project images yet, see microsoft#16844), then asserts app.bicep references the ACR images before deploy. - Gated "Setup Radius" step in deployment-tests.yml installs the pinned rad CLI (0.59.0, aligned with RadiusBicepExtension) only for the Radius matrix class. - README documents the Radius scenario and the rad prerequisite. Co-authored-by: Copilot <[email protected]> Copilot-Session: 9c52ede6-7b7f-42ee-a961-9e1f19f54315
- Make the app.bicep image-reference check non-vacuous: split the marker token in the source command so it appears only in output, not the echoed command line (the grep exit code remains the hard gate). - Add --show-labels to the pod/service listing so a Radius label-schema mismatch is visible in the recording rather than surfacing as an empty jsonpath during endpoint verification. - Document that useRedisCache: true is intentional (exercises the Radius container recipe + connection wiring). Co-authored-by: Copilot <[email protected]> Copilot-Session: 9c52ede6-7b7f-42ee-a961-9e1f19f54315
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 18730Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 18730" |
There was a problem hiding this comment.
Pull request overview
Adds a live deployment end-to-end test for the new Aspire.Hosting.Radius integration, validating that aspire publish + aspire deploy (via rad deploy app.bicep) results in a working app on a real AKS cluster with a Radius control plane.
Changes:
- Add a new live AKS+Radius deployment E2E test that provisions infra, publishes, deploys, and verifies endpoints.
- Add CI workflow gating to install the
radCLI only for the Radius test class. - Document the new Radius E2E coverage and prerequisites in the deployment tests README.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/Aspire.Deployment.EndToEnd.Tests/README.md | Documents Radius-specific deployment E2E coverage and prerequisites. |
| tests/Aspire.Deployment.EndToEnd.Tests/RadiusStarterDeploymentTests.cs | Adds the new live AKS+Radius deployment E2E test. |
| .github/workflows/deployment-tests.yml | Adds a gated step to install the pinned rad CLI for the Radius test scenario. |
- Pin the radius install.sh fetch to the v$RADIUS_VERSION release tag instead of the moving `main` branch, so the installer script content is locked to the same version we install (supply-chain hardening). - Dispose the TemporaryWorkspace via `using var` so its temp directory is cleaned up (matches sibling deployment tests; the workspace is not a CI artifact). - Dispose the resource-group-cleanup Process via `using var` to avoid leaking OS handles. Co-authored-by: Copilot <[email protected]> Copilot-Session: 9c52ede6-7b7f-42ee-a961-9e1f19f54315
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Validate the Radius.Core UDT application (not just the legacy Redis app) by using the preview graph implementation and asserting the deployed graph names both project containers: - rad app graph -a app --preview (forces the Radius.Core graph; the default routes to legacy Applications.Core, which the Redis-only legacy 'app' satisfies on its own) - grep the captured preview graph for apiservice and webfrontend so a missing UDT container fails fast Exercise the Redis-backed output cache by probing /weather instead of / on the webfrontend. /weather calls the apiservice (WeatherApiClient) and is served through AddRedisOutputCache; grep for the streamed forecast table so the probe proves the API + output-cache path end-to-end despite StreamRendering. Co-authored-by: Copilot <[email protected]> Copilot-Session: 0a2ea3fa-e408-445e-8b72-55eaab7f6661
The Radius E2E test ran `aspire publish` (which prints "Pipeline succeeded") and then `aspire deploy` guarded by WaitForPipelineSuccessAsync. That helper scans the whole terminal viewport for "Pipeline succeeded", so it could match the stale marker still on screen from the earlier publish and return immediately -- collapsing the intended 15-minute deploy budget down to the trailing 2-minute prompt wait. Wait on the deploy command's sequence-numbered prompt instead (17m, preserving the prior 15m+2m effective ceiling). That prompt is scoped to this command alone, so it cannot match the publish marker, and it already fails fast on a non-zero deploy via the [n ERR:] prompt. The pipeline helper's only extra behavior is a transient-Azure-capacity Assert.Skip that targets AKS provisioning; deploy here only runs rad deploy against the already-created cluster, so that path does not apply. Co-authored-by: Copilot <[email protected]> Copilot-Session: 0a2ea3fa-e408-445e-8b72-55eaab7f6661
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
Address round-4 PR review comments on the Radius starter deployment test: - Isolate kubeconfig: export KUBECONFIG to a throwaway file under the TemporaryWorkspace so az/kubectl/rad (incl. aspire-deploy's rad) never mutate the developer's ~/.kube/config. - Isolate rad config: shadow `rad` with a workspace-local PATH shim that injects `--config <ws>/.rad/config.yaml` into every invocation (rad has no config env var; aspire deploy spawns rad via PATH). The user's ~/.rad/config.yaml is never touched, avoiding a backup/restore race. - Drop `--force` from `rad workspace create`: the isolated config starts empty so the name can never collide with a pre-existing workspace. - Add the ASPIREPIPELINES001 and ASPIRERADIUS057 pragmas independently so one already being present never skips adding the other. Co-authored-by: Copilot <[email protected]> Copilot-Session: 0a2ea3fa-e408-445e-8b72-55eaab7f6661
Address two more round-5 PR review comments on the Radius starter deployment test: - Isolate Docker credentials: export DOCKER_CONFIG to a throwaway dir under the TemporaryWorkspace in Step 1b so `az acr login` (which shells to `docker login`) and `dotnet publish /t:PublishContainer` authenticate against isolated creds instead of the developer's ~/.docker/config.json. - Rewrite the deploy-wait comment to describe the current 17-minute timeout constraint directly rather than referencing an earlier PR revision. Co-authored-by: Copilot <[email protected]> Copilot-Session: 0a2ea3fa-e408-445e-8b72-55eaab7f6661
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
Add a per-PR KIND-based Radius deploy test (no Azure) that drives the full CLI path (aspire publish -> aspire deploy -> rad deploy app.bicep) so the Radius deploy flow gets local coverage on every PR, and get the live AKS Radius deployment test passing end-to-end: - Add RadiusDeployTests plus KubernetesDeployTestHelpers/KubernetesE2EVersions to install the rad CLI and Radius control plane onto a KIND cluster and verify a deployed container serves HTTP. - Use --no-ssh-key when creating the AKS cluster so the test does not depend on the runner having SSH keys. - Pre-create $HOME/.rad/bin before running the Radius install.sh: the script's needsSudo() only checks the install dir's immediate parent, so a fresh runner without $HOME/.rad wrongly triggers sudo and leaves the dir root-owned, which later breaks the non-sudo "rad bicep download" (config.yaml.lock permission). - Symlink the default ~/.kube/config to $KUBECONFIG before "rad install kubernetes": rad's Contour gateway step reads the default kubeconfig path directly and ignores $KUBECONFIG, which the test isolates to the workspace. - Port-forward to the Deployment instead of a Service in both tests: Radius does not synthesize a Kubernetes Service for container workloads (only recipe-backed resources such as the Redis cache get one). - Validate the webfrontend home page instead of the cross-service /weather page: webfrontend -> apiservice service discovery does not resolve on Radius (no Service for the apiservice container), so /weather cannot render forecast data. Co-authored-by: Copilot App <[email protected]> Copilot-Session: e6ab6cb7-df30-489d-8140-d00294846005
- KIND deploy wait scopes to the deploy command's own sequence-numbered success prompt instead of WaitForPipelineSuccessAsync, which could match the stale "Pipeline succeeded" left by the earlier `aspire publish`. - Split the VERIFY_OK success marker in the shell source (VERIFY''_OK) so the contiguous token appears only in curl's output, not in the echoed command line where WaitUntilTextAsync would match it prematurely. - AKS test now backs up a real ~/.kube/config and force-symlinks the default path to the isolated $KUBECONFIG, then restores it in `finally`, so a local run cannot read (or be left pointing at) the developer's own cluster. - README documents the actual per-container HTTP probes and the current Radius limitation (no Service for Radius.Compute/containers workloads), so cross-container connectivity is honestly scoped out. - Corrected the InstallRadiusControlPlaneAsync doc comment: `rad install kubernetes` does provision the default group/environment but not a workspace. Co-authored-by: Copilot App <[email protected]> Copilot-Session: e6ab6cb7-df30-489d-8140-d00294846005
- RestoreDefaultKubeConfig no longer risks deleting a developer's own ~/.kube/config: Step 8b now writes a marker before shadowing the path and backs up any pre-existing entry (regular file OR symlink, including a dangling one, preserved via `cp -a`). Cleanup only runs when the marker is present (provisioning can fail before Step 8b) and restores the original verbatim, so a local run is never left with a deleted or dangling default kubeconfig. - Corrected the RadiusDeployTests wiring comment: a native Radius.Compute/containers workload gets no Kubernetes Service, so the test port-forwards straight to the Deployment (the previous "Service the recipe creates" wording was wrong). - Corrected the class summary: the live Azure/AKS test runs on demand AND nightly (deployment-tests.yml schedule), not "only on demand". Co-authored-by: Copilot App <[email protected]> Copilot-Session: e6ab6cb7-df30-489d-8140-d00294846005
|
Retrying the failed CI jobs for this pull request from the CI run attempt. The rerun is being tracked in the rerun attempt. |
AKS test (RadiusStarterDeploymentTests): bake a workspace-local HOME into the Step 1b rad shim so every rad invocation - including rad workspace create and the rad deploy that aspire deploy spawns - reads the isolated kubeconfig at $HOME/.kube/config (which several rad subcommands read directly, ignoring KUBECONFIG). This keeps the developer's real ~/.kube/config and ~/.rad untouched for the run without any backup/restore, addressing the shared-state review feedback. The kubeconfig symlink is folded into Step 1b (its target is written by az aks get-credentials before the first rad runs). KIND test (RadiusDeployTests): repin the container image to the stable digest-pinned mcr.microsoft.com/azuredocs/aci-helloworld to avoid depending on a mutable tag (tracked by microsoft#18747). Co-authored-by: Copilot App <[email protected]> Copilot-Session: e6ab6cb7-df30-489d-8140-d00294846005
Description
Follow-up to #18696 (Add
Aspire.Hosting.Radius). Adds a live end-to-end deployment test that actually runsaspire deploy(rad deploy app.bicep) against a real AKS cluster with a Radius control plane and verifies the deployed behavior — not just the Bicep snapshot/serializer output covered by the existing unit tests.Maintainers requested this as a separate second pass after #18696:
What the test does
RadiusStarterDeploymentTests.DeployStarterTemplateToRadiusOnAks:rad install kubernetes) and creates a deterministic non-interactive workspace scoped todefault/default.aspire-startertemplate (with Redis cache).apiservice/webfrontendimages to ACR and attaches them viaWithContainerImage(...)— required becauseaspire deployon Radius only runsrad deploy app.bicepand does not build/push project images.aspire publishand asserts the generatedapp.bicepreferences the pushed ACR images.aspire deploy, then verifies the deployment: Radius app graph + container resources, all app pods ready (radapp.io/application=app), and theapiservice/webfrontendHTTP endpoints via port-forward.finally.Notes
Setup Radiusstep is added todeployment-tests.yml(runs only for this test's class) that installs the pinnedradCLI (v0.59.0, matching the integration's Bicep type version).microsoftorg, so full live validation happens once this runs against real AKS+Radius infra.Checklist