Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sample/AppHost/AppHost.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<Sdk Name="Aspire.AppHost.Sdk" Version="9.0.0" />
<Sdk Name="Aspire.AppHost.Sdk" Version="9.4.0" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
Expand Down
11 changes: 11 additions & 0 deletions sample/AppHost/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,21 @@
.WithDynamicConfigValue("frontend.enableUpdateWorkflowExecution", true)
);

var temporalWithPorts = await builder.AddTemporalServerContainer("temporalWithPorts", x => x
.WithPort(12345)
.WithUiPort(23456)
.WithLogFormat(LogFormat.Json)
.WithLogLevel(LogLevel.Info)
.WithNamespace("test1", "test2")
.WithDynamicConfigValue("frontend.enableUpdateWorkflowExecution", true)
);

builder.AddProject<Projects.Api>("api")
.WithReference(temporal);

builder.AddProject<Projects.Worker>("worker")
.WithReference(temporal);



builder.Build().Run();
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
{
return builder.AddTemporalServerContainer(name, new TemporalServerResourceArguments());
}
private static async Task<IResourceBuilder<TemporalServerContainerResource>> AddTemporalServerContainer(this IDistributedApplicationBuilder builder, string name, TemporalServerResourceArguments args)

Check warning on line 35 in src/InfinityFlow.Aspire.Temporal/TemporalServerContainerBuilderExtensions.cs

View workflow job for this annotation

GitHub Actions / build

This async method lacks 'await' operators and will run synchronously. Consider using the 'await' operator to await non-blocking API calls, or 'await Task.Run(...)' to do CPU-bound work on a background thread.
{
var container = new TemporalServerContainerResource(name, args);

Expand All @@ -40,21 +40,21 @@
.WithAnnotation(new ContainerImageAnnotation() { Image = "temporalio/admin-tools", Tag = "latest" })
.WithArgs(args.GetArgs())
.WithEntrypoint("temporal")
.WithHttpsEndpoint(name: "server", port: args.Port, targetPort: 7233).AsHttp2Service(); // Internal port is always 7233
.WithHttpsEndpoint(name: "server", port: args.Port, targetPort: args.Port).AsHttp2Service(); // Internal port is always 7233

if (args.Headless is not true)
{
resourceBuilder.WithHttpEndpoint(name: "ui", port: args.UiPort, targetPort: 8233); // Internal port is always 8233
resourceBuilder.WithHttpEndpoint(name: "ui", port: args.UiPort, targetPort: args.UiPort); // Internal port is always 8233
}

if (args.MetricsPort is not null)
{
resourceBuilder.WithHttpEndpoint(name: "metrics", port: args.MetricsPort, targetPort: 7235); // Internal port is always 7235
resourceBuilder.WithHttpEndpoint(name: "metrics", port: args.MetricsPort, targetPort: args.MetricsPort); // Internal port is always 7235
}

if (args.HttpPort is not null)
{
resourceBuilder.WithHttpEndpoint(name: "http", port: args.HttpPort, targetPort: 7234); // Internal port is always 7234
resourceBuilder.WithHttpEndpoint(name: "http", port: args.HttpPort, targetPort: args.HttpPort); // Internal port is always 7234
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Temporal Port Mapping Issue

The targetPort for Temporal server endpoints was incorrectly changed from fixed internal container ports (e.g., 7233, 8233) to user-configured external ports. Temporal services always listen on these fixed internal ports, as noted in the comments. This breaks port mapping and causes connection failures.

Fix in Cursor Fix in Web

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Incorrect Port Mapping for Temporal Server

The targetPort for Temporal server endpoints is incorrectly set to external args.Port values instead of the fixed internal container ports (e.g., 7233 for server). This breaks container port mapping, preventing connections, and contradicts the inline comments that state these internal ports are always fixed.

Fix in Cursor Fix in Web

}

return resourceBuilder;
Expand Down
Loading