Reuben Bond ebed669231 Initial cross-language protocol for agents (#139)
* Initial prototype of .NET gRPC worker client + service

---------

Co-authored-by: Jack Gerrits <jack@jackgerrits.com>
2024-06-28 08:03:42 -07:00

22 lines
769 B
C#

var builder = DistributedApplication.CreateBuilder(args);
builder.AddAzureProvisioning();
var orleans = builder.AddOrleans("orleans")
.WithDevelopmentClustering()
.WithMemoryReminders()
.WithMemoryGrainStorage("agent-state");
var agentHost = builder.AddProject<Projects.Greeter_AgentHost>("agenthost")
.WithReference(orleans);
builder.AddProject<Projects.Greeter_AgentWorker>("csharp-worker")
.WithExternalHttpEndpoints()
.WithReference(agentHost);
var ep = agentHost.GetEndpoint("http");
builder.AddExecutable("python-worker", "hatch", "../../../../python/", "run", "python", "worker_example.py")
.WithEnvironment("AGENT_HOST", $"{ep.Property(EndpointProperty.Host)}:{ep.Property(EndpointProperty.Port)}");
builder.Build().Run();