summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-runner/build.gradle.kts
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-05-18 18:17:03 +0200
committerGitHub <noreply@github.com>2022-05-18 18:17:03 +0200
commit61b6550d7a476ab1aae45a5b9385dfd6ca4f6b6f (patch)
tree8632e8e26e409b6909a0bd90488356b1dcd70ba6 /opendc-web/opendc-web-runner/build.gradle.kts
parent00b5ee4bd423d8d9682a9ed9cd2af7c19a715459 (diff)
parentfb88cf197d9fe814e9692e7dafdc0d31b940acbc (diff)
merge: Add embedded experiment runner for dev mode (#87)
This pull request adds a new Quarkus extension that starts an embedded experiment runner while the user is in development mode. This allows users to deploy the entire OpenDC stack by using the `quarkusDev` command. By default, the experiment runner will only run experiments on one thread. Though, this setting is configurable. ## Implementation Notes :hammer_and_pick: * Use correct group for Gradle modules * Support client construction without AuthController * Move runner CLI into separate configuration * Remove module nesting in Quarkus extension * Add Quarkus extension for OpenDC runner * Add initial server distribution ## Breaking API Changes :warning: * N/A
Diffstat (limited to 'opendc-web/opendc-web-runner/build.gradle.kts')
-rw-r--r--opendc-web/opendc-web-runner/build.gradle.kts64
1 files changed, 52 insertions, 12 deletions
diff --git a/opendc-web/opendc-web-runner/build.gradle.kts b/opendc-web/opendc-web-runner/build.gradle.kts
index c1e3b976..a5723994 100644
--- a/opendc-web/opendc-web-runner/build.gradle.kts
+++ b/opendc-web/opendc-web-runner/build.gradle.kts
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2020 AtLarge Research
+ * Copyright (c) 2022 AtLarge Research
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,27 +24,67 @@ description = "Experiment runner for OpenDC"
/* Build configuration */
plugins {
- `kotlin-conventions`
- `testing-conventions`
- application
+ `kotlin-library-conventions`
+ distribution
}
-application {
- mainClass.set("org.opendc.web.runner.MainKt")
+val cli: SourceSet by sourceSets.creating {
+ compileClasspath += sourceSets["main"].output
+ runtimeClasspath += sourceSets["main"].output
+}
+
+val cliImplementation: Configuration by configurations.getting {
+ extendsFrom(configurations["implementation"])
+}
+val cliRuntimeOnly: Configuration by configurations.getting
+val cliRuntimeClasspath: Configuration by configurations.getting {
+ extendsFrom(configurations["runtimeClasspath"])
+}
+
+val cliJar by tasks.creating(Jar::class) {
+ from(cli.output)
+
+ archiveBaseName.set("${project.name}-cli")
}
dependencies {
+ api(projects.opendcWeb.opendcWebClient)
implementation(projects.opendcCompute.opendcComputeSimulator)
implementation(projects.opendcCompute.opendcComputeWorkload)
implementation(projects.opendcSimulator.opendcSimulatorCore)
implementation(projects.opendcTrace.opendcTraceApi)
- implementation(projects.opendcWeb.opendcWebClient)
implementation(libs.kotlin.logging)
- implementation(libs.clikt)
- implementation(libs.sentry.log4j2)
- implementation(kotlin("reflect"))
-
runtimeOnly(projects.opendcTrace.opendcTraceOpendc)
- runtimeOnly(libs.log4j.slf4j)
+ runtimeOnly(projects.opendcTrace.opendcTraceBitbrains)
+
+ cliImplementation(libs.clikt)
+ cliImplementation(libs.sentry.log4j2)
+
+ cliRuntimeOnly(projects.opendcTrace.opendcTraceOpendc)
+ cliRuntimeOnly(libs.log4j.slf4j)
+}
+
+val createCli by tasks.creating(CreateStartScripts::class) {
+ dependsOn(cliJar)
+
+ applicationName = "opendc-runner"
+ mainClass.set("org.opendc.web.runner.cli.MainKt")
+ classpath = cliJar.outputs.files + cliRuntimeClasspath
+ outputDir = project.buildDir.resolve("scripts")
+}
+
+distributions {
+ main {
+ contents {
+ into("bin") {
+ from(createCli)
+ }
+
+ into("lib") {
+ from(cliJar)
+ from(cliRuntimeClasspath) // Also includes main classpath
+ }
+ }
+ }
}