Upgrade Foundry Local to 1.1.0 - #17889
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 17889Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 17889" |
There was a problem hiding this comment.
Pull request overview
This PR upgrades the Foundry Local integration to Microsoft.AI.Foundry.Local 1.1.0 while preserving the existing AppHost API (RunAsFoundryLocal()) by switching the runtime implementation from in-proc manager APIs to invoking the installed foundry CLI for service lifecycle and model management.
Changes:
- Replace
FoundryLocalManager-based startup/model operations with CLI-driven operations (foundry service start|stop|list,foundry model download|load). - Update health checks to validate service/model state via the new CLI-backed service helper.
- Upgrade the
Microsoft.AI.Foundry.Localpackage reference to 1.1.0 and adjust tests accordingly.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Hosting.Azure.Tests/FoundryExtensionsTests.cs | Updates assertions to align with the new local runtime integration (no manager DI). |
| src/Aspire.Hosting.Foundry/LocalModelHealthCheck.cs | Switches model-loaded checks to the CLI-backed helper. |
| src/Aspire.Hosting.Foundry/FoundryLocalService.cs | Introduces the new CLI-based Foundry Local service + lifecycle hosted service. |
| src/Aspire.Hosting.Foundry/FoundryLocalHealthCheck.cs | Switches service-running checks to the CLI-backed helper. |
| src/Aspire.Hosting.Foundry/FoundryExtensions.cs | Wires AppHost resource lifecycle/model init to the new CLI-based implementation. |
| src/Aspire.Hosting.Foundry/FoundryDeploymentResource.cs | Updates documentation around the meaning of the local ModelId field. |
| Directory.Packages.props | Bumps Microsoft.AI.Foundry.Local to 1.1.0. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
❌ CLI E2E Tests failed — 112 passed, 1 failed, 2 unknown (commit ❌ Failed Tests
View all recordings
📹 Recordings uploaded automatically from CI run #26918296847 |
|
Pull request created: #1210
|
|
📝 Documentation has been drafted in microsoft/aspire.dev#1210 targeting Updated the "Use Foundry Local for development" section in
Note This draft PR needs human review before merging. |
* Upgrade Foundry Local to 1.1.0 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address Foundry Local review issues Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Resolve Foundry Local lifecycle review comments Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Change command from 'list' to 'ps' in FoundryLocalService --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Description
Upgrade the Foundry Local integration to
Microsoft.AI.Foundry.Local1.1.0 while keepingRunAsFoundryLocal()working for local AppHost scenarios. The 1.1.0 package no longer exposes the same manager APIs used by Aspire, and local SDK-based startup failed because the native Foundry Local core was not available from the NuGet package assets.This change keeps the user-facing AppHost API the same and switches the runtime integration to the installed
foundryCLI. Aspire now starts the local service withfoundry service start, discovers the emitted endpoint, downloads and loads models through CLI commands, checks loaded models withfoundry service list, and stops the service during AppHost shutdown/disposal withfoundry service stop.User-facing usage
The existing C# AppHost usage stays the same:
Users do not need to pre-start Foundry Local, but the
foundryCLI must be installed and available onPATH.Security considerations
This change starts an installed local executable and opens the Foundry Local service listener managed by that executable. Command arguments are passed through
ProcessStartInfo.ArgumentListinstead of shell command strings, and the service is stopped when the AppHost stops or is disposed. Security review is useful to confirm the process-spawning and local-listener behavior is acceptable for this preview integration.Validation
dotnet test --project tests/Aspire.Hosting.Foundry.Tests/Aspire.Hosting.Foundry.Tests.csproj --no-launch-profile -- --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"dotnet test --project tests/Aspire.Hosting.Azure.Tests/Aspire.Hosting.Azure.Tests.csproj --no-launch-profile -- --filter-class "*.FoundryExtensionsTests" --filter-not-trait "quarantined=true" --filter-not-trait "outerloop=true"dotnet build src/Aspire.Hosting.Foundry/Aspire.Hosting.Foundry.csproj --no-restore /p:SkipNativeBuild=trueRunning, and is stopped after AppHost disposal.Fixes # (issue)
Checklist
<remarks />and<code />elements on your triple slash comments?