Replies: 45 comments 36 replies
-
Clone multiple repos locally, create an Uber solution and add the apphost to it, wiring up all of the projects required. That's where I would start. it you don’t want to pull and run the other repos locally, then I’m not sure exactly what the workflow would be (point to something already running). |
Beta Was this translation helpful? Give feedback.
-
Some patterns I imagine might emerge:
|
Beta Was this translation helpful? Give feedback.
-
I believe we would need to publish our service defaults as a NuGet package, published to our own private NuGet server (Azure Artifacts in our case). Then projects throughout all the different repos could add a reference to this service defaults NuGet package. |
Beta Was this translation helpful? Give feedback.
-
Yep, or you could put the ServiceDefaults in a sub-module and include it that way. There are lots of ways for folks to share code and assets among teams and I don't think we want to be too prescriptive about it. We should ensure we're flexible enough to support different patterns. |
Beta Was this translation helpful? Give feedback.
-
@DamianEdwards would be nice to have some samples on how to proceed with multi-repo scenarios. It is definitely a very cool and useful tool, but a huge part of microservice solutions are split across different repos, and in this case its not that obvious how to utilize it in local environment. |
Beta Was this translation helpful? Give feedback.
-
I also don't understand how the deployment story is in this scenario, where we "run" our k8s cluster with a custom cloud platform team. For instance, we use github + tekton pipelines + argo CD to deploy to k8s using multiple repos (one per service), all things k8s related are generated/managed by the platform (I've worked in previous companies with similar setup bu using different tools like gitlab as an example) How Aspire can be helpful in this cases? |
Beta Was this translation helpful? Give feedback.
-
Are you cloning everyone's repositories and running them today? |
Beta Was this translation helpful? Give feedback.
-
It sounds like you don't need to use the deployment part of aspire because you have already figured it out! It's still great for local development, using components, and service discovery! |
Beta Was this translation helpful? Give feedback.
-
@davidfowl Yes, we clone all the repositories locally and debug service communication having multiple studio instances opened. Its doable, but its a pain. |
Beta Was this translation helpful? Give feedback.
-
@artyom-p What does the pain free solution look like? What would you ideal experience be? |
Beta Was this translation helpful? Give feedback.
-
@davidfowl Let's say we have 2 microservices that need to communicate with each other, they live in their own git repositories. Each microservice can have its own or shared dependencies, for example: There are cases when you want to debug only one service, but you still need another one to be running with all its dependencies, in this case, we can just somehow reference that second service and make it run, I think there was something similar in Tye before if I'm not mistaken. The second case is more complex - when you want to debug both services. I'm not sure if it's doable without referencing projects of ServiceB in ServiceA solution. |
Beta Was this translation helpful? Give feedback.
-
We also have the same multi-repo approach here, and this is where Tye was really strong for local development. A tye.yaml file could be relatively pathed to target x services, all cloned locally. Tye was also useable as a completely external tool, no changes were required to any service, and they could also target a variety of different dotnet versions. Aspire looks so much better in many ways to Tye, and I can see it's trying to achieve different things, but being able to use Tye as a non-invasive external local dev orchestrator remains a huge benefit and time saver for multi-repo scenarios. |
Beta Was this translation helpful? Give feedback.
-
You can do a similar thing with the app host. Clone multiple repositories and create a project file that references individual projects. Maybe we need to enable referencing app hosts themselves 🤔.
Aspire does require .NET 8 and above.
Can you show me your tye setup? |
Beta Was this translation helpful? Give feedback.
-
Many thanks for the reply, really enjoying the Conf this year.
You say that, and of course you're totally correct if you want to use everything in the Aspire stack (and who am I to argue with the mad professors who came up with this amazing stuff), but I have been able to hack something together today from the starter application template using AddExecutable():
In this case, ApiService6 is a dotnet6 api, inside which I've added OpenTelemetry support based on the code in the ServiceDefaults project. You do then end up with traces and (partial) metrics in the Asipre dashboard. So this is potentially useful-ish (I should try this with func.exe as well to see if we can spin up Functions in a decent way while Function support isn't quite ready yet). Service discovery is obvs broken here, and Aspire Components are presumably off the table too. This serves two purposes though - allows some use of older dotnet applications, and also allows targeting of different repos outside of the solution the Aspire AppHost lives in. So it falls back to a similar kind of experience to Tye in these respects.
Sure, we have a lot of tye files, each targeting a specific surface area of our microservices (which are all in individual repos). Redacted example below:
Key thing here is that we haven't made any code changes to any of these services, and they're spread over 4 different repos. |
Beta Was this translation helpful? Give feedback.
-
@artyom-p I've opened dotnet/aspire-samples#35 to track adding some samples of multi-repo orchestration from an AppHost project. |
Beta Was this translation helpful? Give feedback.
-
I hear you, but I think we need to explore something in the realm of the feature set of the app host. The app host is never deployed, it's a local orchestrator only. It can run executables, containers, projects, cloud and reference remote resources (deployed elsewhere). The dashboard is also an OTLP server so telemetry is pushed to it with a single env variable config. With those primitives, it should be possible to build various workflows with these primitives. We're still working through a couple of issues like enabling docker networking and making it easier to reference things within containers (so you can run your another team's container images for e.g.). Hopefully that'll be enough for you all to experiment and come back with feedback about what works and what doesn't work.
I think we're pretty far away from this based on the current set of capabilities. That sad, maybe you could build something on top of these primitives to get the next level of understanding for what this workflow looks like. |
Beta Was this translation helpful? Give feedback.
-
That makes complete sense. Regarding my idea, I don't think it is aligned with the project goals then, but also can be implemented as an extension on top of it. |
Beta Was this translation helpful? Give feedback.
-
Maybe consider other interesting ways to connect services like using an external service discovery system (dapr, consul) and the app host to bridge local and remote development. Maybe you can use a shared configuration server (something like azure app config in the azure case) as a way to store service discovery information across teams. The problem is the code needs to be executed (that means access to another teams' code or assets), or it needs to be running remotely. |
Beta Was this translation helpful? Give feedback.
-
👋 -- Hello! Chiming in late here, but I was thinking: Why not make it possible to make a reference a git repo URL? With something like that, Aspire could clone and then either discover or be explicitly told what type of project is within for it to manage? This would be a game changer, particularly for onboarding scenarios. I've followed a pattern of having a "home" repo that houses a |
Beta Was this translation helpful? Give feedback.
-
@atrauzzi that seems good idea (just don't know about the execution part), but would definitely be helpful since the repos url is "always" there. It seems an approach like Go or Deno do with the "usings/imports". Maybe something like this pseudo code:
What do you think? Crazy stupid idea? |
Beta Was this translation helpful? Give feedback.
-
Because I don't think aspire should manage git repos. Pulling, updating, picking the right branch etc etc. That should be managed externally.
Right, I think it should be possible to have an aspire app host reference source anywhere but it shouldn't be responsible for the cloning and updating of the git repo. |
Beta Was this translation helpful? Give feedback.
-
Yeah, I get what you're saying, it even makes sense. But I guess then it takes away some of that snappy convenience of being able to obtain the Aspire project itself and have things self-assemble. If something like this were to exist, I don't think I'd want to see aspire go as far as branch management. Just clone and then put the developer back in the drivers seat, that's all. |
Beta Was this translation helpful? Give feedback.
-
That feels very incomplete IMO. I'm not sure we would want to ship a feature like that. I'm sure it could be built on top of our existing primitives, so if that's something interesting, somebody should build that and put up a nuget package. |
Beta Was this translation helpful? Give feedback.
-
Oh! So that is to say, there's support for different source types to be added? And I guess then the rest of Aspire would (hopefully) pick up, assuming all went well? |
Beta Was this translation helpful? Give feedback.
-
The hosting primitives for |
Beta Was this translation helpful? Give feedback.
-
Love it. Something like Although I agree it has an out-of-scopey flavour, I could see it being a very popular feature or extension. We'll see 🙂 |
Beta Was this translation helpful? Give feedback.
-
Hey, I've been working on a project that I think may be useful for some here. Please feel free to send feedback and let me know what you think. |
Beta Was this translation helpful? Give feedback.
-
So... after a few months, no further progress on multi-repo support? Is it already implemented? |
Beta Was this translation helpful? Give feedback.
-
Not directly a multi-repo problem, but I have multiple solutions in the same repo. To reference an "external" project in the repo, I tried to use: |
Beta Was this translation helpful? Give feedback.
-
Hello, Currently, our team uses a microservice architecture where each microservice resides in its own repository and is maintained by a dedicated team. We also use Docker Compose for each microservice to manage running the API, database, Redis, RabbitMQ, etc. Most of the time, each team deals only with their own microservice, but occasionally, they run all the microservices locally for end-to-end testing. To facilitate this, we have created another Docker Compose file that runs all the microservices along with their dependencies. Now, my question is: if we decide to go with Aspire, the use case where we want to run all the microservices locally works fine using one Uber AppHost solution and sharing ServiceDefaults as a NuGet package. But how would you suggest we run individual microservices (that currently use Docker Compose)? Besides the Uber AppHost, should we also have an AppHost per microservice that stays in the same repository as the microservice? Or is there another solution anyone would suggest? Thanks. |
Beta Was this translation helpful? Give feedback.
-
In several companies that use microservices have their own cloud platform teams and normally this "translates" into having a service per git repos.
In this cases how to use .NET Aspire? Meaning, different projects from different repos? It's not common to have multiple services within the same repo (unless you have a monorepo like Google 😆)
What is your suggestion?
Beta Was this translation helpful? Give feedback.
All reactions