-
Notifications
You must be signed in to change notification settings - Fork 458
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
Question: MS Orleans support? #724
Comments
Hi @VincentH-Net! We've discussed this and we agree that Orleans is a natural fit here. I think we could have two main pieces:
@benjaminpetit is looking into this. Your input is greatly appreciated. |
Hi @VincentH-Net , Quickly discussed with @ReubenBond, and I think for storage we should provision three different storage instances:
For local dev we could start an azurite docker instance. Or even maybe target some real storage if they are available? |
Thanks @ReubenBond, that sounds promising! I'll follow up with @benjaminpetit - he already mailed me. |
@benjaminpetit Why 3? |
If I am not mistaken, it doesn't cost more, but you benefit isolation from each other:
Plus, we could do premium blob storage for grain storage, cosmosdb for reminders, and simple table storage for clustering for example. |
@benjaminpetit quick questions:
|
Blobs are a good default, especially because they don't have the 1MB limit which table rows do and they have lower overhead (no splitting / joining columns, less encoding), plus there are more price/performance/durability options for blob storage than with tables. The two most appropriate options for grain storage in Azure are Blobs & Cosmos DB, in my opinion. |
i'd also love orleans support, we do in memory clustering when running locally but also do reminders in the local postgres database, (and dont use grain persistence at all) so being able to configure them individually would be great, even if there is also a kitchen-and-sink option that configures everything |
@aL3891 understood. I imagine we will offer a set of default choices as well as a way to configure providers in a more finer-grained manner. |
Small update, here's the branch for @benjaminpetit's WIP: https://github.com/dotnet/aspire/tree/rebond/bpetit/orleans-hosting Here's a usage example showing adding Azure Table Storage for clustering and Azure Blob Storage as the "default" grain state store: var builder = DistributedApplication.CreateBuilder(args);
builder.AddAzureProvisioning();
var storage = builder.AddAzureStorage("storage");
var clusteringTable = storage.AddTables("clustering");
var grainStorage = storage.AddBlobs("grainstate");
var orleans = builder.AddOrleans("my-app")
.WithClustering(clusteringTable)
.WithGrainStorage("default", grainStorage);
builder.AddProject<Projects.OrleansServer>("silo")
.WithOrleansServer(orleans)
.WithReplicas(3);
using var app = builder.Build();
await app.RunAsync(); The pertinent line in the corresponding Orleans server project is
|
@ReubenBond I succeeded in getting The only change I had to make was in However, I also had to assign the managed identity of the azure VM I was developing on the Without those roles,
-> Perhaps good to add some guidance (readme in the sample source?) on this to help devs getting things working quickly? |
@ReubenBond What I would love to see:
Overall Aspire with Orleans feels like a really attractive combination for the C# developer👍 |
this is a bug in preview1, fixed in preview2 |
@ReubenBond I noticed something 'off' in The Orleans branch adds below overload, which adds the public static void AddKeyedAzureTableService(
this IHostApplicationBuilder builder,
string connectionName,
string name,
Action<AzureDataTablesSettings>? configureSettings = null,
Action<IAzureClientBuilder<TableServiceClient, TableClientOptions>>? configureClientBuilder = null) However, this overload is not referenced. The code in builder.AddKeyedAzureTableService(connectionName); Which matches to the existing overload: public static void AddKeyedAzureTableService(
this IHostApplicationBuilder builder,
string name,
Action<AzureDataTablesSettings>? configureSettings = null,
Action<IAzureClientBuilder<TableServiceClient, TableClientOptions>>? configureClientBuilder = null) So the passed in |
(how / when) can I use Orleans with public NuGet Aspire bits? If not possible today, any ETA? Thanks! I'm trying to get Aspire for Orleans co-hosted with a minimal web API to work. Approach 1I tried to use the new I got it all building without warnings, however when I do ERROR: generating bicep from manifest: unsupported resource type: azure.storage.table.v0 Updating azd to latest daily build (1.6.0 beta) like this issue comment suggests gives the same error. Approach 2I then tried to upgrade the Orleans example in the Aspire repo to add a WEB API with Rest and SignalR. However, when I try ERROR: generating bicep from manifest: Is deploying Orleans to ACA supported at this point? |
I would like to see the addition of LogConsistencyStorage/JournaledGrain providers too. In the hosting project, clustering and grain storage resources are tightly coupled to Azure resources. Are there any plans to modify this? What if I want to use CosmosDB or some custom storage provider? Currently, I get around this by adding the projects directly to my solution and modify it to accommodate my defaults. |
I would put that comment on the azd issue. |
|
Aspire support for Orleans is now added (requires Orleans nightly feed packages for now), including an example - I tested it, defects were fixed and all works well. Thanks for this @benjaminpetit @ReubenBond and all who chimed in! |
Is that sample deployable to azure using azd? |
@davidfowl Yes, if you replace the Aspire project references in the sample with the corresponding NuGet package references, and you comment out this line in the example source as indicated in the comment above that line. Note that if you try to deploy the Orleans playground to ACA without above modifications, AZD does not detect Aspire and fails like below: Btw none of the other playgrounds are deployable to ACA as-is atm (they fail with different errors though). |
@mitchdenny I think we need to exclude the manifest dashboard project from the manifest automagically as well so this just works. aspire/playground/orleans/OrleansAppHost/Program.cs Lines 5 to 12 in 104cbd4
You should be able to remove this branch. AzureProvisioning only applies when there's no publisher and UseEmulator isn't effective when publishing the manifest. |
@davidfowl As an Orleans developer I never use the emulator. As a dev I code against the Orleans abstraction, and Orleans has providers for azure and in-memory. Locally I am not testing the Orleans providers, just my app code. So it makes more sense to me to use the most lightweight Orleans providers for the local dev loop. The reason I am bringing this up is that in the common case, an Orleans dev does need to distinguish between local run and azure deployment. For me the most representative example would read like below. Imo this would be more representative of what most Orleans - Aspire devs will want: var builder = DistributedApplication.CreateBuilder(args);
var orleans = builder.AddOrleans("my-app");
if (!args.Contains("--publisher")) // Local run; see https://github.com/dotnet/aspire/issues/1823
{
orleans = orleans
.WithDevelopmentClustering()
.WithMemoryGrainStorage("Default");
}
else // Azure deployment
{
var storage = builder.AddAzureStorage("storage");
var clusteringTable = storage.AddTables("clustering");
var grainStorage = storage.AddBlobs("grainstate");
orleans = orleans
.WithClustering(clusteringTable)
.WithGrainStorage("Default", grainStorage);
}
builder.AddProject<Projects.OrleansServer>("silo")
.WithReference(orleans);
using var app = builder.Build();
await app.RunAsync(); |
This is something we are going to add support for. In this particular sample it's unnecessary. |
True. My concern is guidance for devs today, until the new API is there. I agree it makes sense to either remove the branch in the current example or modify the example to something like above. Since the current way to do it is a bit of an ugly wart, I can understand wanting to avoid that in the example ;-) If we keep the example as-is (minus the branch) I will point devs to #1823 which shows the current workaround and allows to track the new API |
@davidfowl I created a PR for the Orleans playground to address your comments: |
Is there any Aspire support/guidance planned for Microsoft Orleans?
If not, any advice / pointers on how to integrate it?
Example scenario
E.g. a scenario that I will be implementing in the coming months is running Orleans in Azure Container Apps (auto-scale) with both REST endpoints (minimal API's) and SignalR endpoints (BFF for WASM browser and native mobile clients, built in C# with Uno Platform)
I'm looking for ways to make end2end observability easier to achieve and maintain:
Rest API -> Orleans grains / streams chain <-> SignalR <-> client
And I'm wondering if Aspire could help with that.
Any insights appreciated! (@ReubenBond ?)
The text was updated successfully, but these errors were encountered: