diff --git a/core/pom.xml b/core/pom.xml index 8eebd214..7cfb47a7 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -19,7 +19,7 @@ dev.streamx.cli.StreamxCommand - ghcr.io/streamx-dev/streamx-dashboard/streamx-local-dashboard:0.0.7-patch002-jvm + ghcr.io/streamx-dev/streamx-dashboard/streamx-local-dashboard:0.0.8-jvm diff --git a/core/src/main/java/dev/streamx/cli/command/dev/DashboardRunner.java b/core/src/main/java/dev/streamx/cli/command/dev/DashboardRunner.java index 2bd683e5..33ef5533 100644 --- a/core/src/main/java/dev/streamx/cli/command/dev/DashboardRunner.java +++ b/core/src/main/java/dev/streamx/cli/command/dev/DashboardRunner.java @@ -8,6 +8,8 @@ import jakarta.enterprise.event.Event; import jakarta.inject.Inject; import java.time.Duration; +import org.testcontainers.containers.Network; +import org.testcontainers.containers.wait.strategy.Wait; @ApplicationScoped public class DashboardRunner { @@ -25,14 +27,15 @@ public class DashboardRunner { private DashboardContainer dashboardContainer; public void startStreamxDashboard(String meshPath, String meshDirectory, - String projectDirectory) { + String projectDirectory, Network network) { dashboardContainer = new DashboardContainer( StreamxMavenPropertiesUtils.getDashboardImage(), devConfig.dashboardPort(), meshPath, meshDirectory, projectDirectory - ).withStartupTimeout(Duration.ofSeconds(CONTAINER_TIMEOUT_IN_SECS)); + ).withStartupTimeout(Duration.ofSeconds(CONTAINER_TIMEOUT_IN_SECS)) + .withNetwork(network); dashboardContainer.start(); print("StreamX Dashboard started on http://localhost:" + devConfig.dashboardPort()); diff --git a/core/src/main/java/dev/streamx/cli/command/dev/DevCommand.java b/core/src/main/java/dev/streamx/cli/command/dev/DevCommand.java index 64bfe63e..0a0e8b69 100644 --- a/core/src/main/java/dev/streamx/cli/command/dev/DevCommand.java +++ b/core/src/main/java/dev/streamx/cli/command/dev/DevCommand.java @@ -87,6 +87,7 @@ public void run() { Files.createFile(meshPath); } + this.runner.initializeBase(); startDashboard(meshPath); meshManager.initializeDevMode(meshPath, spec.commandLine()); @@ -125,7 +126,10 @@ private void startDashboard(Path meshPath) { logger.infov("Resolved mesh {0}, mesh directory {1} and project directory {2}", meshPathAsString, meshDirectoryAsString, projectDirectoryAsString); - dashboardRunner.startStreamxDashboard(meshPathAsString, meshDirectoryAsString, - projectDirectoryAsString); + dashboardRunner.startStreamxDashboard( + meshPathAsString, + meshDirectoryAsString, + projectDirectoryAsString, + runner.getContext().getNetwork()); } } diff --git a/core/src/main/java/dev/streamx/cli/command/meshprocessing/MeshManager.java b/core/src/main/java/dev/streamx/cli/command/meshprocessing/MeshManager.java index 135ac7fe..56ec249e 100644 --- a/core/src/main/java/dev/streamx/cli/command/meshprocessing/MeshManager.java +++ b/core/src/main/java/dev/streamx/cli/command/meshprocessing/MeshManager.java @@ -77,7 +77,6 @@ public void initializeDevMode(Path meshPath, CommandLine commandLine) { print("\nSetting up system containers..."); - this.runner.initializeBase(); this.runner.startBase(); }