-
Notifications
You must be signed in to change notification settings - Fork 543
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
Make the dashboard an appmodel resource #3453
Conversation
- Moved dashboard resource into a lifecycle hook instead of making it a dcp resource. This removes the specialized code from ApplicationExecutor from knowing about the dashboard. As a result of this change I also cleaned up how we configure and validate dcp options to use IConfigureOptions and IValidateOptions. - Added tests for the dashboard resource - Made a change to ApplicationExecutor to allow resources that start as hidden to remain hidden.
6e7cf1e
to
ef23c70
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
This is a huge change but good one. Makes things a lot cleaner. |
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.
Looks good. Minor things.
- Added hidden to a new known resource states class - Added more test cases
_innerBuilder.Services.AddSingleton<IKubernetesService, KubernetesService>(); | ||
// DCP stuff | ||
_innerBuilder.Services.AddSingleton<ApplicationExecutor>(); | ||
_innerBuilder.Services.AddSingleton<IDashboardEndpointProvider, HostDashboardEndpointProvider>(); |
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.
HostDashboradEndpointProvider
is being added regardless of whether the dashboard is enabled.
* Make the dashboard an appmodel resource - Moved dashboard resource into a lifecycle hook instead of making it a dcp resource. This removes the specialized code from ApplicationExecutor from knowing about the dashboard. As a result of this change I also cleaned up how we configure and validate dcp options to use IConfigureOptions and IValidateOptions. - Added tests for the dashboard resource - Made a change to ApplicationExecutor to allow resources that start as hidden to remain hidden. - Added hidden to a new known resource states class - Added more test cases
* Improve service address allocation (#3294) * Improve service address allocation Should fix #3265 * Make the dashboard an appmodel resource (#3453) * Make the dashboard an appmodel resource - Moved dashboard resource into a lifecycle hook instead of making it a dcp resource. This removes the specialized code from ApplicationExecutor from knowing about the dashboard. As a result of this change I also cleaned up how we configure and validate dcp options to use IConfigureOptions and IValidateOptions. - Added tests for the dashboard resource - Made a change to ApplicationExecutor to allow resources that start as hidden to remain hidden. - Added hidden to a new known resource states class - Added more test cases * Only add dashboard services if the dashboard is enabled (#3489) * Only add dashboard services if the dashboard is enabled * Don't wait until after we've started the entire app to print the token (#3472) - Print it right after we print the dashboard url - Refactored the dashboard resource to use DashboardOptions instead of DcpOptions --------- Co-authored-by: Karol Zadora-Przylecki <karolz@microsoft.com> Co-authored-by: Reuben Bond <203839+ReubenBond@users.noreply.github.com>
IConfigureOptions
andIValidateOptions
.AI generated:
This pull request includes changes to the
Aspire.Hosting
project, specifically to theDashboardLifecycleHook.cs
andApplicationExecutor.cs
files. The changes mainly revolve around the removal of the dashboard configuration and lifecycle hooks, the addition of a new lifecycle hook, and modifications to the state of the dashboard resource.Here are the most important changes:
src/Aspire.Hosting/Dashboard/DashboardLifecycleHook.cs
: A new lifecycle hook was added. This hook configures the dashboard resource before the start of the application. It checks if the dashboard resource exists and configures it, or adds a new dashboard resource if it doesn't exist. The configuration includes setting up the dashboard path, working directory, executable resource, and environment variables.Removal of dashboard configuration from ApplicationExecutor:
src/Aspire.Hosting/Dcp/ApplicationExecutor.cs
: Several methods related to the dashboard configuration were removed, includingConfigureAspireDashboardResource
,StartDashboardAsDcpExecutableAsync
,GetDashboardEnvironmentVariablesAsync
, andPrintDashboardUrls
. Also, the dashboard configuration was removed from theRunApplicationAsync
method.Modifications to dashboard resource state:
src/Aspire.Hosting/Dcp/ApplicationExecutor.cs
: The state of the dashboard resource was modified in theToSnapshot
methods forContainer
,Executable
, andProject
resources. The state is now set to "Hidden" if the initial state in the application model is "Hidden". [1] [2] [3] [4]Other changes:
src/Aspire.Hosting/Dcp/ApplicationExecutor.cs
: ThePreparePlainExecutables
andPrepareProjectExecutables
methods now call a new methodSetInitialResourceState
to set the initial state of the resource. [1] [2]src/Aspire.Hosting/Dcp/ApplicationExecutor.cs
: Several references to the dashboard and related parameters were removed from theApplicationExecutor
class. [1] [2] [3] [4]Fixes #3450
Microsoft Reviewers: Open in CodeFlow