diff options
57 files changed, 469 insertions, 242 deletions
diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 21414d2e..431e8566 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -32,9 +32,9 @@ repositories { dependencies { implementation(kotlin("gradle-plugin", version = "1.5.10")) - implementation("org.jlleitschuh.gradle:ktlint-gradle:10.0.0") + implementation("org.jlleitschuh.gradle:ktlint-gradle:10.1.0") implementation("org.jetbrains.kotlin:kotlin-allopen:1.5.10") - implementation("org.jetbrains.kotlinx:kotlinx-benchmark-plugin:0.3.0") + implementation("org.jetbrains.kotlinx:kotlinx-benchmark-plugin:0.3.1") implementation("org.jetbrains.dokka:dokka-gradle-plugin:1.4.32") implementation("gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0") } diff --git a/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts b/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts index 4e73d4d3..78ed5d1f 100644 --- a/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/benchmark-conventions.gradle.kts @@ -50,7 +50,7 @@ benchmark { targets { register("jmh") { this as JvmBenchmarkTarget - jmhVersion = "1.21" + jmhVersion = "1.32" } } } diff --git a/buildSrc/src/main/kotlin/experiment-conventions.gradle.kts b/buildSrc/src/main/kotlin/experiment-conventions.gradle.kts index 26780205..c1750a40 100644 --- a/buildSrc/src/main/kotlin/experiment-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/experiment-conventions.gradle.kts @@ -1,5 +1,3 @@ -import gradle.kotlin.dsl.accessors._9bf86420fccbde1948375f641de89b70.sourceSets - /* * Copyright (c) 2021 AtLarge Research * diff --git a/buildSrc/src/main/kotlin/jacoco-aggregation.gradle.kts b/buildSrc/src/main/kotlin/jacoco-aggregation.gradle.kts index 1ea5de4c..5afd3e0d 100644 --- a/buildSrc/src/main/kotlin/jacoco-aggregation.gradle.kts +++ b/buildSrc/src/main/kotlin/jacoco-aggregation.gradle.kts @@ -1,9 +1,5 @@ -import gradle.kotlin.dsl.accessors._a850a9ab866951e91ee43960bbc39582.jacoco - /* - * MIT License - * - * Copyright (c) 2019 atlarge-research + * Copyright (c) 2021 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 @@ -34,20 +30,15 @@ repositories { mavenCentral() } -jacoco { - // Necessary for Kotlin 1.5.0. See https://github.com/jacoco/jacoco/issues/1155 - toolVersion = "0.8.7" -} - tasks.register<JacocoReport>("codeCoverageReport") { group = "Coverage reports" description = "Generates an aggregate report based on all subprojects" reports { - xml.isEnabled = true - xml.destination = file("${buildDir}/reports/jacoco/report.xml") + xml.required.set(true) + xml.outputLocation.set(file("${buildDir}/reports/jacoco/report.xml")) - html.isEnabled = true + html.required.set(true) } subprojects { diff --git a/buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts b/buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts index 5c7aea83..6fb9ccc3 100644 --- a/buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/jacoco-conventions.gradle.kts @@ -25,13 +25,8 @@ plugins { jacoco } -jacoco { - // Necessary for Kotlin 1.5.0. See https://github.com/jacoco/jacoco/issues/1155 - toolVersion = "0.8.7" -} - tasks.jacocoTestReport { reports { - html.isEnabled = true + html.required.set(true) } } diff --git a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts index 7d344500..bceb9e00 100644 --- a/buildSrc/src/main/kotlin/testing-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/testing-conventions.gradle.kts @@ -28,8 +28,8 @@ tasks.test { useJUnitPlatform() reports { - html.isEnabled = true - junitXml.isEnabled = true + html.required.set(true) + junitXml.required.set(true) } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 22f713f6..5c0f9ce3 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ hadoop = "3.3.0" kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.5.0" } # Logging -kotlin-logging = { module = "io.github.microutils:kotlin-logging", version = "2.0.6" } +kotlin-logging = { module = "io.github.microutils:kotlin-logging", version = "2.0.8" } slf4j-simple = { module = "org.slf4j:slf4j-simple", version.ref = "slf4j" } log4j-slf4j = { module = "org.apache.logging.log4j:log4j-slf4j-impl", version.ref = "log4j" } sentry-log4j2 = { module = "io.sentry:sentry-log4j2", version = "4.3.0" } @@ -35,16 +35,16 @@ clikt = { module = "com.github.ajalt.clikt:clikt", version = "3.2.0" } progressbar = { module = "me.tongfei:progressbar", version = "0.9.0" } # Format -jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version = "2.12.0" } +jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version = "2.12.3" } parquet = { module = "org.apache.parquet:parquet-avro", version = "1.12.0" } yaml = { module = "org.yaml:snakeyaml", version = "1.28" } config = { module = "com.typesafe:config", version = "1.4.1" } # Benchmark -kotlinx-benchmark-runtime-jvm = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-runtime-jvm", version = "0.3.0" } +kotlinx-benchmark-runtime-jvm = { module = "org.jetbrains.kotlinx:kotlinx-benchmark-runtime-jvm", version = "0.3.1" } # Other mongodb = { module = "org.mongodb:mongodb-driver-sync", version = "4.2.3" } -classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.105" } +classgraph = { module = "io.github.classgraph:classgraph", version = "4.8.108" } hadoop-common = { module = "org.apache.hadoop:hadoop-common", version.ref = "hadoop" } hadoop-mapreduce-client-core = { module = "org.apache.hadoop:hadoop-mapreduce-client-core", version.ref = "hadoop" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0f80bbf5..69a97150 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/monitor/ParquetExperimentMonitor.kt b/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/monitor/ParquetExperimentMonitor.kt index 983b4cff..bfdf5f3e 100644 --- a/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/monitor/ParquetExperimentMonitor.kt +++ b/opendc-experiments/opendc-experiments-capelin/src/main/kotlin/org/opendc/experiments/capelin/monitor/ParquetExperimentMonitor.kt @@ -43,11 +43,11 @@ private val logger = KotlinLogging.logger {} */ public class ParquetExperimentMonitor(base: File, partition: String, bufferSize: Int) : ExperimentMonitor { private val hostWriter = ParquetHostEventWriter( - File(base, "host-metrics/$partition/data.parquet"), + File(base, "host-metrics/$partition/data.parquet").also { it.parentFile.mkdirs() }, bufferSize ) private val provisionerWriter = ParquetProvisionerEventWriter( - File(base, "provisioner-metrics/$partition/data.parquet"), + File(base, "provisioner-metrics/$partition/data.parquet").also { it.parentFile.mkdirs() }, bufferSize ) diff --git a/opendc-experiments/opendc-experiments-energy21/src/main/kotlin/org/opendc/experiments/energy21/EnergyExperiment.kt b/opendc-experiments/opendc-experiments-energy21/src/main/kotlin/org/opendc/experiments/energy21/EnergyExperiment.kt index 37e10580..65915cc6 100644 --- a/opendc-experiments/opendc-experiments-energy21/src/main/kotlin/org/opendc/experiments/energy21/EnergyExperiment.kt +++ b/opendc-experiments/opendc-experiments-energy21/src/main/kotlin/org/opendc/experiments/energy21/EnergyExperiment.kt @@ -24,7 +24,6 @@ package org.opendc.experiments.energy21 import com.typesafe.config.ConfigFactory import io.opentelemetry.api.metrics.MeterProvider -import io.opentelemetry.sdk.metrics.SdkMeterProvider import io.opentelemetry.sdk.metrics.export.MetricProducer import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.channels.Channel @@ -50,7 +49,6 @@ import org.opendc.simulator.compute.model.ProcessingNode import org.opendc.simulator.compute.model.ProcessingUnit import org.opendc.simulator.compute.power.* import org.opendc.simulator.core.runBlockingSimulation -import org.opendc.telemetry.sdk.toOtelClock import java.io.File import java.time.Clock import java.util.* @@ -87,11 +85,7 @@ public class EnergyExperiment : Experiment("Energy Modeling 2021") { weighers = listOf(RandomWeigher(Random(0)) to 1.0) ) - val meterProvider: MeterProvider = SdkMeterProvider - .builder() - .setClock(clock.toOtelClock()) - .build() - + val meterProvider: MeterProvider = createMeterProvider(clock) val monitor = ParquetExperimentMonitor(File(config.getString("output-path")), "power_model=$powerModel/run_id=$repeat", 4096) val trace = Sc20StreamingParquetTraceReader(File(config.getString("trace-path"), trace), random = Random(1).asKotlinRandom()) diff --git a/opendc-experiments/opendc-experiments-energy21/src/main/resources/application.conf b/opendc-experiments/opendc-experiments-energy21/src/main/resources/application.conf index 3e011862..263da0fe 100644 --- a/opendc-experiments/opendc-experiments-energy21/src/main/resources/application.conf +++ b/opendc-experiments/opendc-experiments-energy21/src/main/resources/application.conf @@ -6,3 +6,9 @@ opendc.experiments.energy21 { # Path to the output directory to write the results to output-path = output } + +opendc.experiments.capelin { + env-path = input/environments/ + trace-path = input/traces/ + output-path = output +} diff --git a/opendc-experiments/opendc-experiments-serverless20/build.gradle.kts b/opendc-experiments/opendc-experiments-serverless20/build.gradle.kts index 7d68cb3a..65c31c4f 100644 --- a/opendc-experiments/opendc-experiments-serverless20/build.gradle.kts +++ b/opendc-experiments/opendc-experiments-serverless20/build.gradle.kts @@ -32,8 +32,8 @@ dependencies { api(platform(projects.opendcPlatform)) api(projects.opendcHarness.opendcHarnessApi) implementation(projects.opendcSimulator.opendcSimulatorCore) - implementation(projects.opendcServerless.opendcServerlessService) - implementation(projects.opendcServerless.opendcServerlessSimulator) + implementation(projects.opendcFaas.opendcFaasService) + implementation(projects.opendcFaas.opendcFaasSimulator) implementation(projects.opendcTelemetry.opendcTelemetrySdk) implementation(libs.kotlin.logging) implementation(libs.config) diff --git a/opendc-experiments/opendc-experiments-serverless20/src/main/kotlin/org/opendc/experiments/serverless/ServerlessExperiment.kt b/opendc-experiments/opendc-experiments-serverless20/src/main/kotlin/org/opendc/experiments/serverless/ServerlessExperiment.kt index 516bcc3e..3a016491 100644 --- a/opendc-experiments/opendc-experiments-serverless20/src/main/kotlin/org/opendc/experiments/serverless/ServerlessExperiment.kt +++ b/opendc-experiments/opendc-experiments-serverless20/src/main/kotlin/org/opendc/experiments/serverless/ServerlessExperiment.kt @@ -31,14 +31,14 @@ import kotlinx.coroutines.launch import mu.KotlinLogging import org.opendc.experiments.serverless.trace.FunctionTraceWorkload import org.opendc.experiments.serverless.trace.ServerlessTraceReader +import org.opendc.faas.service.FaaSService +import org.opendc.faas.service.autoscaler.FunctionTerminationPolicyFixed +import org.opendc.faas.service.router.RandomRoutingPolicy +import org.opendc.faas.simulator.SimFunctionDeployer +import org.opendc.faas.simulator.delay.ColdStartModel +import org.opendc.faas.simulator.delay.StochasticDelayInjector import org.opendc.harness.dsl.Experiment import org.opendc.harness.dsl.anyOf -import org.opendc.serverless.service.ServerlessService -import org.opendc.serverless.service.autoscaler.FunctionTerminationPolicyFixed -import org.opendc.serverless.service.router.RandomRoutingPolicy -import org.opendc.serverless.simulator.SimFunctionDeployer -import org.opendc.serverless.simulator.delay.ColdStartModel -import org.opendc.serverless.simulator.delay.StochasticDelayInjector import org.opendc.simulator.compute.SimMachineModel import org.opendc.simulator.compute.model.MemoryUnit import org.opendc.simulator.compute.model.ProcessingNode @@ -85,7 +85,7 @@ public class ServerlessExperiment : Experiment("Serverless") { val delayInjector = StochasticDelayInjector(coldStartModel, Random()) val deployer = SimFunctionDeployer(clock, this, createMachineModel(), delayInjector) { FunctionTraceWorkload(traceById.getValue(it.name)) } val service = - ServerlessService(coroutineContext, clock, meterProvider.get("opendc-serverless"), deployer, routingPolicy, FunctionTerminationPolicyFixed(coroutineContext, clock, timeout = 10 * 60 * 1000)) + FaaSService(coroutineContext, clock, meterProvider.get("opendc-serverless"), deployer, routingPolicy, FunctionTerminationPolicyFixed(coroutineContext, clock, timeout = 10 * 60 * 1000)) val client = service.newClient() coroutineScope { diff --git a/opendc-experiments/opendc-experiments-serverless20/src/main/kotlin/org/opendc/experiments/serverless/trace/FunctionTraceWorkload.kt b/opendc-experiments/opendc-experiments-serverless20/src/main/kotlin/org/opendc/experiments/serverless/trace/FunctionTraceWorkload.kt index 7d824857..9a93092e 100644 --- a/opendc-experiments/opendc-experiments-serverless20/src/main/kotlin/org/opendc/experiments/serverless/trace/FunctionTraceWorkload.kt +++ b/opendc-experiments/opendc-experiments-serverless20/src/main/kotlin/org/opendc/experiments/serverless/trace/FunctionTraceWorkload.kt @@ -22,13 +22,13 @@ package org.opendc.experiments.serverless.trace -import org.opendc.serverless.simulator.workload.SimServerlessWorkload +import org.opendc.faas.simulator.workload.SimFaaSWorkload import org.opendc.simulator.compute.workload.SimTraceWorkload import org.opendc.simulator.compute.workload.SimWorkload /** - * A [SimServerlessWorkload] for a [FunctionTrace]. + * A [SimFaaSWorkload] for a [FunctionTrace]. */ -public class FunctionTraceWorkload(trace: FunctionTrace) : SimServerlessWorkload, SimWorkload by SimTraceWorkload(trace.samples.asSequence().map { SimTraceWorkload.Fragment(it.duration, it.cpuUsage, 1) }) { +public class FunctionTraceWorkload(trace: FunctionTrace) : SimFaaSWorkload, SimWorkload by SimTraceWorkload(trace.samples.asSequence().map { SimTraceWorkload.Fragment(it.duration, it.cpuUsage, 1) }) { override suspend fun invoke() {} } diff --git a/opendc-serverless/build.gradle.kts b/opendc-faas/build.gradle.kts index a458c809..2493639f 100644 --- a/opendc-serverless/build.gradle.kts +++ b/opendc-faas/build.gradle.kts @@ -20,4 +20,4 @@ * SOFTWARE. */ -description = "Serverless platform for OpenDC" +description = "Function-as-a-Service (FaaS) platform for OpenDC" diff --git a/opendc-serverless/opendc-serverless-api/build.gradle.kts b/opendc-faas/opendc-faas-api/build.gradle.kts index 0d9a8036..7362d949 100644 --- a/opendc-serverless/opendc-serverless-api/build.gradle.kts +++ b/opendc-faas/opendc-faas-api/build.gradle.kts @@ -20,7 +20,7 @@ * SOFTWARE. */ -description = "Serverless API for OpenDC" +description = "API for the OpenDC FaaS platform" /* Build configuration */ plugins { diff --git a/opendc-serverless/opendc-serverless-api/src/main/kotlin/org/opendc/serverless/api/ServerlessClient.kt b/opendc-faas/opendc-faas-api/src/main/kotlin/org/opendc/faas/api/FaaSClient.kt index b66369ec..ebda4f90 100644 --- a/opendc-serverless/opendc-serverless-api/src/main/kotlin/org/opendc/serverless/api/ServerlessClient.kt +++ b/opendc-faas/opendc-faas-api/src/main/kotlin/org/opendc/faas/api/FaaSClient.kt @@ -20,32 +20,32 @@ * SOFTWARE. */ -package org.opendc.serverless.api +package org.opendc.faas.api import java.util.* /** - * Client interface to the OpenDC Serverless service. + * Client interface to the OpenDC FaaS platform. */ -public interface ServerlessClient : AutoCloseable { +public interface FaaSClient : AutoCloseable { /** - * Obtain the list of [ServerlessFunction]s accessible by the requesting user. + * Obtain the list of [FaaSFunction]s accessible by the requesting user. */ - public suspend fun queryFunctions(): List<ServerlessFunction> + public suspend fun queryFunctions(): List<FaaSFunction> /** - * Obtain a [ServerlessFunction] by its unique identifier. + * Obtain a [FaaSFunction] by its unique identifier. * * @param id The identifier of the flavor. */ - public suspend fun findFunction(id: UUID): ServerlessFunction? + public suspend fun findFunction(id: UUID): FaaSFunction? /** - * Obtain a [ServerlessFunction] by its name. + * Obtain a [FaaSFunction] by its name. * * @param name The name of the function. */ - public suspend fun findFunction(name: String): ServerlessFunction? + public suspend fun findFunction(name: String): FaaSFunction? /** * Create a new serverless function. @@ -60,7 +60,7 @@ public interface ServerlessClient : AutoCloseable { memorySize: Long, labels: Map<String, String> = emptyMap(), meta: Map<String, Any> = emptyMap() - ): ServerlessFunction + ): FaaSFunction /** * Invoke the function with the specified [name]. diff --git a/opendc-serverless/opendc-serverless-api/src/main/kotlin/org/opendc/serverless/api/ServerlessFunction.kt b/opendc-faas/opendc-faas-api/src/main/kotlin/org/opendc/faas/api/FaaSFunction.kt index f1360966..40f0092f 100644 --- a/opendc-serverless/opendc-serverless-api/src/main/kotlin/org/opendc/serverless/api/ServerlessFunction.kt +++ b/opendc-faas/opendc-faas-api/src/main/kotlin/org/opendc/faas/api/FaaSFunction.kt @@ -20,14 +20,14 @@ * SOFTWARE. */ -package org.opendc.serverless.api +package org.opendc.faas.api import java.util.UUID /** * A serverless function instance. */ -public interface ServerlessFunction { +public interface FaaSFunction { /** * The unique identifier of the function. */ diff --git a/opendc-serverless/opendc-serverless-service/build.gradle.kts b/opendc-faas/opendc-faas-service/build.gradle.kts index bce72c72..63bed8bc 100644 --- a/opendc-serverless/opendc-serverless-service/build.gradle.kts +++ b/opendc-faas/opendc-faas-service/build.gradle.kts @@ -20,7 +20,7 @@ * SOFTWARE. */ -description = "Serverless service for OpenDC" +description = "FaaS service for OpenDC" /* Build configuration */ plugins { @@ -31,7 +31,7 @@ plugins { dependencies { api(platform(projects.opendcPlatform)) - api(projects.opendcServerless.opendcServerlessApi) + api(projects.opendcFaas.opendcFaasApi) api(projects.opendcTelemetry.opendcTelemetryApi) implementation(projects.opendcUtils) implementation(libs.kotlin.logging) diff --git a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/ServerlessService.kt b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/FaaSService.kt index e2f135ae..7e716a34 100644 --- a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/ServerlessService.kt +++ b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/FaaSService.kt @@ -20,34 +20,34 @@ * SOFTWARE. */ -package org.opendc.serverless.service +package org.opendc.faas.service import io.opentelemetry.api.metrics.Meter -import org.opendc.serverless.api.ServerlessClient -import org.opendc.serverless.service.autoscaler.FunctionTerminationPolicy -import org.opendc.serverless.service.deployer.FunctionDeployer -import org.opendc.serverless.service.internal.ServerlessServiceImpl -import org.opendc.serverless.service.router.RoutingPolicy +import org.opendc.faas.api.FaaSClient +import org.opendc.faas.service.autoscaler.FunctionTerminationPolicy +import org.opendc.faas.service.deployer.FunctionDeployer +import org.opendc.faas.service.internal.FaaSServiceImpl +import org.opendc.faas.service.router.RoutingPolicy import java.time.Clock import kotlin.coroutines.CoroutineContext /** - * The [ServerlessService] hosts the API implementation of the OpenDC Serverless service. + * The [FaaSService] hosts the service implementation of the OpenDC FaaS platform. */ -public interface ServerlessService : AutoCloseable { +public interface FaaSService : AutoCloseable { /** - * Create a new [ServerlessClient] to control the compute service. + * Create a new [FaaSClient] to control the compute service. */ - public fun newClient(): ServerlessClient + public fun newClient(): FaaSClient /** - * Terminate the lifecycle of the serverless service, stopping all running function instances. + * Terminate the lifecycle of the FaaS service, stopping all running function instances. */ public override fun close() public companion object { /** - * Construct a new [ServerlessService] implementation. + * Construct a new [FaaSService] implementation. * * @param context The [CoroutineContext] to use in the service. * @param clock The clock instance to use. @@ -63,8 +63,8 @@ public interface ServerlessService : AutoCloseable { deployer: FunctionDeployer, routingPolicy: RoutingPolicy, terminationPolicy: FunctionTerminationPolicy, - ): ServerlessService { - return ServerlessServiceImpl(context, clock, meter, deployer, routingPolicy, terminationPolicy) + ): FaaSService { + return FaaSServiceImpl(context, clock, meter, deployer, routingPolicy, terminationPolicy) } } } diff --git a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/FunctionObject.kt b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/FunctionObject.kt index c12bbfe2..7c7621b8 100644 --- a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/FunctionObject.kt +++ b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/FunctionObject.kt @@ -20,14 +20,14 @@ * SOFTWARE. */ -package org.opendc.serverless.service +package org.opendc.faas.service import io.opentelemetry.api.metrics.BoundLongCounter import io.opentelemetry.api.metrics.BoundLongUpDownCounter import io.opentelemetry.api.metrics.BoundLongValueRecorder import io.opentelemetry.api.metrics.Meter import io.opentelemetry.api.metrics.common.Labels -import org.opendc.serverless.service.deployer.FunctionInstance +import org.opendc.faas.service.deployer.FunctionInstance import java.util.* /** diff --git a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/autoscaler/FunctionTerminationPolicy.kt b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/autoscaler/FunctionTerminationPolicy.kt index 25df10a6..2ab3638b 100644 --- a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/autoscaler/FunctionTerminationPolicy.kt +++ b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/autoscaler/FunctionTerminationPolicy.kt @@ -20,10 +20,10 @@ * SOFTWARE. */ -package org.opendc.serverless.service.autoscaler +package org.opendc.faas.service.autoscaler -import org.opendc.serverless.service.deployer.FunctionInstance -import org.opendc.serverless.service.deployer.FunctionInstanceListener +import org.opendc.faas.service.deployer.FunctionInstance +import org.opendc.faas.service.deployer.FunctionInstanceListener /** * A management policy that is responsible for downscaling the active function instances for a function. diff --git a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/autoscaler/FunctionTerminationPolicyFixed.kt b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/autoscaler/FunctionTerminationPolicyFixed.kt index 26b99f52..1e224ed1 100644 --- a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/autoscaler/FunctionTerminationPolicyFixed.kt +++ b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/autoscaler/FunctionTerminationPolicyFixed.kt @@ -20,10 +20,10 @@ * SOFTWARE. */ -package org.opendc.serverless.service.autoscaler +package org.opendc.faas.service.autoscaler -import org.opendc.serverless.service.deployer.FunctionInstance -import org.opendc.serverless.service.deployer.FunctionInstanceState +import org.opendc.faas.service.deployer.FunctionInstance +import org.opendc.faas.service.deployer.FunctionInstanceState import org.opendc.utils.TimerScheduler import java.time.Clock import kotlin.coroutines.CoroutineContext diff --git a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/autoscaler/FunctionTerminationPolicyNull.kt b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/autoscaler/FunctionTerminationPolicyNull.kt index f2d8da59..957e569b 100644 --- a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/autoscaler/FunctionTerminationPolicyNull.kt +++ b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/autoscaler/FunctionTerminationPolicyNull.kt @@ -20,9 +20,9 @@ * SOFTWARE. */ -package org.opendc.serverless.service.autoscaler +package org.opendc.faas.service.autoscaler -import org.opendc.serverless.service.deployer.FunctionInstance +import org.opendc.faas.service.deployer.FunctionInstance /** * A [FunctionTerminationPolicy] that never terminates function instances. diff --git a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/deployer/FunctionDeployer.kt b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/deployer/FunctionDeployer.kt index 5355b659..049f1cc7 100644 --- a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/deployer/FunctionDeployer.kt +++ b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/deployer/FunctionDeployer.kt @@ -20,9 +20,9 @@ * SOFTWARE. */ -package org.opendc.serverless.service.deployer +package org.opendc.faas.service.deployer -import org.opendc.serverless.service.FunctionObject +import org.opendc.faas.service.FunctionObject /** * A [FunctionDeployer] is responsible for ensuring that an instance of an arbitrary function, a [FunctionInstance], diff --git a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/deployer/FunctionInstance.kt b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/deployer/FunctionInstance.kt index d60648ea..a8b04df4 100644 --- a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/deployer/FunctionInstance.kt +++ b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/deployer/FunctionInstance.kt @@ -20,9 +20,9 @@ * SOFTWARE. */ -package org.opendc.serverless.service.deployer +package org.opendc.faas.service.deployer -import org.opendc.serverless.service.FunctionObject +import org.opendc.faas.service.FunctionObject /** * A [FunctionInstance] is a a self-contained worker—typically a container—capable of handling function executions. diff --git a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/deployer/FunctionInstanceListener.kt b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/deployer/FunctionInstanceListener.kt index 27803a63..20e280a2 100644 --- a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/deployer/FunctionInstanceListener.kt +++ b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/deployer/FunctionInstanceListener.kt @@ -20,7 +20,7 @@ * SOFTWARE. */ -package org.opendc.serverless.service.deployer +package org.opendc.faas.service.deployer /** * Listener interface for events originating from a [FunctionInstance]. diff --git a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/deployer/FunctionInstanceState.kt b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/deployer/FunctionInstanceState.kt index 4fc4a83f..2b6b6eba 100644 --- a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/deployer/FunctionInstanceState.kt +++ b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/deployer/FunctionInstanceState.kt @@ -20,7 +20,7 @@ * SOFTWARE. */ -package org.opendc.serverless.service.deployer +package org.opendc.faas.service.deployer /** * This enumeration describes the states of a [FunctionInstance]. diff --git a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/internal/ServerlessFunctionImpl.kt b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/internal/FaaSFunctionImpl.kt index 80b50e77..bd7f13f6 100644 --- a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/internal/ServerlessFunctionImpl.kt +++ b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/internal/FaaSFunctionImpl.kt @@ -20,19 +20,19 @@ * SOFTWARE. */ -package org.opendc.serverless.service.internal +package org.opendc.faas.service.internal -import org.opendc.serverless.api.ServerlessFunction -import org.opendc.serverless.service.FunctionObject +import org.opendc.faas.api.FaaSFunction +import org.opendc.faas.service.FunctionObject import java.util.* /** - * A [ServerlessFunction] implementation that is passed to clients. + * A [FaaSFunction] implementation that is passed to clients. */ -internal class ServerlessFunctionImpl( - private val service: ServerlessServiceImpl, +internal class FaaSFunctionImpl( + private val service: FaaSServiceImpl, private val state: FunctionObject -) : ServerlessFunction { +) : FaaSFunction { override val uid: UUID = state.uid override var name: String = state.name @@ -62,9 +62,9 @@ internal class ServerlessFunctionImpl( meta = state.meta } - override fun equals(other: Any?): Boolean = other is ServerlessFunctionImpl && uid == other.uid + override fun equals(other: Any?): Boolean = other is FaaSFunctionImpl && uid == other.uid override fun hashCode(): Int = uid.hashCode() - override fun toString(): String = "ServerlessFunction[uid=$uid,name=$name]" + override fun toString(): String = "FaaSFunction[uid=$uid,name=$name]" } diff --git a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/internal/ServerlessServiceImpl.kt b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/internal/FaaSServiceImpl.kt index 91a59279..b169436f 100644 --- a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/internal/ServerlessServiceImpl.kt +++ b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/internal/FaaSServiceImpl.kt @@ -20,22 +20,22 @@ * SOFTWARE. */ -package org.opendc.serverless.service.internal +package org.opendc.faas.service.internal import io.opentelemetry.api.metrics.Meter import kotlinx.coroutines.* import kotlinx.coroutines.intrinsics.startCoroutineCancellable import mu.KotlinLogging -import org.opendc.serverless.api.ServerlessClient -import org.opendc.serverless.api.ServerlessFunction -import org.opendc.serverless.service.FunctionObject -import org.opendc.serverless.service.ServerlessService -import org.opendc.serverless.service.autoscaler.FunctionTerminationPolicy -import org.opendc.serverless.service.deployer.FunctionDeployer -import org.opendc.serverless.service.deployer.FunctionInstance -import org.opendc.serverless.service.deployer.FunctionInstanceListener -import org.opendc.serverless.service.deployer.FunctionInstanceState -import org.opendc.serverless.service.router.RoutingPolicy +import org.opendc.faas.api.FaaSClient +import org.opendc.faas.api.FaaSFunction +import org.opendc.faas.service.FaaSService +import org.opendc.faas.service.FunctionObject +import org.opendc.faas.service.autoscaler.FunctionTerminationPolicy +import org.opendc.faas.service.deployer.FunctionDeployer +import org.opendc.faas.service.deployer.FunctionInstance +import org.opendc.faas.service.deployer.FunctionInstanceListener +import org.opendc.faas.service.deployer.FunctionInstanceState +import org.opendc.faas.service.router.RoutingPolicy import org.opendc.utils.TimerScheduler import java.lang.IllegalStateException import java.time.Clock @@ -45,20 +45,20 @@ import kotlin.coroutines.CoroutineContext import kotlin.coroutines.resumeWithException /** - * Implementation of the [ServerlessService] interface. + * Implementation of the [FaaSService] interface. * * This component acts as the function router from the SPEC RG Reference Architecture for FaaS and is responsible * for routing incoming requests or events to the correct [FunctionInstance]. If no [FunctionInstance] is available, * this component queues the events to await the deployment of new instances. */ -internal class ServerlessServiceImpl( +internal class FaaSServiceImpl( context: CoroutineContext, private val clock: Clock, private val meter: Meter, private val deployer: FunctionDeployer, private val routingPolicy: RoutingPolicy, private val terminationPolicy: FunctionTerminationPolicy -) : ServerlessService, FunctionInstanceListener { +) : FaaSService, FunctionInstanceListener { /** * The [CoroutineScope] of the service bounded by the lifecycle of the service. */ @@ -114,30 +114,30 @@ internal class ServerlessServiceImpl( .setUnit("1") .build() - override fun newClient(): ServerlessClient { - return object : ServerlessClient { + override fun newClient(): FaaSClient { + return object : FaaSClient { private var isClosed: Boolean = false /** - * Exposes a [FunctionObject] to a client-exposed [ServerlessFunction] instance. + * Exposes a [FunctionObject] to a client-exposed [FaaSFunction] instance. */ - private fun FunctionObject.asClientFunction(): ServerlessFunction { - return ServerlessFunctionImpl(this@ServerlessServiceImpl, this) + private fun FunctionObject.asClientFunction(): FaaSFunction { + return FaaSFunctionImpl(this@FaaSServiceImpl, this) } - override suspend fun queryFunctions(): List<ServerlessFunction> { + override suspend fun queryFunctions(): List<FaaSFunction> { check(!isClosed) { "Client is already closed" } return functions.values.map { it.asClientFunction() } } - override suspend fun findFunction(id: UUID): ServerlessFunction? { + override suspend fun findFunction(id: UUID): FaaSFunction? { check(!isClosed) { "Client is already closed" } return functions[id]?.asClientFunction() } - override suspend fun findFunction(name: String): ServerlessFunction? { + override suspend fun findFunction(name: String): FaaSFunction? { check(!isClosed) { "Client is already closed" } return functionsByName[name]?.asClientFunction() @@ -148,7 +148,7 @@ internal class ServerlessServiceImpl( memorySize: Long, labels: Map<String, String>, meta: Map<String, Any> - ): ServerlessFunction { + ): FaaSFunction { check(!isClosed) { "Client is already closed" } require(name !in functionsByName) { "Function with same name exists" } @@ -172,7 +172,7 @@ internal class ServerlessServiceImpl( check(!isClosed) { "Client is already closed" } val func = requireNotNull(functionsByName[name]) { "Unknown function" } - this@ServerlessServiceImpl.invoke(func) + this@FaaSServiceImpl.invoke(func) } override fun close() { diff --git a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/router/RandomRoutingPolicy.kt b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/router/RandomRoutingPolicy.kt index 063fb80a..5bd9d4d3 100644 --- a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/router/RandomRoutingPolicy.kt +++ b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/router/RandomRoutingPolicy.kt @@ -20,10 +20,10 @@ * SOFTWARE. */ -package org.opendc.serverless.service.router +package org.opendc.faas.service.router -import org.opendc.serverless.service.FunctionObject -import org.opendc.serverless.service.deployer.FunctionInstance +import org.opendc.faas.service.FunctionObject +import org.opendc.faas.service.deployer.FunctionInstance import kotlin.random.Random /** diff --git a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/router/RoutingPolicy.kt b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/router/RoutingPolicy.kt index d5d1166f..e99e329a 100644 --- a/opendc-serverless/opendc-serverless-service/src/main/kotlin/org/opendc/serverless/service/router/RoutingPolicy.kt +++ b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/router/RoutingPolicy.kt @@ -20,10 +20,10 @@ * SOFTWARE. */ -package org.opendc.serverless.service.router +package org.opendc.faas.service.router -import org.opendc.serverless.service.FunctionObject -import org.opendc.serverless.service.deployer.FunctionInstance +import org.opendc.faas.service.FunctionObject +import org.opendc.faas.service.deployer.FunctionInstance /** * A [RoutingPolicy] decides to which [FunctionInstance] a function invocation should be routed. diff --git a/opendc-serverless/opendc-serverless-service/src/test/kotlin/org/opendc/serverless/service/ServerlessServiceTest.kt b/opendc-faas/opendc-faas-service/src/test/kotlin/org/opendc/faas/service/FaaSServiceTest.kt index 6b2e8223..6b99684a 100644 --- a/opendc-serverless/opendc-serverless-service/src/test/kotlin/org/opendc/serverless/service/ServerlessServiceTest.kt +++ b/opendc-faas/opendc-faas-service/src/test/kotlin/org/opendc/faas/service/FaaSServiceTest.kt @@ -20,7 +20,7 @@ * SOFTWARE. */ -package org.opendc.serverless.service +package org.opendc.faas.service import io.mockk.* import io.opentelemetry.api.metrics.MeterProvider @@ -29,23 +29,23 @@ import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows -import org.opendc.serverless.api.ServerlessFunction -import org.opendc.serverless.service.deployer.FunctionDeployer -import org.opendc.serverless.service.deployer.FunctionInstance -import org.opendc.serverless.service.deployer.FunctionInstanceState +import org.opendc.faas.api.FaaSFunction +import org.opendc.faas.service.deployer.FunctionDeployer +import org.opendc.faas.service.deployer.FunctionInstance +import org.opendc.faas.service.deployer.FunctionInstanceState import org.opendc.simulator.core.runBlockingSimulation import java.util.* /** - * Test suite for the [ServerlessService] implementation. + * Test suite for the [FaaSService] implementation. */ @OptIn(ExperimentalCoroutinesApi::class) -internal class ServerlessServiceTest { +internal class FaaSServiceTest { @Test fun testClientState() = runBlockingSimulation { - val meter = MeterProvider.noop().get("opendc-serverless") - val service = ServerlessService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) + val meter = MeterProvider.noop().get("opendc-faas") + val service = FaaSService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) val client = assertDoesNotThrow { service.newClient() } assertDoesNotThrow { client.close() } @@ -59,8 +59,8 @@ internal class ServerlessServiceTest { @Test fun testClientInvokeUnknown() = runBlockingSimulation { - val meter = MeterProvider.noop().get("opendc-serverless") - val service = ServerlessService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) + val meter = MeterProvider.noop().get("opendc-faas") + val service = FaaSService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) val client = service.newClient() @@ -69,8 +69,8 @@ internal class ServerlessServiceTest { @Test fun testClientFunctionCreation() = runBlockingSimulation { - val meter = MeterProvider.noop().get("opendc-serverless") - val service = ServerlessService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) + val meter = MeterProvider.noop().get("opendc-faas") + val service = FaaSService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) val client = service.newClient() @@ -81,12 +81,12 @@ internal class ServerlessServiceTest { @Test fun testClientFunctionQuery() = runBlockingSimulation { - val meter = MeterProvider.noop().get("opendc-serverless") - val service = ServerlessService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) + val meter = MeterProvider.noop().get("opendc-faas") + val service = FaaSService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) val client = service.newClient() - assertEquals(emptyList<ServerlessFunction>(), client.queryFunctions()) + assertEquals(emptyList<FaaSFunction>(), client.queryFunctions()) val function = client.newFunction("test", 128) @@ -95,12 +95,12 @@ internal class ServerlessServiceTest { @Test fun testClientFunctionFindById() = runBlockingSimulation { - val meter = MeterProvider.noop().get("opendc-serverless") - val service = ServerlessService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) + val meter = MeterProvider.noop().get("opendc-faas") + val service = FaaSService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) val client = service.newClient() - assertEquals(emptyList<ServerlessFunction>(), client.queryFunctions()) + assertEquals(emptyList<FaaSFunction>(), client.queryFunctions()) val function = client.newFunction("test", 128) @@ -109,12 +109,12 @@ internal class ServerlessServiceTest { @Test fun testClientFunctionFindByName() = runBlockingSimulation { - val meter = MeterProvider.noop().get("opendc-serverless") - val service = ServerlessService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) + val meter = MeterProvider.noop().get("opendc-faas") + val service = FaaSService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) val client = service.newClient() - assertEquals(emptyList<ServerlessFunction>(), client.queryFunctions()) + assertEquals(emptyList<FaaSFunction>(), client.queryFunctions()) val function = client.newFunction("test", 128) @@ -123,8 +123,8 @@ internal class ServerlessServiceTest { @Test fun testClientFunctionDuplicateName() = runBlockingSimulation { - val meter = MeterProvider.noop().get("opendc-serverless") - val service = ServerlessService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) + val meter = MeterProvider.noop().get("opendc-faas") + val service = FaaSService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) val client = service.newClient() @@ -135,8 +135,8 @@ internal class ServerlessServiceTest { @Test fun testClientFunctionDelete() = runBlockingSimulation { - val meter = MeterProvider.noop().get("opendc-serverless") - val service = ServerlessService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) + val meter = MeterProvider.noop().get("opendc-faas") + val service = FaaSService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) val client = service.newClient() val function = client.newFunction("test", 128) @@ -150,8 +150,8 @@ internal class ServerlessServiceTest { @Test fun testClientFunctionCannotInvokeDeleted() = runBlockingSimulation { - val meter = MeterProvider.noop().get("opendc-serverless") - val service = ServerlessService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) + val meter = MeterProvider.noop().get("opendc-faas") + val service = FaaSService(coroutineContext, clock, meter, mockk(), mockk(), mockk()) val client = service.newClient() val function = client.newFunction("test", 128) @@ -163,9 +163,9 @@ internal class ServerlessServiceTest { @Test fun testClientFunctionInvoke() = runBlockingSimulation { - val meter = MeterProvider.noop().get("opendc-serverless") + val meter = MeterProvider.noop().get("opendc-faas") val deployer = mockk<FunctionDeployer>() - val service = ServerlessService(coroutineContext, clock, meter, deployer, mockk(), mockk(relaxUnitFun = true)) + val service = FaaSService(coroutineContext, clock, meter, deployer, mockk(), mockk(relaxUnitFun = true)) every { deployer.deploy(any(), any()) } answers { object : FunctionInstance { diff --git a/opendc-serverless/opendc-serverless-simulator/build.gradle.kts b/opendc-faas/opendc-faas-simulator/build.gradle.kts index 5e2c522d..fed1862d 100644 --- a/opendc-serverless/opendc-serverless-simulator/build.gradle.kts +++ b/opendc-faas/opendc-faas-simulator/build.gradle.kts @@ -20,7 +20,7 @@ * SOFTWARE. */ -description = "Simulator for OpenDC Serverles" +description = "Simulator for the OpenDC FaaS platform" /* Build configuration */ plugins { @@ -31,7 +31,7 @@ plugins { dependencies { api(platform(projects.opendcPlatform)) - api(projects.opendcServerless.opendcServerlessService) + api(projects.opendcFaas.opendcFaasService) api(projects.opendcSimulator.opendcSimulatorCompute) testImplementation(projects.opendcSimulator.opendcSimulatorCore) diff --git a/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/SimFunctionDeployer.kt b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/SimFunctionDeployer.kt index 32e5f75e..602f1678 100644 --- a/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/SimFunctionDeployer.kt +++ b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/SimFunctionDeployer.kt @@ -20,17 +20,17 @@ * SOFTWARE. */ -package org.opendc.serverless.simulator +package org.opendc.faas.simulator import kotlinx.coroutines.* import kotlinx.coroutines.channels.Channel -import org.opendc.serverless.service.FunctionObject -import org.opendc.serverless.service.deployer.FunctionDeployer -import org.opendc.serverless.service.deployer.FunctionInstance -import org.opendc.serverless.service.deployer.FunctionInstanceListener -import org.opendc.serverless.service.deployer.FunctionInstanceState -import org.opendc.serverless.simulator.delay.DelayInjector -import org.opendc.serverless.simulator.workload.SimServerlessWorkloadMapper +import org.opendc.faas.service.FunctionObject +import org.opendc.faas.service.deployer.FunctionDeployer +import org.opendc.faas.service.deployer.FunctionInstance +import org.opendc.faas.service.deployer.FunctionInstanceListener +import org.opendc.faas.service.deployer.FunctionInstanceState +import org.opendc.faas.simulator.delay.DelayInjector +import org.opendc.faas.simulator.workload.SimFaaSWorkloadMapper import org.opendc.simulator.compute.SimBareMetalMachine import org.opendc.simulator.compute.SimMachine import org.opendc.simulator.compute.SimMachineModel @@ -51,7 +51,7 @@ public class SimFunctionDeployer( private val scope: CoroutineScope, private val model: SimMachineModel, private val delayInjector: DelayInjector, - private val mapper: SimServerlessWorkloadMapper + private val mapper: SimFaaSWorkloadMapper ) : FunctionDeployer { override fun deploy(function: FunctionObject, listener: FunctionInstanceListener): Instance { @@ -63,7 +63,8 @@ public class SimFunctionDeployer( /** * A simulated [FunctionInstance]. */ - public inner class Instance(override val function: FunctionObject, private val listener: FunctionInstanceListener) : FunctionInstance { + public inner class Instance(override val function: FunctionObject, private val listener: FunctionInstanceListener) : + FunctionInstance { /** * The workload associated with this instance. */ diff --git a/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/delay/ColdStartModel.kt b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/delay/ColdStartModel.kt index f9f3718e..624067be 100644 --- a/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/delay/ColdStartModel.kt +++ b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/delay/ColdStartModel.kt @@ -20,7 +20,7 @@ * SOFTWARE. */ -package org.opendc.serverless.simulator.delay +package org.opendc.faas.simulator.delay /** * Model parameters for the cold start times of serverless services. diff --git a/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/delay/DelayInjector.kt b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/delay/DelayInjector.kt index f882031b..c1df682c 100644 --- a/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/delay/DelayInjector.kt +++ b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/delay/DelayInjector.kt @@ -20,9 +20,9 @@ * SOFTWARE. */ -package org.opendc.serverless.simulator.delay +package org.opendc.faas.simulator.delay -import org.opendc.serverless.service.deployer.FunctionInstance +import org.opendc.faas.service.deployer.FunctionInstance /** * An interface for modeling the delay caused by function cold starts. diff --git a/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/delay/StochasticDelayInjector.kt b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/delay/StochasticDelayInjector.kt index 154378e1..9442e2d3 100644 --- a/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/delay/StochasticDelayInjector.kt +++ b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/delay/StochasticDelayInjector.kt @@ -20,9 +20,9 @@ * SOFTWARE. */ -package org.opendc.serverless.simulator.delay +package org.opendc.faas.simulator.delay -import org.opendc.serverless.service.deployer.FunctionInstance +import org.opendc.faas.service.deployer.FunctionInstance import java.util.* import kotlin.math.abs diff --git a/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/delay/ZeroDelayInjector.kt b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/delay/ZeroDelayInjector.kt index 0895ee18..0e318764 100644 --- a/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/delay/ZeroDelayInjector.kt +++ b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/delay/ZeroDelayInjector.kt @@ -20,9 +20,9 @@ * SOFTWARE. */ -package org.opendc.serverless.simulator.delay +package org.opendc.faas.simulator.delay -import org.opendc.serverless.service.deployer.FunctionInstance +import org.opendc.faas.service.deployer.FunctionInstance public object ZeroDelayInjector : DelayInjector { override fun getColdStartDelay(instance: FunctionInstance): Long = 0 diff --git a/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/workload/SimServerlessWorkload.kt b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/workload/SimFaaSWorkload.kt index 121bf915..aaee26c0 100644 --- a/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/workload/SimServerlessWorkload.kt +++ b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/workload/SimFaaSWorkload.kt @@ -20,14 +20,14 @@ * SOFTWARE. */ -package org.opendc.serverless.simulator.workload +package org.opendc.faas.simulator.workload import org.opendc.simulator.compute.workload.SimWorkload /** - * A model for a serverless workload, which may be invoked multiple times. + * A model for a serverless function workload, which may be invoked multiple times. */ -public interface SimServerlessWorkload : SimWorkload { +public interface SimFaaSWorkload : SimWorkload { /** * This method is invoked when an active function instance is invoked. */ diff --git a/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/workload/SimFaaSWorkloadMapper.kt b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/workload/SimFaaSWorkloadMapper.kt new file mode 100644 index 00000000..b22dd659 --- /dev/null +++ b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/workload/SimFaaSWorkloadMapper.kt @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2021 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package org.opendc.faas.simulator.workload + +import org.opendc.faas.api.FaaSFunction +import org.opendc.faas.service.FunctionObject + +/** + * A [SimFaaSWorkloadMapper] is responsible for mapping a [FaaSFunction] to a [SimFaaSWorkload] that + * can be simulated. + */ +public fun interface SimFaaSWorkloadMapper { + /** + * Map the specified [function] to a [SimFaaSWorkload] that can be simulated. + */ + public fun createWorkload(function: FunctionObject): SimFaaSWorkload +} diff --git a/opendc-serverless/opendc-serverless-simulator/src/test/kotlin/org/opendc/serverless/simulator/SimServerlessServiceTest.kt b/opendc-faas/opendc-faas-simulator/src/test/kotlin/org/opendc/faas/simulator/SimFaaSServiceTest.kt index 6afa1b65..ceb91e75 100644 --- a/opendc-serverless/opendc-serverless-simulator/src/test/kotlin/org/opendc/serverless/simulator/SimServerlessServiceTest.kt +++ b/opendc-faas/opendc-faas-simulator/src/test/kotlin/org/opendc/faas/simulator/SimFaaSServiceTest.kt @@ -20,7 +20,7 @@ * SOFTWARE. */ -package org.opendc.serverless.simulator +package org.opendc.faas.simulator import io.mockk.coVerify import io.mockk.spyk @@ -31,11 +31,11 @@ import kotlinx.coroutines.yield import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertAll -import org.opendc.serverless.service.ServerlessService -import org.opendc.serverless.service.autoscaler.FunctionTerminationPolicyFixed -import org.opendc.serverless.service.router.RandomRoutingPolicy -import org.opendc.serverless.simulator.delay.ZeroDelayInjector -import org.opendc.serverless.simulator.workload.SimServerlessWorkload +import org.opendc.faas.service.FaaSService +import org.opendc.faas.service.autoscaler.FunctionTerminationPolicyFixed +import org.opendc.faas.service.router.RandomRoutingPolicy +import org.opendc.faas.simulator.delay.ZeroDelayInjector +import org.opendc.faas.simulator.workload.SimFaaSWorkload import org.opendc.simulator.compute.SimMachineModel import org.opendc.simulator.compute.model.MemoryUnit import org.opendc.simulator.compute.model.ProcessingNode @@ -45,10 +45,10 @@ import org.opendc.simulator.compute.workload.SimWorkload import org.opendc.simulator.core.runBlockingSimulation /** - * A test suite for the [ServerlessService] implementation under simulated conditions. + * A test suite for the [FaaSService] implementation under simulated conditions. */ @OptIn(ExperimentalCoroutinesApi::class) -internal class SimServerlessServiceTest { +internal class SimFaaSServiceTest { private lateinit var machineModel: SimMachineModel @@ -64,12 +64,12 @@ internal class SimServerlessServiceTest { @Test fun testSmoke() = runBlockingSimulation { - val meter = MeterProvider.noop().get("opendc-serverless") - val workload = spyk(object : SimServerlessWorkload, SimWorkload by SimFlopsWorkload(1000) { + val meter = MeterProvider.noop().get("opendc-faas") + val workload = spyk(object : SimFaaSWorkload, SimWorkload by SimFlopsWorkload(1000) { override suspend fun invoke() {} }) val deployer = SimFunctionDeployer(clock, this, machineModel, ZeroDelayInjector) { workload } - val service = ServerlessService( + val service = FaaSService( coroutineContext, clock, meter, deployer, RandomRoutingPolicy(), FunctionTerminationPolicyFixed(coroutineContext, clock, timeout = 10000) ) diff --git a/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt b/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt index cf90da68..bef6b742 100644 --- a/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt +++ b/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt @@ -106,7 +106,7 @@ public class Sc20ClusterEnvironmentReader( // For now we assume a simple linear load model with an idle draw of ~200W and a maximum // power draw of 350W. // Source: https://stackoverflow.com/questions/6128960 - LinearPowerModel(350.0, 200 / 350.0) + LinearPowerModel(350.0, idlePower = 200.0) ) ) } diff --git a/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt b/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt index c6a19430..2fa1caab 100644 --- a/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt +++ b/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt @@ -84,7 +84,7 @@ public class Sc20EnvironmentReader(input: InputStream, mapper: ObjectMapper = ja // For now we assume a simple linear load model with an idle draw of ~200W and a maximum // power draw of 350W. // Source: https://stackoverflow.com/questions/6128960 - LinearPowerModel(350.0, 200 / 350.0) + LinearPowerModel(350.0, idlePower = 200.0) ) } } diff --git a/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/workload/SimServerlessWorkloadMapper.kt b/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/workload/SimServerlessWorkloadMapper.kt deleted file mode 100644 index 3a47eb53..00000000 --- a/opendc-serverless/opendc-serverless-simulator/src/main/kotlin/org/opendc/serverless/simulator/workload/SimServerlessWorkloadMapper.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2021 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 - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -package org.opendc.serverless.simulator.workload - -import org.opendc.serverless.api.ServerlessFunction -import org.opendc.serverless.service.FunctionObject - -/** - * A [SimServerlessWorkloadMapper] is responsible for mapping a [ServerlessFunction] to a [SimServerlessWorkload] that - * can be simulated. - */ -public fun interface SimServerlessWorkloadMapper { - /** - * Map the specified [function] to a [SimServerlessWorkload] that can be simulated. - */ - public fun createWorkload(function: FunctionObject): SimServerlessWorkload -} diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/AsymptoticPowerModel.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/AsymptoticPowerModel.kt index ddc6d5b1..62b85e12 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/AsymptoticPowerModel.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/AsymptoticPowerModel.kt @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2021 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package org.opendc.simulator.compute.power import kotlin.math.E diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/ConstantPowerModel.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/ConstantPowerModel.kt index b8cb8412..0fe32b0d 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/ConstantPowerModel.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/ConstantPowerModel.kt @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2021 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package org.opendc.simulator.compute.power /** diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/CubicPowerModel.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/CubicPowerModel.kt index 9c44438a..0d3bf6cc 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/CubicPowerModel.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/CubicPowerModel.kt @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2021 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package org.opendc.simulator.compute.power import kotlin.math.pow diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/InterpolationPowerModel.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/InterpolationPowerModel.kt index cbfcd810..0c995f06 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/InterpolationPowerModel.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/InterpolationPowerModel.kt @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2021 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package org.opendc.simulator.compute.power import org.yaml.snakeyaml.Yaml diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/LinearPowerModel.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/LinearPowerModel.kt index 0f45afae..dadc56ec 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/LinearPowerModel.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/LinearPowerModel.kt @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2021 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package org.opendc.simulator.compute.power /** diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/MsePowerModel.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/MsePowerModel.kt index 8486d680..612ce2fc 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/MsePowerModel.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/MsePowerModel.kt @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2021 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package org.opendc.simulator.compute.power import kotlin.math.pow diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/PowerModel.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/PowerModel.kt index 1387e65a..decb2420 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/PowerModel.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/PowerModel.kt @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2021 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package org.opendc.simulator.compute.power import org.opendc.simulator.compute.SimMachine diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/SqrtPowerModel.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/SqrtPowerModel.kt index afa1d82f..0665dbd9 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/SqrtPowerModel.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/SqrtPowerModel.kt @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2021 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package org.opendc.simulator.compute.power import kotlin.math.sqrt diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/SquarePowerModel.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/SquarePowerModel.kt index 82a9d37d..e4ae88a9 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/SquarePowerModel.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/SquarePowerModel.kt @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2021 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package org.opendc.simulator.compute.power import kotlin.math.pow diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/ZeroIdlePowerDecorator.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/ZeroIdlePowerDecorator.kt index 19dfcadd..886227e1 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/ZeroIdlePowerDecorator.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/power/ZeroIdlePowerDecorator.kt @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2021 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package org.opendc.simulator.compute.power /** diff --git a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/power/PowerModelTest.kt b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/power/PowerModelTest.kt index dd93302b..ac2ed303 100644 --- a/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/power/PowerModelTest.kt +++ b/opendc-simulator/opendc-simulator-compute/src/test/kotlin/org/opendc/simulator/compute/power/PowerModelTest.kt @@ -1,3 +1,25 @@ +/* + * Copyright (c) 2021 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 + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + package org.opendc.simulator.compute.power import org.junit.jupiter.api.Assertions.assertAll diff --git a/settings.gradle.kts b/settings.gradle.kts index 3b0571b8..34b9bf36 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -27,9 +27,9 @@ include(":opendc-compute:opendc-compute-service") include(":opendc-compute:opendc-compute-simulator") include(":opendc-workflow:opendc-workflow-api") include(":opendc-workflow:opendc-workflow-service") -include(":opendc-serverless:opendc-serverless-api") -include(":opendc-serverless:opendc-serverless-service") -include(":opendc-serverless:opendc-serverless-simulator") +include(":opendc-faas:opendc-faas-api") +include(":opendc-faas:opendc-faas-service") +include(":opendc-faas:opendc-faas-simulator") include(":opendc-format") include(":opendc-experiments:opendc-experiments-capelin") include(":opendc-experiments:opendc-experiments-energy21") |
