summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--opendc-trace/opendc-trace-parquet/build.gradle.kts1
-rw-r--r--opendc-web/opendc-web-runner/Dockerfile2
-rw-r--r--opendc-web/opendc-web-runner/build.gradle.kts64
-rw-r--r--opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt (renamed from opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/Main.kt)2
-rw-r--r--settings.gradle.kts2
5 files changed, 56 insertions, 15 deletions
diff --git a/opendc-trace/opendc-trace-parquet/build.gradle.kts b/opendc-trace/opendc-trace-parquet/build.gradle.kts
index 794dd655..9b1e1273 100644
--- a/opendc-trace/opendc-trace-parquet/build.gradle.kts
+++ b/opendc-trace/opendc-trace-parquet/build.gradle.kts
@@ -43,6 +43,7 @@ dependencies {
exclude(group = "org.apache.htrace")
exclude(group = "commons-cli")
exclude(group = "javax.servlet")
+ exclude(group = "javax.servlet.jsp")
exclude(group = "org.eclipse.jetty")
exclude(group = "com.sun.jersey")
exclude(group = "com.jcraft")
diff --git a/opendc-web/opendc-web-runner/Dockerfile b/opendc-web/opendc-web-runner/Dockerfile
index b72f8a7f..bb606f4e 100644
--- a/opendc-web/opendc-web-runner/Dockerfile
+++ b/opendc-web/opendc-web-runner/Dockerfile
@@ -1,4 +1,4 @@
-FROM openjdk:17-slim
+FROM openjdk:18-slim
MAINTAINER OpenDC Maintainers <opendc@atlarge-research.com>
# Obtain (cache) Gradle wrapper
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
+ }
+ }
+ }
}
diff --git a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/Main.kt b/opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt
index 7bf7e220..348a838c 100644
--- a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/Main.kt
+++ b/opendc-web/opendc-web-runner/src/cli/kotlin/org/opendc/web/runner/Main.kt
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 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
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 805e8364..d3f3dc9d 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -41,7 +41,7 @@ include(":opendc-web:opendc-web-client")
include(":opendc-web:opendc-web-ui")
include(":opendc-web:opendc-web-ui-quarkus:deployment")
include(":opendc-web:opendc-web-ui-quarkus:runtime")
-include(":opendc-web:opendc-web-runner")
+include(":opendc-web:opendc-web-runner:opendc-web-runner")
include(":opendc-simulator:opendc-simulator-core")
include(":opendc-simulator:opendc-simulator-flow")
include(":opendc-simulator:opendc-simulator-power")