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. --- .../opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'opendc-web/opendc-web-runner/src/cli') diff --git a/opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt b/opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt index 348a838c..4cfbdd7c 100644 --- a/opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt +++ b/opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt @@ -114,7 +114,8 @@ class RunnerCli : CliktCommand(name = "opendc-runner") { logger.info { "Starting OpenDC web runner" } val client = OpenDCRunnerClient(baseUrl = apiUrl, OpenIdAuthController(authDomain, authClientId, authClientSecret, authAudience)) - val runner = OpenDCRunner(client, tracePath, parallelism = parallelism) + val manager = JobManager(client) + val runner = OpenDCRunner(manager, tracePath, parallelism = parallelism) logger.info { "Watching for queued scenarios" } runner.run() -- cgit v1.2.3