summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-runner/src/cli
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-08-03 11:11:58 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-08-03 11:33:44 +0200
commita424aa5e81c31f8cc6ba8846f0a6af29623588d4 (patch)
tree18006e7c5b3c9c2ff4faa9a988a29a8a6c0499c3 /opendc-web/opendc-web-runner/src/cli
parentf6932d264db5b2e185ec7ea7aaec84dfb83f8fe9 (diff)
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.
Diffstat (limited to 'opendc-web/opendc-web-runner/src/cli')
-rw-r--r--opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt3
1 files changed, 2 insertions, 1 deletions
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()