Skip to content

Commit e22c97d

Browse files
Updated workload schema (#360)
1 parent 0c0cf25 commit e22c97d

File tree

130 files changed

+1824
-9986
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+1824
-9986
lines changed

buildSrc/src/main/kotlin/testing-conventions.gradle.kts

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ plugins {
2525
}
2626

2727
tasks.test {
28+
// val javaVersion = project.defaultVersionCatalog.getVersion("java")
29+
// languageVersion.set(JavaLanguageVersion.of(javaVersion))
2830
useJUnitPlatform()
2931

3032
reports {
@@ -41,27 +43,3 @@ dependencies {
4143
testImplementation(versionCatalog["mockk"])
4244
testRuntimeOnly(versionCatalog["junit.jupiter.engine"])
4345
}
44-
45-
tasks.register<Test>("testsOn18") {
46-
javaLauncher.set(javaToolchains.launcherFor {
47-
languageVersion.set(JavaLanguageVersion.of(18))
48-
})
49-
50-
useJUnitPlatform()
51-
52-
minHeapSize = "512m"
53-
maxHeapSize = "1024m"
54-
jvmArgs = listOf("-XX:MaxMetaspaceSize=512m")
55-
}
56-
57-
tasks.register<Test>("testsOn19") {
58-
javaLauncher.set(javaToolchains.launcherFor {
59-
languageVersion.set(JavaLanguageVersion.of(19))
60-
})
61-
62-
useJUnitPlatform()
63-
64-
minHeapSize = "512m"
65-
maxHeapSize = "1024m"
66-
jvmArgs = listOf("-XX:MaxMetaspaceSize=512m")
67-
}

opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Flavor.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ public interface Flavor : Resource {
4545
/**
4646
* Set of Tasks that need to be finished before this can startAdd commentMore actions
4747
*/
48-
public val dependencies: Set<String>
48+
public val dependencies: Set<Int>
4949

5050
/**
5151
* Set of Tasks that need to be finished before this can startAdd commentMore actions
5252
*/
53-
public val parents: Set<String>
53+
public val parents: Set<Int>
5454

5555
/**
5656
* Set of Tasks that need to be finished before this can startAdd commentMore actions
5757
*/
58-
public val children: Set<String>
58+
public val children: Set<Int>
5959
}

opendc-compute/opendc-compute-api/src/main/kotlin/org/opendc/compute/api/Resource.kt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,14 @@
2222

2323
package org.opendc.compute.api
2424

25-
import java.util.UUID
26-
2725
/**
2826
* A generic resource provided by the OpenDC Compute service.
2927
*/
3028
public interface Resource {
31-
/**
32-
* The unique identifier of the resource.
33-
*/
34-
public val uid: UUID
35-
3629
/**
3730
* The name of the resource.
3831
*/
39-
public val name: String
32+
public val taskId: Int
4033

4134
/**
4235
* The non-identifying metadata attached to the resource.

opendc-compute/opendc-compute-carbon/src/main/kotlin/org/opendc/compute/carbon/CarbonTraceLoader.kt

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ package org.opendc.compute.carbon
2424

2525
import org.opendc.simulator.compute.power.CarbonFragment
2626
import org.opendc.trace.Trace
27-
import org.opendc.trace.conv.CARBON_INTENSITY_TIMESTAMP
28-
import org.opendc.trace.conv.CARBON_INTENSITY_VALUE
29-
import org.opendc.trace.conv.TABLE_CARBON_INTENSITIES
27+
import org.opendc.trace.conv.CARBON_INTENSITY
28+
import org.opendc.trace.conv.CARBON_TIMESTAMP
29+
import org.opendc.trace.conv.TABLE_CARBON
3030
import java.io.File
3131
import java.lang.ref.SoftReference
3232
import java.time.Instant
@@ -35,7 +35,6 @@ import java.util.concurrent.ConcurrentHashMap
3535
/**
3636
* A helper class for loading compute workload traces into memory.
3737
*
38-
* @param baseDir The directory containing the traces.
3938
*/
4039
public class CarbonTraceLoader {
4140
/**
@@ -49,10 +48,10 @@ public class CarbonTraceLoader {
4948
* Read the metadata into a workload.
5049
*/
5150
private fun parseCarbon(trace: Trace): List<CarbonFragment> {
52-
val reader = checkNotNull(trace.getTable(TABLE_CARBON_INTENSITIES)).newReader()
51+
val reader = checkNotNull(trace.getTable(TABLE_CARBON)).newReader()
5352

54-
val startTimeCol = reader.resolve(CARBON_INTENSITY_TIMESTAMP)
55-
val carbonIntensityCol = reader.resolve(CARBON_INTENSITY_VALUE)
53+
val startTimeCol = reader.resolve(CARBON_TIMESTAMP)
54+
val carbonIntensityCol = reader.resolve(CARBON_INTENSITY)
5655

5756
try {
5857
while (reader.nextRow()) {
@@ -75,7 +74,7 @@ public class CarbonTraceLoader {
7574
}
7675

7776
/**
78-
* Load the trace with the specified [name] and [format].
77+
* Load the Carbon Trace at the given path.
7978
*/
8079
public fun get(pathToFile: File): List<CarbonFragment> {
8180
val trace = Trace.open(pathToFile, "carbon")
@@ -97,7 +96,7 @@ public class CarbonTraceLoader {
9796
/**
9897
* The total load of the trace.
9998
*/
100-
public val fragments: MutableList<CarbonFragment> = mutableListOf()
99+
val fragments: MutableList<CarbonFragment> = mutableListOf()
101100

102101
/**
103102
* Add a fragment to the trace.

0 commit comments

Comments
 (0)