Skip to content
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 ResourceLoggerService and ResourceNotification service for DCP based resource changes #2731

Merged
merged 2 commits into from
Mar 10, 2024

Conversation

davidfowl
Copy link
Member

@davidfowl davidfowl commented Mar 8, 2024

The goal here is to hand a single way to handle resource notification and logs by using the interface we introduced for custom resources everywhere. The dashboard data model now depends on these services and nothing DCP specific. The god class ApplicationExecutor now watches for changes after initializing services.

  • Moved all of the DCP logic calling into k8s APIs into the ApplicationExecutor.
  • Added an overload of WatchAsync that watches all resources. This is what the dashboard uses.
  • Watch logs as soon as they become available an push them through the
    ResourceLoggerService API. This makes them avaialble to anyone looking
    for logs.
  • Support sending updates based on IResource and a unique resource id. This is how we can support unique snapshots for replicas.
  • Introduce a "Hidden" state to allow hiding resources from the dashboard views. Use this to hide app model resources after DCP has loaded the resource.
  • Watching resource state changes are global. This makes it possible to listen to changes to replicas since they aren't directly represented in the model, but they are still associated with an IResource.
  • Publish the initial state of any resource on start.

Fixes #2548

Microsoft Reviewers: Open in CodeFlow

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Mar 8, 2024
@davidfowl davidfowl requested a review from karolz-ms March 8, 2024 10:18
@davidfowl davidfowl force-pushed the davidfow/decoupledashboardfromdcp branch 2 times, most recently from 2a87dd9 to 8e6ca7f Compare March 9, 2024 03:50
@davidfowl davidfowl marked this pull request as ready for review March 9, 2024 03:51
@davidfowl davidfowl force-pushed the davidfow/decoupledashboardfromdcp branch 2 times, most recently from 9a83a02 to f59608b Compare March 9, 2024 16:22
- Moved all of the DCP logic calling into k8s APIs into the
  ApplicationExecutor.
- Added an overload of WatchAsync that watches all resources. This is
  what the dashboard uses.
- Watch logs as soon as they become available an push them through the
  ResourceLoggerService API. This makes them avaialble to anyone looking
  for logs.
- Support sending updates based on IResource and a unique resource id. This
is how we can support unique snapshots for replicas.
- Introduce a "Hidden" state to allow hiding resources from the
  dashboard views. Use this to hide app model resources after DCP has
  loaded the resource.
- Watching resource state changes are global. This makes it possible to listen to changes to replicas since they aren't directly represented in the model, but they are still associated with an IResource.
- Publish the initial state of any resource that has a ResourceSnapshot annotation.
@davidfowl davidfowl force-pushed the davidfow/decoupledashboardfromdcp branch from f59608b to c693f3b Compare March 9, 2024 16:22
@davidfowl davidfowl merged commit 1ec8d16 into main Mar 10, 2024
8 checks passed
@davidfowl davidfowl deleted the davidfow/decoupledashboardfromdcp branch March 10, 2024 21:41
@github-actions github-actions bot locked and limited conversation to collaborators Apr 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Projects
None yet
3 participants