From 52d35cd82905612f0ef9f7b7d88611300fb48ebe Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Fri, 18 Feb 2022 14:08:18 +0100 Subject: 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. --- opendc-compute/opendc-compute-simulator/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'opendc-compute/opendc-compute-simulator') 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) -- cgit v1.2.3 From 77aaf078650c054ccbaf5f46a71ab218390a571e Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Fri, 18 Feb 2022 14:53:12 +0100 Subject: build: Remove opendc-platform module This change removes the opendc-platform module from the project. This module represented a Java platform which was previously used for sharing a set of dependency versions between subprojects. However, with the version catalogue that was added by Gradle, we currently do not use the platform anymore. --- opendc-compute/opendc-compute-simulator/build.gradle.kts | 1 - 1 file changed, 1 deletion(-) (limited to 'opendc-compute/opendc-compute-simulator') diff --git a/opendc-compute/opendc-compute-simulator/build.gradle.kts b/opendc-compute/opendc-compute-simulator/build.gradle.kts index 686d9ca1..9a8cbfcc 100644 --- a/opendc-compute/opendc-compute-simulator/build.gradle.kts +++ b/opendc-compute/opendc-compute-simulator/build.gradle.kts @@ -30,7 +30,6 @@ plugins { } dependencies { - api(platform(projects.opendcPlatform)) api(projects.opendcCompute.opendcComputeService) api(projects.opendcSimulator.opendcSimulatorCompute) api(libs.commons.math3) -- cgit v1.2.3 From c82b1725cc606769084155d6c4fba982cd320c41 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Fri, 18 Feb 2022 14:59:54 +0100 Subject: fix(compute): Disallow duplicate UIDs for SimHost This change fixes an issue with the ComputeServiceHelper where it allowed users to register multiple SimHost objects with the same UID. See this issue for more information: https://github.com/atlarge-research/opendc/issues/51 --- .../src/main/kotlin/org/opendc/compute/simulator/SimHost.kt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'opendc-compute/opendc-compute-simulator') diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt index 95921e8b..43f33f27 100644 --- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt +++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt @@ -249,6 +249,12 @@ public class SimHost( machine.cancel() } + override fun hashCode(): Int = uid.hashCode() + + override fun equals(other: Any?): Boolean { + return other is SimHost && uid == other.uid + } + override fun toString(): String = "SimHost[uid=$uid,name=$name,model=$model]" public suspend fun fail() { -- cgit v1.2.3