diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-02-18 14:08:18 +0100 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-02-18 14:46:29 +0100 |
| commit | 52d35cd82905612f0ef9f7b7d88611300fb48ebe (patch) | |
| tree | ad2464b4ec2b8d399cbaa9ea68364ad1e04418e2 | |
| parent | 028960fbf584c903156c713447194df56ec5059e (diff) | |
refactor(utils): Rename utils module to common module
This change adds a new module, opendc-common, that contains
functionality that is shared across OpenDC's modules.
We move the existing utils module into this new module.
15 files changed, 18 insertions, 18 deletions
diff --git a/opendc-utils/build.gradle.kts b/opendc-common/build.gradle.kts index 858aa64c..67441e93 100644 --- a/opendc-utils/build.gradle.kts +++ b/opendc-common/build.gradle.kts @@ -20,7 +20,7 @@ * SOFTWARE. */ -description = "Utilities used across OpenDC modules" +description = "Common functionality used across OpenDC modules" /* Build configuration */ plugins { diff --git a/opendc-utils/src/main/kotlin/org/opendc/utils/Pacer.kt b/opendc-common/src/main/kotlin/org/opendc/common/util/Pacer.kt index 07d3cb87..8ccff6c3 100644 --- a/opendc-utils/src/main/kotlin/org/opendc/utils/Pacer.kt +++ b/opendc-common/src/main/kotlin/org/opendc/common/util/Pacer.kt @@ -20,7 +20,7 @@ * SOFTWARE. */ -package org.opendc.utils +package org.opendc.common.util import kotlinx.coroutines.* import java.lang.Runnable diff --git a/opendc-utils/src/main/kotlin/org/opendc/utils/TimerScheduler.kt b/opendc-common/src/main/kotlin/org/opendc/common/util/TimerScheduler.kt index d7da7f99..86314411 100644 --- a/opendc-utils/src/main/kotlin/org/opendc/utils/TimerScheduler.kt +++ b/opendc-common/src/main/kotlin/org/opendc/common/util/TimerScheduler.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 @@ -20,7 +20,7 @@ * SOFTWARE. */ -package org.opendc.utils +package org.opendc.common.util import kotlinx.coroutines.* import kotlinx.coroutines.channels.Channel diff --git a/opendc-utils/src/test/kotlin/org/opendc/utils/PacerTest.kt b/opendc-common/src/test/kotlin/org/opendc/common/util/PacerTest.kt index b8419e80..1cd435f6 100644 --- a/opendc-utils/src/test/kotlin/org/opendc/utils/PacerTest.kt +++ b/opendc-common/src/test/kotlin/org/opendc/common/util/PacerTest.kt @@ -20,7 +20,7 @@ * SOFTWARE. */ -package org.opendc.utils +package org.opendc.common.util import kotlinx.coroutines.delay import org.junit.jupiter.api.Assertions.* diff --git a/opendc-utils/src/test/kotlin/org/opendc/utils/TimerSchedulerTest.kt b/opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.kt index 101a6546..89b0cbe9 100644 --- a/opendc-utils/src/test/kotlin/org/opendc/utils/TimerSchedulerTest.kt +++ b/opendc-common/src/test/kotlin/org/opendc/common/util/TimerSchedulerTest.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 @@ -20,7 +20,7 @@ * SOFTWARE. */ -package org.opendc.utils +package org.opendc.common.util import kotlinx.coroutines.ExperimentalCoroutinesApi import org.junit.jupiter.api.Assertions.* diff --git a/opendc-compute/opendc-compute-service/build.gradle.kts b/opendc-compute/opendc-compute-service/build.gradle.kts index 33cafc45..b609b147 100644 --- a/opendc-compute/opendc-compute-service/build.gradle.kts +++ b/opendc-compute/opendc-compute-service/build.gradle.kts @@ -33,7 +33,7 @@ dependencies { api(platform(projects.opendcPlatform)) api(projects.opendcCompute.opendcComputeApi) api(projects.opendcTelemetry.opendcTelemetryApi) - implementation(projects.opendcUtils) + implementation(projects.opendcCommon) implementation(libs.kotlin.logging) implementation(libs.opentelemetry.semconv) diff --git a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ComputeServiceImpl.kt b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ComputeServiceImpl.kt index 6df3c4f9..144b6573 100644 --- a/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ComputeServiceImpl.kt +++ b/opendc-compute/opendc-compute-service/src/main/kotlin/org/opendc/compute/service/internal/ComputeServiceImpl.kt @@ -29,13 +29,13 @@ import io.opentelemetry.api.metrics.MeterProvider import io.opentelemetry.api.metrics.ObservableLongMeasurement import kotlinx.coroutines.* import mu.KotlinLogging +import org.opendc.common.util.Pacer import org.opendc.compute.api.* import org.opendc.compute.service.ComputeService import org.opendc.compute.service.driver.Host import org.opendc.compute.service.driver.HostListener import org.opendc.compute.service.driver.HostState import org.opendc.compute.service.scheduler.ComputeScheduler -import org.opendc.utils.Pacer import java.time.Clock import java.time.Duration import java.util.* diff --git a/opendc-compute/opendc-compute-simulator/build.gradle.kts b/opendc-compute/opendc-compute-simulator/build.gradle.kts index aaf69f78..686d9ca1 100644 --- a/opendc-compute/opendc-compute-simulator/build.gradle.kts +++ b/opendc-compute/opendc-compute-simulator/build.gradle.kts @@ -34,7 +34,7 @@ dependencies { api(projects.opendcCompute.opendcComputeService) api(projects.opendcSimulator.opendcSimulatorCompute) api(libs.commons.math3) - implementation(projects.opendcUtils) + implementation(projects.opendcCommon) implementation(libs.opentelemetry.semconv) implementation(libs.kotlin.logging) diff --git a/opendc-experiments/opendc-experiments-tf20/build.gradle.kts b/opendc-experiments/opendc-experiments-tf20/build.gradle.kts index 882c4894..75381e1f 100644 --- a/opendc-experiments/opendc-experiments-tf20/build.gradle.kts +++ b/opendc-experiments/opendc-experiments-tf20/build.gradle.kts @@ -34,11 +34,11 @@ dependencies { implementation(projects.opendcSimulator.opendcSimulatorCore) implementation(projects.opendcSimulator.opendcSimulatorCompute) implementation(projects.opendcTelemetry.opendcTelemetrySdk) - implementation(projects.opendcUtils) + implementation(projects.opendcCommon) implementation(libs.kotlin.logging) implementation(libs.jackson.module.kotlin) { exclude(group = "org.jetbrains.kotlin", module = "kotlin-reflect") } - implementation("org.jetbrains.kotlin:kotlin-reflect:1.5.30") + implementation("org.jetbrains.kotlin:kotlin-reflect:1.6.10") } diff --git a/opendc-faas/opendc-faas-service/build.gradle.kts b/opendc-faas/opendc-faas-service/build.gradle.kts index 6f4fcc9b..95b171b9 100644 --- a/opendc-faas/opendc-faas-service/build.gradle.kts +++ b/opendc-faas/opendc-faas-service/build.gradle.kts @@ -33,7 +33,7 @@ dependencies { api(platform(projects.opendcPlatform)) api(projects.opendcFaas.opendcFaasApi) api(projects.opendcTelemetry.opendcTelemetryApi) - implementation(projects.opendcUtils) + implementation(projects.opendcCommon) implementation(libs.kotlin.logging) implementation(libs.opentelemetry.semconv) diff --git a/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/autoscaler/FunctionTerminationPolicyFixed.kt b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/autoscaler/FunctionTerminationPolicyFixed.kt index 63dbadc7..d579ad0c 100644 --- a/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/autoscaler/FunctionTerminationPolicyFixed.kt +++ b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/autoscaler/FunctionTerminationPolicyFixed.kt @@ -22,9 +22,9 @@ package org.opendc.faas.service.autoscaler +import org.opendc.common.util.TimerScheduler import org.opendc.faas.service.deployer.FunctionInstance import org.opendc.faas.service.deployer.FunctionInstanceState -import org.opendc.utils.TimerScheduler import java.time.Clock import java.time.Duration import kotlin.coroutines.CoroutineContext diff --git a/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/internal/FaaSServiceImpl.kt b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/internal/FaaSServiceImpl.kt index 82032718..1526be9d 100644 --- a/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/internal/FaaSServiceImpl.kt +++ b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/internal/FaaSServiceImpl.kt @@ -27,6 +27,7 @@ import io.opentelemetry.api.metrics.MeterProvider import kotlinx.coroutines.* import kotlinx.coroutines.intrinsics.startCoroutineCancellable import mu.KotlinLogging +import org.opendc.common.util.Pacer import org.opendc.faas.api.FaaSClient import org.opendc.faas.api.FaaSFunction import org.opendc.faas.service.FaaSService @@ -37,7 +38,6 @@ 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.Pacer import java.lang.IllegalStateException import java.time.Clock import java.util.* diff --git a/opendc-workflow/opendc-workflow-service/build.gradle.kts b/opendc-workflow/opendc-workflow-service/build.gradle.kts index 4d8b7d7f..8f082e2f 100644 --- a/opendc-workflow/opendc-workflow-service/build.gradle.kts +++ b/opendc-workflow/opendc-workflow-service/build.gradle.kts @@ -34,7 +34,7 @@ dependencies { api(projects.opendcWorkflow.opendcWorkflowApi) api(projects.opendcCompute.opendcComputeApi) api(projects.opendcTelemetry.opendcTelemetryApi) - implementation(projects.opendcUtils) + implementation(projects.opendcCommon) implementation(libs.kotlin.logging) testImplementation(projects.opendcWorkflow.opendcWorkflowWorkload) diff --git a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/internal/WorkflowServiceImpl.kt b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/internal/WorkflowServiceImpl.kt index cb4bfd45..cdaec021 100644 --- a/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/internal/WorkflowServiceImpl.kt +++ b/opendc-workflow/opendc-workflow-service/src/main/kotlin/org/opendc/workflow/service/internal/WorkflowServiceImpl.kt @@ -25,8 +25,8 @@ package org.opendc.workflow.service.internal import io.opentelemetry.api.metrics.Meter import io.opentelemetry.api.metrics.MeterProvider import kotlinx.coroutines.* +import org.opendc.common.util.Pacer import org.opendc.compute.api.* -import org.opendc.utils.Pacer import org.opendc.workflow.api.Job import org.opendc.workflow.api.WORKFLOW_TASK_CORES import org.opendc.workflow.service.* diff --git a/settings.gradle.kts b/settings.gradle.kts index 170a687d..f388a385 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -22,6 +22,7 @@ rootProject.name = "opendc" include(":opendc-platform") +include(":opendc-common") include(":opendc-compute:opendc-compute-api") include(":opendc-compute:opendc-compute-service") include(":opendc-compute:opendc-compute-simulator") @@ -60,7 +61,6 @@ include(":opendc-harness:opendc-harness-api") include(":opendc-harness:opendc-harness-engine") include(":opendc-harness:opendc-harness-cli") include(":opendc-harness:opendc-harness-junit5") -include(":opendc-utils") enableFeaturePreview("VERSION_CATALOGS") enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS") |
