-
Notifications
You must be signed in to change notification settings - Fork 526
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
Extending Aspire orchestration capability to Java-based apps #4491
Comments
I think we need to unify the resource types:
We have a pattern for 1 and 3 today, this new resource type is number 2. I wonder if there's a way we can represent number 2 without a split resource type. The other thing I would mention is that that the options object is a bit different from our existing builder pattern API (not sure if it's a bad thing). Feels similar to #4472 for .NET project resources. There needs to be a way to say, use this endpoint name as the spring boot server port. I'd like @mitchdenny's take on this. |
Currently, the
The introduction of the For the executable (pattern 1), it always uses server port and OTEL agent JAR file path with slight variations like port number value and agent path value. For the container (pattern 3), yeah, I kind of agree it depends on the existing |
I did a few experiments for the pattern 2 and 3 and it really depends on how the container image has been built. Therefore, providing the For the pattern 1, I also think it's reasonable to leave devs to pass their arguments including the OTEL agent JAR file path, instead of using that Thinking of the pattern 3, though, it's only valid if the Spring app is under the same repo where |
I'm starting to think that we have a |
Now, we can add Python app to .NET Aspire Can Java follow the similar process? |
@justinyoo absolutely! |
+1 for adding Java supports |
@justinyoo were you interested at taking a run at this? |
I can help testing this feature/functionality. In Java/Spring Boot/Quarkus space for a long time, so can help think test strategies, execute and implement them. |
This moved to the community toolkit https://github.com/CommunityToolkit/Aspire |
Background and Motivation
.NET Aspire, as an orchestration engine to build a clound-native application, is capable of bringing other type of applications written in different language like Java (Spring Boot for example). The current API offers both
.AddContainer(...)
and.AddExecutable(...)
for the generic purpose.However, it would be great if we can provide Java-specific extension methods like
AddJavaApp(...)
for generic Java app andAddSpringApp(...)
for Spring-focused app, as we provideAddNodeApp(...)
andAddNpmApp(...)
.By doing so, we can wrap Java-specific arguments pre-built so that devs only focus on passing arguments they really need.
I've PoC'd for this suggestion here: https://github.com/aliencube/aspire-contribs/tree/main/src/Aspire.Contribs.Hosting.Java
Proposed API
I've got two API suggestions – one based on
ExecutableResource
and the other based onContainerResource
.ExecutableResource
-based APIPublishAsDockerfile(...)
method.ContainerResource
-based APII'd also like to introduce the options pattern here to pass some common options like:
NOTE that the
OtelAgentPath
should be provided for Java app to be OpenTelemetry-able.Therefore, based on the options instance, devs call the same method,
AddSpringApp(...)
, and the method uses either container or executable.Usage Examples
With this API suggestion, devs can orchestrate like this:
Alternative Designs
Risks
The text was updated successfully, but these errors were encountered: