Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 03:57
    zyqCSL starred dotnet/orleans
  • 02:20
    oising commented #7108
  • 02:17
    oising commented #7076
  • 02:17
    oising commented #7076
  • 01:48
    oising opened #7108
  • Jun 12 11:47
    MohammadAbulwafa starred dotnet/orleans
  • Jun 12 09:47
    wangjia184 edited #7105
  • Jun 12 09:46
    wangjia184 edited #7105
  • Jun 12 09:41
    wangjia184 edited #7105
  • Jun 12 09:41
    wangjia184 edited #7105
  • Jun 12 09:38
    wangjia184 edited #7105
  • Jun 12 07:56
    wangjia184 opened #7105
  • Jun 11 18:28
    ReubenBond commented #7103
  • Jun 11 17:15
    buzzers commented #7103
  • Jun 11 02:44
    guanhh starred dotnet/orleans
  • Jun 10 21:54
    JKetelaar starred dotnet/orleans
  • Jun 10 15:27
    PiotrJustyna commented #7104
  • Jun 10 15:24
    PiotrJustyna opened #7104
  • Jun 10 08:39
  • Jun 10 08:39
    rainbow-lpf starred dotnet/orleans
Reuben Bond
@ReubenBond
It might be worthwhile to start by using that sample I linked and customizing it to your needs - it has a Web frontend behind a load balancer
Otherwise, it should provide a good reference. The most important parts are probably the yaml file and the Program.cs
maman
@d-m4m4n
Yea, I basically took everything from that repo except the frontend and replaced the controller logic with a really simple helloworld grain to test. Since I wont be needing a frontend I excluded that. But i will look it over and see if I missed anything
Thats to say, when I ran all the steps in the readme, I got no errors and still able to run locally. I just wanted to try and hit the endpoint once it was deployed onto AKS
Stuart Blackler
@Im5tu
Hey all - do we know what would prevent IPersistentState from being registered in DI? I have a feeling it's something to do with the code gen, but <OrleansCodeGenLogLevel>Trace</OrleansCodeGenLogLevel> seems to show that the generation was successful. I'm getting Unable to resolve serv ice for type Orleans.Runtime.IPersistentState but I've not changed anything in my DI or service startup. I made 1 contract change to the grain, but after commenting out that change - the error still persists
Using Microsoft.Orleans.OrleansCodeGenerator.Build version 3.4.3 on netcoreapp3.1
Reuben Bond
@ReubenBond
@Im5tu it shouldn't be related to codegen (though you should move to Microsoft.Orleans.CodeGenerator.MSBuild instead of that package, if you can. It's newer). IPersistentState<T> is created using a factory by the IGrainActivator implementation (implemented by DefaultGrainActivator). It's done this way because each IPersistentState<T> instance injected into the constructor uses an attribute to specify which state provider and state name it uses (similar to bindings in Az Functions)
What are you trying to accomplish by injecting it?
Stuart Blackler
@Im5tu
We are basically doing the same that is shown here: https://dotnet.github.io/orleans/docs/grains/grain_persistence/index.html where the ctor of the grain takes IPersistentState, but MSDI is falling over because it's not registered in the service collection
The only difference is instead of [PersistentState("profile", "profileStore")] it's [PersistentState("profile")]
Stuart Blackler
@Im5tu
Wondering whether it's a non-issue and it's just because the scope validation is turned on for the service collection
Reuben Bond
@ReubenBond
Is Orleans constructing the grain or is it being constructed manually?
It might be worth opening an issue with more detail on your setup. Is the grain class itself being injected into something, perhaps?
Stuart Blackler
@Im5tu
We don't construct it manually - but I did notice that it's registered in DI when I checked to see if we were manually creating it (not a project I usually work on)
Removing that DI registration appears to make everything work - so assume it's not needed?
Mario Adam
@i-dentify
Given an orleans environment with eventstore as persistent storage and mongodb for read model purpose. MongoDb should be populated through a subscription to eventstore. What would be an optimal strategy where to put the subscription client? Separate hosted service in .Net Core App or Grain Service (as this one obviously behaves the same way as a hosted background service?)
Reuben Bond
@ReubenBond
I would probably use an IHostedService/BackgroundService in the same host as Orleans, @i-dentify
Daniel Doglas
@danieldoglas

Hey guys.

For some reason I can't deploy my cluster in k8s. I've configured my application in Program.cs like this:

image.png
I've also configured the role and role binding in the k8s
image.png
image.png
Even though I did those, I'm still receiving a Forbidden error on the pod init on this method: k8s.Kubernetes.ListNamespacedCustomObjectWithHttpMessagesAsync. Did anyone have issues like this?
Reuben Bond
@ReubenBond
I'm not sure, @danieldoglas. Maybe @galvesribeiro knows.
Gutemberg Ribeiro
@galvesribeiro
Hey
I think you are mixing Kubernetes libraries here
image.png
that is all you need if you are going to use Orleans.Clustering.Kubernetes
Also you need to have the role/role binding for the service account running on your pod which is where your silo is. Check https://github.com/OrleansContrib/Orleans.Clustering.Kubernetes#security-considerations
maman
@d-m4m4n
Hey guys, I was wondering if there's a pattern or paradigm to query across grains or get all grains of a certain type? I see there is an indexer method but wondering if there's something that could be used to search through grains that contain certain state attributes
maman
@d-m4m4n
This is the library im referring to. Seems a little overkill but not sure if its the only option https://github.com/OrleansContrib/Orleans.Indexing
Since that's not production ready, I guess im curious how you find all grains lets say of Game Sessions and Aggregate statistics or filter by score etc.
Daniel Doglas
@danieldoglas

Hey @galvesribeiro

I thought I needed to use both libraries. I did the changes you suggested and tried to deploy again, now only using the UseKubeMembership(). I also followed some of the sample files in the repository. For now, since this is a PoC, my client and silo are both running together, that's why we have all the permissions there.

I'm still receiving this:

Unable to initialize cluster version: Operation returned an invalid status code 'Forbidden'.
Microsoft.Rest.HttpOperationException: Operation returned an invalid status code 'Forbidden'
at k8s.Kubernetes.GetNamespacedCustomObjectWithHttpMessagesAsync(String group, String version, String namespaceParameter, String plural, String name, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at k8s.KubernetesExtensions.GetNamespacedCustomObjectAsync(IKubernetes operations, String group, String version, String namespaceParameter, String plural, String name, CancellationToken cancellationToken)
at Orleans.Clustering.Kubernetes.KubeMembershipTable.TryInitClusterVersion()

Gutemberg Ribeiro
@galvesribeiro
You need to make sure the roles and role bindings are mapped to the correct namespace and Verbs. Also make sure that your Pod definition is using the Service Account that is binded to those roles.
This message is the KubernetesClient inside the provider trying to get the CRDs under the namespace the silo Pods are running, and the Kubernetes API is denying access probably because of the wrong roles and bindings or the service account.
Daniel Doglas
@danieldoglas

Ok. The role binding is attaching to the default ServiceAccount, and all the namespaces both in the rolebinding and pods are the same.

I'll try to debug it a little bit more and see if I can understand where is the issue. Thank you!

Gutemberg Ribeiro
@galvesribeiro
I never did that with the default service account… I always had a specific one… I’m not sure if it is allowed to use the default one for bindings… From what I know, the token used to access the kubernetes API is explicit when using the service account based on the credentials that are mounted on the pod
Alex McCool
@amccool
image.png
loving the OpenTelemetry PR @ReubenBond #6853
Rik
@rikbosch
Hi there, is anyone else experiencing slow builds due to the code generator adding 40K lines of known types?
is there any way to filter the assemblies to scan?
Rik
@rikbosch
it looks like #5021
Reuben Bond
@ReubenBond
It's an unfortunate result of the way types are encoded. We could potentially go back to scanning assemblies on startup for that info, @rikbosch
(for 3.x, 4.x avoids the need for it)
Sam Ember
@SamEmber
Hi Guys, looking for some journaled grain advice, previously I have used EventStore subscriptions to provide events to update a projection and dispatch that projection to a queue for example. Is there a recommended approach for Orleans in this regard? Possibly notifications?
3 replies
wusi2cool
@wusi2cool
Hey All,
I get this error any when I put my grain in a different dll
Cannot find an implementation class for grain interface: SpaceCadet.Health.IHealthGrain. Make sure the grain assembly was correctly deployed and loaded in the silo.
in my webapi startup I have
siloBuilder.ConfigureApplicationParts(parts => parts.AddApplicationPart(typeof(IHealthGrain).Assembly).WithReferences());
I am co hosting the grain in my web api project.
Everything works fine if I put the grain and grain interface in my webapi project.
2 replies
maman
@d-m4m4n

This is the library im referring to. Seems a little overkill but not sure if its the only option https://github.com/OrleansContrib/Orleans.Indexing

anyone have some suggestions here?

Sam Ember
@SamEmber
Any recommended int to GUID conversion for streams?