-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove DCP and Dashboard from the .NET Aspire SDK Workload #4708
Conversation
We should test the DCP nuget packages on Mac/Linux to make sure there won't be any issues with the executable binaries; the SDK/workloads have a special mechanism for applying executable permissions (the UnixFilePermissions.xml file) and I'm not sure if simple nuget files support the same behavior. #Resolved |
Good point. I did test this on Linux and Windows, and all scenarios I tested work as expected, but I didn't test on Mac yet. #Resolved |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
9c49d04
to
bd4ea6f
Compare
Ok folks, this is ready to go. Can I get a final review so this can get merged? cc: @DamianEdwards, @eerhardt, @radical, @danegsta #Resolved |
eng/dashboardpack/buildMultiTargeting/Aspire.Dashboard.Sdk.in.props
Outdated
Show resolved
Hide resolved
eng/dashboardpack/buildMultiTargeting/Aspire.Dashboard.Sdk.in.targets
Outdated
Show resolved
Hide resolved
eng/dashboardpack/buildTransitive/Aspire.Dashboard.Sdk.in.props
Outdated
Show resolved
Hide resolved
Most of my feedback can be addressed in a follow up. #Resolved |
This comment was marked as off-topic.
This comment was marked as off-topic.
</PropertyGroup> | ||
|
||
<!-- At this point, we should have the version either by CPM or PackageReference, so we fail if not. --> | ||
<Error Condition="'$(AppHostVersion)' == '' or $([MSBuild]::VersionLessThan('$(AppHostVersion)', '8.2.0'))" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: It might be useful to split this into two separate error messages, to help with debugging when this fails.
AppHostVersion==''
, we could not figure out the version to use, and have a better error message in case of CPM.AppHostVersion < 8.2.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We would know at that point. If 1., then the warning will not have the version you are using (see line 90 above). If 2 then you'd see which version you are using in the error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great work! LGTM! 👍
|
||
.NET Aspire currently ships as a .NET SDK Workload. This workload currently includes the following components: | ||
|
||
- Aspire.Hosting.SDK (MSBuild SDK): This SDK contains some props and targets with the required logic to properly handle `ProjectReferences` in the .NET Aspire AppHost projects, which then drives the source generation that allows the AppHost project to have strongly typed references to project resources. This component cannot be changed into a regular NuGet package, as the logic it carries neeeds to be executed before the initial restore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Aspire.Hosting.SDK (MSBuild SDK): This SDK contains some props and targets with the required logic to properly handle `ProjectReferences` in the .NET Aspire AppHost projects, which then drives the source generation that allows the AppHost project to have strongly typed references to project resources. This component cannot be changed into a regular NuGet package, as the logic it carries neeeds to be executed before the initial restore. | |
- Aspire.Hosting.SDK (MSBuild SDK): This SDK contains some props and targets with the required logic to properly handle `ProjectReferences` in the .NET Aspire AppHost projects. This component cannot be changed into a regular NuGet package, as the logic it carries neeeds to be executed before the initial restore. |
This bit makes it sound like the source generation comes from this SDK, but it doesn't. I would just drop it to avoid confusion.
- Aspire.Hosting.SDK (MSBuild SDK): This SDK contains some props and targets with the required logic to properly handle `ProjectReferences` in the .NET Aspire AppHost projects, which then drives the source generation that allows the AppHost project to have strongly typed references to project resources. This component cannot be changed into a regular NuGet package, as the logic it carries neeeds to be executed before the initial restore. | ||
- Aspire.ProjectTemplates (.NET Template Pack): This is a set of project templates that allow users to create new .NET Aspire projects using `dotnet new` commands and Visual Studio "New Project" dialog. | ||
- Aspire.Hosting.Orchestration (MSBuild SDK): This SDK contains two main things: the Developer Control Plane executable (DCP) as well as a targets file which defines properties for the AppHost to be able to find the DCP executable and run it. | ||
- Aspire.Dashboard.SDK (MSBuild SDK): Similar to the Orchestration SDK, this one provides the .NET Aspire Dashboard application (self-contained app that depends on .NET 8 runtime) and the targets file that defines properties for the AppHost to be able to find the Dashboard executable and launch it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Aspire.Dashboard.SDK (MSBuild SDK): Similar to the Orchestration SDK, this one provides the .NET Aspire Dashboard application (self-contained app that depends on .NET 8 runtime) and the targets file that defines properties for the AppHost to be able to find the Dashboard executable and launch it. | |
- Aspire.Dashboard.SDK (MSBuild SDK): Similar to the Orchestration SDK, this one provides the .NET Aspire Dashboard application (a framework-dependent app that depends on .NET 8 runtime) and the targets file that defines properties for the AppHost to be able to find the Dashboard executable and launch it. |
This isn't a self-contained app.
- Aspire.ProjectTemplates (.NET Template Pack): This is a set of project templates that allow users to create new .NET Aspire projects using `dotnet new` commands and Visual Studio "New Project" dialog. | ||
- Aspire.Hosting.Orchestration (MSBuild SDK): This SDK contains two main things: the Developer Control Plane executable (DCP) as well as a targets file which defines properties for the AppHost to be able to find the DCP executable and run it. | ||
- Aspire.Dashboard.SDK (MSBuild SDK): Similar to the Orchestration SDK, this one provides the .NET Aspire Dashboard application (self-contained app that depends on .NET 8 runtime) and the targets file that defines properties for the AppHost to be able to find the Dashboard executable and launch it. | ||
- Aspire.Hosting (Regular NuGet Library): This package isn't really required to be in the workload, as this is a PackageReference that all AppHost projects will have. The advantage that we get currently from having it in the workload is that this would install it into the global NuGet cache when the workload is installed, so that the AppHost projects can find it without needing to restore it from the NuGet feed. This is helpful especially for offline scenarios. The package itself provides the Aspire.Hosting library which contains all of the main logic in Aspire for building and running .NET Aspire applications. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Aspire.Hosting (Regular NuGet Library): This package isn't really required to be in the workload, as this is a PackageReference that all AppHost projects will have. The advantage that we get currently from having it in the workload is that this would install it into the global NuGet cache when the workload is installed, so that the AppHost projects can find it without needing to restore it from the NuGet feed. This is helpful especially for offline scenarios. The package itself provides the Aspire.Hosting library which contains all of the main logic in Aspire for building and running .NET Aspire applications. | |
- Aspire.Hosting.AppHost (Regular NuGet Library): This package isn't really required to be in the workload, as this is a PackageReference that all AppHost projects will have. The advantage that we get currently from having it in the workload is that this would install it into the global NuGet cache when the workload is installed, so that the AppHost projects can find it without needing to restore it from the NuGet feed. This is helpful especially for offline scenarios. The package itself provides the Aspire.Hosting library which contains all of the main logic in Aspire for building and running .NET Aspire applications. |
The Aspire.Hosting.AppHost
is the nuget package that is referenced by all AppHost projects. It has a dependency on Aspire.Hosting
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did actually mean Aspire.Hosting as that is the one that we had in the workload, but the wording is wrong here I agree, so I'll fix that.
a reference to Aspire.Dashboard.Sdk and Aspire.Hosting.Orchestration for the build-time platform using | ||
the same version. This is done here dynamically to avoid having to pull in DCP and Dashboard packages | ||
for all of the platforms. This mechanism can be disabled by setting `SkipAddReferenceToDashboardAndDCP` to `true` --> | ||
<Target Name="AddReferenceToDashboardAndDCP" BeforeTargets="Restore;CollectPackageReferences" Condition="'$(SkipAddReferenceToDashboardAndDCP)' != 'true'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Target Name="AddReferenceToDashboardAndDCP" BeforeTargets="Restore;CollectPackageReferences" Condition="'$(SkipAddReferenceToDashboardAndDCP)' != 'true'"> | |
<Target Name="AddReferenceToDashboardAndDCP" BeforeTargets="Restore;CollectPackageReferences" Condition="'$(SkipAddAspireDefaultReferences)' != 'true'"> |
Since this is more-or-less a public facing MSBuild property, I think we should leave names like "DCP" out of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SkipImplicitAspireReferences
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or AspireSkipImplicitReferences
playground/Directory.Build.props
Outdated
Playground applications have their own way of referencing Aspire.Hosting.AppHost, as well as DCP and Dashboard, so we disable | ||
the Aspire.Hosting.SDK targets that will automatically add these references to projects. | ||
--> | ||
<SkipAddReferenceToDashboardAndDCP Condition="'$(TestsRunningOutsideOfRepo)' != 'true'">true</SkipAddReferenceToDashboardAndDCP> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@radical - above we are using Condition="'$(RepoRoot)' != ''"
. Is one check better than the other? Should we be consistent?
<Target Name="__ErrorOnMininumWorkloadVersionMissing" BeforeTargets="PrepareForBuild" | ||
Condition="'$(IsAspireHost)' == 'true' and ('$(AspireHostingSDKVersion)' == '' or $([MSBuild]::VersionLessThan('$(AspireHostingSDKVersion)', '8.2.0')))"> | ||
<Error Code="ASPIRE005" | ||
Text="$(MSBuildProjectName) project requires a newer version of the .NET Aspire Workload to work correctly. Please run `dotnet workload update`." /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this message say what version is required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a test for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this message say what version is required?
I'm not so sure about this one, but I am open to suggestions. The thinking is that this minimum version will change over time, so I'm not sure if we want consistent messages, especially when the fix is to run dotnet workload update
which you can't really use to select which version to move to (as it always goes to latest).
Do we need a test for this?
I do think this would be good and I thought about it, but the problem is that it won't be trivial as I don't think we have a way of running tests with an SDK without the workload, or with an older workload, but @radical can correct me if I'm wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a test for this?
I do think this would be good and I thought about it, but the problem is that it won't be trivial as I don't think we have a way of running tests with an SDK without the workload, or with an older workload, but @radical can correct me if I'm wrong.
We do have a way to run tests with a SDK that has the updated manifest from artifacts
, but does not have the workload installed. I can add that test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with an older workload
.. this would need some work. Do we want this one?
@@ -20,6 +20,10 @@ | |||
</ItemGroup> | |||
|
|||
<ItemGroup> | |||
<!-- | |||
Note that this package won't add a transitive dependency to DCP and Dashboard, as those will dynamically be added by the SDK. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this package won't add a transitive dependency to DCP and Dashboard, as those will dynamically be added by the SDK. | |
Note that this package won't add a transitive dependency to DCP and Dashboard, as those will dynamically be added by the Aspire.Hosting.Sdk. |
@@ -143,4 +143,9 @@ | |||
<Import Project="$(RepoRoot)src\Aspire.Hosting.Sdk\SDK\Sdk.targets" Condition="Exists('$(RepoRoot)src\Aspire.Hosting.Sdk\SDK\Sdk.targets')" /> | |||
</ImportGroup> | |||
|
|||
<PropertyGroup Condition="'$(RepoRoot)' != 'null' and '$(TestsRunningOutsideOfRepo)' != 'true' and '$(IsAspireHost)' == 'true'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'$(RepoRoot)' != 'null'
is that the right condition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used the same condition than the one used by the itemgroup above (as I want it to apply exactly in the same situation). If we are changing one, we should change both.
@@ -0,0 +1,9 @@ | |||
<Project> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we creating all these RID specific packages for the Dashboard just so we can get RID specific app hosts? 99% of the nuget package is identical. The only difference is the executable that launches the app?
Could we make it more like a .NET global tool and only have to ship 1 nuget package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, I believe. We actually no longer need to have all of these separate projects anymore, so in a follow up PR I am going to explore how to reduce and simplify this.
Fixes #5185
cc: @davidfowl @danegsta @mhutch @DamianEdwards @marcpopMSFT @eerhardt @danmoseley @maddymontaquila @radical
Microsoft Reviewers: Open in CodeFlow