diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-07-30 12:37:13 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-08-03 11:33:45 +0200 |
| commit | 16439ea8db70fe7d531fde30914291a9707f32f0 (patch) | |
| tree | 4f46fb0ec26dd9fd0ce50fe9f22cc0e07787fd83 /opendc-web/opendc-web-runner-quarkus-deployment | |
| parent | a424aa5e81c31f8cc6ba8846f0a6af29623588d4 (diff) | |
feat(web/runner): Avoid REST layer if possible
This change updates the Quarkus extension for the OpenDC runner to avoid
the REST layer if possible, by providing an implementation of `JobManager`
that directly communicates with the `JobService`. This means the runner
does not have to traverse the authentication layer.
Diffstat (limited to 'opendc-web/opendc-web-runner-quarkus-deployment')
2 files changed, 11 insertions, 0 deletions
diff --git a/opendc-web/opendc-web-runner-quarkus-deployment/build.gradle.kts b/opendc-web/opendc-web-runner-quarkus-deployment/build.gradle.kts index d31c4839..b3f1ec3b 100644 --- a/opendc-web/opendc-web-runner-quarkus-deployment/build.gradle.kts +++ b/opendc-web/opendc-web-runner-quarkus-deployment/build.gradle.kts @@ -33,4 +33,5 @@ dependencies { implementation(platform(libs.quarkus.bom)) implementation(libs.quarkus.core.deployment) + implementation(libs.quarkus.arc.deployment) } diff --git a/opendc-web/opendc-web-runner-quarkus-deployment/src/main/java/org/opendc/web/runner/deployment/OpenDCRunnerProcessor.java b/opendc-web/opendc-web-runner-quarkus-deployment/src/main/java/org/opendc/web/runner/deployment/OpenDCRunnerProcessor.java index 1d01aabc..94921454 100644 --- a/opendc-web/opendc-web-runner-quarkus-deployment/src/main/java/org/opendc/web/runner/deployment/OpenDCRunnerProcessor.java +++ b/opendc-web/opendc-web-runner-quarkus-deployment/src/main/java/org/opendc/web/runner/deployment/OpenDCRunnerProcessor.java @@ -22,6 +22,7 @@ package org.opendc.web.runner.deployment; +import io.quarkus.arc.deployment.UnremovableBeanBuildItem; import io.quarkus.deployment.annotations.BuildProducer; import io.quarkus.deployment.annotations.BuildStep; import io.quarkus.deployment.annotations.Record; @@ -30,6 +31,7 @@ import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem; import io.quarkus.deployment.util.ServiceUtil; import io.quarkus.runtime.RuntimeValue; import org.opendc.trace.spi.TraceFormat; +import org.opendc.web.runner.JobManager; import org.opendc.web.runner.OpenDCRunner; import org.opendc.web.runner.runtime.OpenDCRunnerRecorder; import org.opendc.web.runner.runtime.OpenDCRunnerRuntimeConfig; @@ -72,6 +74,14 @@ public class OpenDCRunnerProcessor { } /** + * Mark {@link JobManager} as unremoveable, since we look up this service dynamically in {@link OpenDCRunnerRecorder}. + */ + @BuildStep + UnremovableBeanBuildItem unremovableBeans() { + return UnremovableBeanBuildItem.beanTypes(JobManager.class); + } + + /** * Build step to create the runner service. */ @BuildStep(onlyIf = IsIncluded.class) |
