-
Notifications
You must be signed in to change notification settings - Fork 132
Adds API RunAsExecutable for DAB integration #831
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
Conversation
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.
Pull Request Overview
This PR adds API support for running Data API Builder (DAB) as a local executable instead of just as a container. The main purpose is to enable HTTPS and OpenTelemetry (OTEL) support in the local development experience while maintaining container deployment for publish mode.
Key changes:
- Introduces
RunAsExecutable()extension method that creates an executable resource in development mode while falling back to container deployment in publish mode - Adds new
DataApiBuilderExecutableResourceclass andIDataApiBuilderResourceinterface to support both container and executable resource types - Updates example configuration to demonstrate the new functionality with OTEL telemetry support
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
DataApiBuilderHostingExtension.cs |
Adds the RunAsExecutable() extension method and refactors shared defaults into generic method |
DataApiBuilderContainerResource.cs |
Introduces interface abstraction and new executable resource class with shared constants |
ContainerResourceCreationTests.cs |
Comprehensive test coverage for the new executable functionality including argument construction, endpoints, and error cases |
dab-config.json |
Updates example configuration to include OpenTelemetry settings |
Program.cs |
Demonstrates usage of the new RunAsExecutable() method |
src/CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder/DataApiBuilderHostingExtension.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder/DataApiBuilderContainerResource.cs
Outdated
Show resolved
Hide resolved
src/CommunityToolkit.Aspire.Hosting.Azure.DataApiBuilder/DataApiBuilderHostingExtension.cs
Outdated
Show resolved
Hide resolved
…piBuilderHostingExtension.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…piBuilderContainerResource.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…piBuilderHostingExtension.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Minimum allowed line rate is |
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.
Before doing a detailed review, I want to ask a question about the design.
My assumption is that the intent of RunAsExecutable would be to treat the exe version as a local dev only solution, essentially an emulator right?
Working on that assumption, I think it'd be best to use the pattern we see with RunAsEmulator on things like the Azure Storage resource, or RunAsContainer for databases.
The primary difference in the design would be that you don't return the "emulated" resource, but instead you provide it as a callback to the RunAsEmulator method (or in this case RunAsExecutable). That way, if there's stuff you want to do that is specific to the "emulated" resource, you do it in the callback, and everything else is bubbled up from the real resource.
|
@tommasodotNET Does this also address #388 ? |
|
Let's wait for #602 and see if that solves the issue for both otel and https support in dab locally. If it does, this extension might not be needed. |
|
in any case, we should update the dab image tag to at least 1.4.26 since it introduces support for otel. |
Closes #639
DAB can now be run as executable locally. This allows support for https and OTEL in the local dev experience:
When the application is in Publish mode, the
RunAsExecutableextension will be ignored and the resource will be deployed using the DAB docker image.PR Checklist
Other information