Skip to content

Commit dfc598f

Browse files
committed
Init
1 parent a84c867 commit dfc598f

File tree

3 files changed

+115
-157
lines changed

3 files changed

+115
-157
lines changed

LocalTesting/LocalTesting.FlinkSqlAppHost/Program.cs

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -362,20 +362,7 @@
362362

363363
sqlGateway = sqlGateway.WithArgs("/opt/flink/bin/sql-gateway.sh", "start-foreground");
364364

365-
// Flink.JobGateway - Add Flink Job Gateway as .NET project
366-
// CRITICAL: Using .AddProject() for proper Aspire service discovery and endpoint management
367-
// JobGateway runs as a host process (not containerized) for reliable endpoint discovery
368-
// Note: ASPNETCORE_URLS set for LocalTesting mode compatibility; removed for LearningCourse mode
369-
#pragma warning disable S1481 // Gateway resource is created but not directly referenced - used via Aspire orchestration
370-
IResourceBuilder<ProjectResource> gateway = builder.AddProject<Projects.FlinkDotNet_JobGateway>("flink-job-gateway")
371-
.WithHttpEndpoint(port: 8086, name: "gateway-http");
372-
373-
// In LocalTesting mode, explicitly set ASPNETCORE_URLS to ensure proper binding
374-
// In LearningCourse mode, Aspire's service discovery manages port binding automatically
375-
if (!isLearningCourse)
376-
{
377-
gateway = gateway.WithEnvironment("ASPNETCORE_URLS", "http://localhost:8086");
378-
}
365+
IResourceBuilder<ProjectResource> gateway = builder.AddProject<Projects.FlinkDotNet_JobGateway>("flink-job-gateway");
379366

380367
gateway = gateway
381368
.WithEnvironment("FLINK_CONNECTOR_PATH", connectorsDir)
@@ -385,7 +372,6 @@
385372
.WithEnvironment("Flink__SqlGateway__BaseUrl", sqlGateway.GetEndpoint("sg-http"))
386373
.WaitFor(jobManager)
387374
.WaitFor(sqlGateway);
388-
#pragma warning restore S1481
389375

390376
// Temporal PostgreSQL - Database for Temporal server
391377
// CRITICAL: Must configure PostgreSQL WITHOUT password for Temporal auto-setup compatibility
@@ -428,11 +414,10 @@
428414
// Provides state management, caching, and distributed coordination capabilities
429415
// CRITICAL: Use Bitnami Redis image with ALLOW_EMPTY_PASSWORD for learning exercises
430416
// This allows exercises to connect with simple "localhost:port" format without authentication
431-
#pragma warning disable S1481 // Redis resource is created but not directly referenced - used via connection string
432-
IResourceBuilder<ContainerResource> redis = builder.AddContainer("redis", "bitnami/redis", LatestTag)
433-
.WithHttpEndpoint(targetPort: Ports.RedisHostPort, name: "redis-port")
434-
.WithEnvironment("ALLOW_EMPTY_PASSWORD", "yes"); // Disable password requirement for learning
435-
#pragma warning restore S1481
417+
418+
builder.AddContainer("redis", "bitnami/redis", LatestTag)
419+
.WithHttpEndpoint(targetPort: Ports.RedisHostPort, name: "redis-port")
420+
.WithEnvironment("ALLOW_EMPTY_PASSWORD", "yes"); // Disable password requirement for learning
436421

437422
Console.WriteLine("Redis deployed with Aspire-managed host port for LearningCourse exercises");
438423

@@ -500,16 +485,10 @@
500485
Console.WriteLine(" [INFO] Kafka metrics dashboard mounted for Grafana");
501486
}
502487

503-
#pragma warning disable S1481 // Grafana resource is created but not directly referenced - accessed via browser
504-
IResourceBuilder<ContainerResource> grafana = grafanaBuilder;
505-
#pragma warning restore S1481
506-
507488
Console.WriteLine("Grafana deployed with Aspire-managed host port for visualization");
508489
}
509490

510-
#pragma warning disable S6966 // Await RunAsync instead - Required for Aspire testing framework compatibility
511491
builder.Build().Run();
512-
#pragma warning restore S6966
513492

514493
static bool ConfigureContainerRuntime()
515494
{

0 commit comments

Comments
 (0)