From a424aa5e81c31f8cc6ba8846f0a6af29623588d4 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 3 Aug 2022 11:11:58 +0200 Subject: refactor(web/runner): Support pluggable job manager This change introduces a new interface `JobManager` that is responsible for communicating with the backend about the available jobs and updating their status when the runner is simulating a job. This manager can be injected into the `OpenDCRunner` class and allows users to provide different sources for the jobs, not only the current REST API. --- .../java/org/opendc/web/runner/runtime/OpenDCRunnerRecorder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc') diff --git a/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRecorder.java b/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRecorder.java index c1f356bc..eccc8dcf 100644 --- a/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRecorder.java +++ b/opendc-web/opendc-web-runner-quarkus/src/main/java/org/opendc/web/runner/runtime/OpenDCRunnerRecorder.java @@ -27,6 +27,7 @@ import io.quarkus.runtime.ShutdownContext; import io.quarkus.runtime.annotations.Recorder; import org.jboss.logging.Logger; import org.opendc.web.client.runner.OpenDCRunnerClient; +import org.opendc.web.runner.JobManager; import org.opendc.web.runner.OpenDCRunner; import java.io.File; @@ -54,7 +55,7 @@ public class OpenDCRunnerRecorder { OpenDCRunnerClient client = new OpenDCRunnerClient(apiUrl, null); OpenDCRunner runner = new OpenDCRunner( - client, + JobManager.create(client), new File(config.tracePath), parallelism, config.jobTimeout, @@ -77,7 +78,7 @@ public class OpenDCRunnerRecorder { Thread thread = new Thread(() -> { try { // Wait for some time to allow Vert.x to bind to the local port - Thread.sleep(1000); + Thread.sleep(4000); } catch (InterruptedException e) { throw new RuntimeException(e); } -- cgit v1.2.3