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
Added support for node and npm based projects #1033
Conversation
- Added AddNodeApp and AddNpmApp extension methods - Flow the project's working directory into the host in 2 ways, via an attribute and as another project in the list. By default, executable's working directory are relative to the AppHost's project directory (this is what the attribute is used for). - Added support for flowing the dynamically chosen port to the application by specifying a "portEnvVar" setting on the ServiceBindingAnnotation. - This test relies on node being installed.
- This allows custom resources to opt-in to service discovery exports. - Removed extra generic argument from WithReference
src/Aspire.Hosting/ApplicationModel/ServiceBindingAnnotation.cs
Outdated
Show resolved
Hide resolved
Overall this looks pretty solid. |
I think if we go down the path of emitting a |
Right, I think this is what we need to decide. Today for project.v0 resources (maybe this should be a dotnet.v0 resource) we recommend people use container builds, but that's all dependent on the target environment. You could imagine it meaning do a dotnet publish and zip the results and upload it to the target (It could mean use the nodejs build pack... etc) I think docker file support needs to be an explicit call. |
Regarding renaming What I mean about Docker support though is that I think as a framework orientated towards cloud native development we assume that if you have a reosurce like Node or Python apps that there will be a Docker build involved in deployment. |
Right, but I don't think we should assume that. Maybe the deployment tool can make that assumption. If you see a node.v0 resource, or a python.0 resource, we point you at the source location and the tool can determine that it requires a docker file to produce asserts for deployment (or not). |
- Renamed PortEnvVar to env - Added manifest resource for node apps (node.v0) - Cleaned up executable support
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.
Assuming WriteNodeApp
is temporarily in ManifestPublisher
until the ManifestPublisherCallbackAnnotation
is updated to take a context.
@@ -63,13 +63,51 @@ public class ]]>%(ClassName)<![CDATA[ : IServiceMetadata | |||
</ItemGroup> | |||
</Target> | |||
|
|||
<Target Name="CreateProjectMetadata"> |
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.
@baronfel can you give me an after the fact review on 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.
This all seems ok to me, seems straightforward enough based on the existing patterns.
IResourceWithServiceDiscovery
which allows custom resources to export service discovery information.Added node.v0 resource for node appsTODO:
Test for npm based project.Figure out what to do for deployment? Should we model this as anode.v0
resource? That would match what we do for .NET projects...Fixes #1017
PS: Fixing some of these issues (flowing port to the app and fixing working directories makes it easier to execute other project types in general). AddNpmApp and AddNodeApp are very thin wrappers now.