-
Notifications
You must be signed in to change notification settings - Fork 418
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
Use gRPC to communicate data from app host to dashboard #1476
Conversation
The UI will have a single object type for all resources, treating the uniformly. That object has both a fixed set of fields, and now its own extensible metadata. In the protocol between ResourceService and Dashboard, we'll need an extensible way to model these resource data. This allows the UI to work with resource types it hasn't seen before.
We are moving towards removing `Aspire.Hosting`'s reference to `Aspire.Dashboard`. In this new model we will have different types on the back end and front end. - DCP has its own types (e.g. `CustomResource`), which remain untouched, and exist only on the back end. - `ResourceSnapshot` is a new abstract base class for `ContainerSnapshot`, `ExecutableSnapshot` and `ProjectSnapshot`. These are immutable, have no view-specific data, and will only be used on the back end. In the near future, these objects will be used to populate gRPC messages. - `ResourceViewModel` remains, though only on the front end. It no longer has subclasses. We are designing the dashboard to support arbitrary resource types. In the near future, these objects will be constructed and updated in response to gRPC messages. As the front end no longer has subclasses of `ResourceViewModel`, some of the hard-coded resource-specific logic has been changed to work on the additional data within a resource. We also introduce a `KnownResourceTypes` static class with consts for known resource type names (e.g. "Container").
Uses the gRPC `.proto` file added in a previous commit (with some small changes) to model data sent between the back end (app host) and front end (dashboard). Currently this occurs within the same process, but future work will split the dashboard out of the app host. - Object flow is now "DCP -> snapshots -> gRPC messages -> view models". - Move `DashboardWebApplication` initialization out of `DcpHostService` and into the new `DashboardWebApplicationHost` in preparation for future split. - Split `ResourceSubscription`/`ResourceChange`/`ResourceChangeType` into both snapshot and view model versions, for use on back/front ends respectively.
This was missed in a previous commit where we renamed ResourceDataKeys to KnownProperties.
We don't use this consistently throughout. Plenty of places still require a unique resource name as a key. If we want to change this later, we should do it wholesale across the system in future work.
@JamesNK PTAL |
This prevents corruption from concurrent updates of a non-concurrent dictionary.
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.
Overall LGTM, just a couple questions
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.
approved
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.
Some improvements are available to make in comments, but they can be done later. LGTM
Excellent work everyone! |
Follows comments on dotnet#1476. Uses a component for the application name, which might not be available during the first render, and may require an additional render once the client has connected to the server and retrieved the name.
* Use component for application name Follows comments on #1476. Uses a component for the application name, which might not be available during the first render, and may require an additional render once the client has connected to the server and retrieved the name. * Use OnInitializedAsync * Prefix field name with underscore * Cancel wait on connection if component disposed
Includes PR #1415, with feedback from that PR addressed here.
This is another step towards #1003. Ultimately the dashboard will run in a separate process to the app host. That will require a network connection between the processes for data.
This PR splits the front and back end to use separate types, with a gRPC channel between them.
The
.proto
defined in #1274 is used here, with some modifications following the integration.Contributes to #436.
Microsoft Reviewers: Open in CodeFlow