summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDante Niewenhuis <d.niewenhuis@hotmail.com>2026-06-15 14:29:00 +0200
committerGitHub <noreply@github.com>2026-06-15 14:29:00 +0200
commitcd5345acd7e7e15999224ac5983cc774ef1bc173 (patch)
tree2c7e527ded687972b81b20d5a09a5c8a727d1c69
parent01e809146e8f19f58faf3a808ea994107730738d (diff)
Updated github actions to comment a performance benchmark when creating a PR (#428)
* Added a 10s delay to test Ci benchmarking * Made minor changes to the benchmark actions * Updated benchmark to save to atlarge repo * small change to delay * Updated the benchmark-comment to pull the baseline results from the correct location * Removed Delay
-rw-r--r--.github/workflows/benchmark-comment.yml13
-rw-r--r--.github/workflows/benchmark.yml12
-rw-r--r--opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ScenarioReplayer.kt18
-rw-r--r--opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ScenarioRunner.kt7
4 files changed, 18 insertions, 32 deletions
diff --git a/.github/workflows/benchmark-comment.yml b/.github/workflows/benchmark-comment.yml
index 7f67f0f3..760804d2 100644
--- a/.github/workflows/benchmark-comment.yml
+++ b/.github/workflows/benchmark-comment.yml
@@ -45,15 +45,17 @@ jobs:
- name: Fetch baseline from benchmark-data release
run: |
- gh release download benchmark-data --asset benchmark-history.json \
- --output baseline.json 2>/dev/null \
+ gh release download benchmark-data \
+ --repo atlarge-research/opendc \
+ -A benchmark-history.json \
+ -O baseline.json 2>/dev/null \
|| echo "[]" > baseline.json
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate comparison comment
run: |
- python .github/scripts/compare_benchmarks.py \
+ python3 .github/scripts/compare_benchmarks.py \
current-results/results.json \
baseline.json \
> comment.md
@@ -68,6 +70,9 @@ jobs:
const fullBody = marker + '\n' + body;
const prNumber = parseInt(fs.readFileSync('pr-number.txt', 'utf8').trim());
+ core.info(`Posting comment to ${context.repo.owner}/${context.repo.repo} PR #${prNumber}`);
+ core.info(`Comment body length: ${body.length} chars`);
+
const { data: comments } = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
@@ -76,6 +81,7 @@ jobs:
const existing = comments.find(c => c.body.includes(marker));
if (existing) {
+ core.info(`Updating existing comment ${existing.id}`);
await github.rest.issues.updateComment({
owner: context.repo.owner,
repo: context.repo.repo,
@@ -83,6 +89,7 @@ jobs:
body: fullBody,
});
} else {
+ core.info('Creating new comment');
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml
index d76c457c..3e5407bb 100644
--- a/.github/workflows/benchmark.yml
+++ b/.github/workflows/benchmark.yml
@@ -79,7 +79,9 @@ jobs:
- name: Download existing benchmark history
run: |
- gh release download benchmark-data --asset benchmark-history.json \
+ gh release download benchmark-data \
+ --repo atlarge-research/opendc \
+ --pattern benchmark-history.json \
--output existing-history.json 2>/dev/null \
|| echo "[]" > existing-history.json
env:
@@ -87,7 +89,7 @@ jobs:
- name: Update history
run: |
- python .github/scripts/update_history.py \
+ python3 .github/scripts/update_history.py \
current-results/results.json \
existing-history.json \
updated-history.json \
@@ -95,9 +97,11 @@ jobs:
- name: Upload to release
run: |
- gh release upload benchmark-data updated-history.json \
- --name benchmark-history.json --clobber 2>/dev/null \
+ gh release upload benchmark-data updated-history.json#benchmark-history.json \
+ --repo atlarge-research/opendc \
+ --clobber 2>/dev/null \
|| gh release create benchmark-data \
+ --repo atlarge-research/opendc \
--title "Benchmark Data" \
--notes "Permanent storage for benchmark history. Managed automatically by CI." \
updated-history.json#benchmark-history.json
diff --git a/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ScenarioReplayer.kt b/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ScenarioReplayer.kt
index ec4d30ce..78e75263 100644
--- a/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ScenarioReplayer.kt
+++ b/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ScenarioReplayer.kt
@@ -103,9 +103,6 @@ public suspend fun ComputeService.replay(
var simulationOffset = Long.MIN_VALUE
-// val numTasks = trace.size
-// var counter = 0
-
for (serviceTask in trace.sortedBy { it.submittedAt }) {
val now = clock.millis()
val start = serviceTask.submittedAt
@@ -121,17 +118,6 @@ public suspend fun ComputeService.replay(
serviceTask.deadline -= simulationOffset
}
-// if (counter % 100000 == 0) {
-// val endTimer = System.currentTimeMillis()
-//
-// println("Submitted $counter / $numTasks")
-// println("Finished ${String.format("%.2f", (counter.toDouble() / numTasks) * 100)}% of task submissions")
-// println("Simulation has been running for: ${(endTimer - startTimer) / 1000} s")
-// println("Simulation time is time: ${now / 1000 / 60 / 60} hours\n")
-// }
-
-// counter++
-
launch {
val task =
client.newTask(
@@ -146,10 +132,6 @@ public suspend fun ComputeService.replay(
taskWatcher.wait()
}
}
-
-// println("All tasks submitted, waiting for completion...")
-// val endTimer = System.currentTimeMillis()
-// println("Simulation has been running for: ${(endTimer - startTimer) / 1000} s")
}
yield()
} finally {
diff --git a/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ScenarioRunner.kt b/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ScenarioRunner.kt
index 68d03fcc..b07a50ae 100644
--- a/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ScenarioRunner.kt
+++ b/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ScenarioRunner.kt
@@ -106,13 +106,6 @@ public fun runScenario(
val startTimeLong = workload.minOf { it.submittedAt }
val startTime = Duration.ofMillis(startTimeLong)
-// println("LOADED WORKLOADDDD ${scenario.workloadSpec.name}")
-// println("LOADED WORKLOADDDD ${scenario.workloadSpec.name}")
-// println("LOADED WORKLOADDDD ${scenario.workloadSpec.name}")
-// println("LOADED WORKLOADDDD ${scenario.workloadSpec.name}")
-//
-// Thread.sleep(10000000)
-
val topology = clusterTopology(scenario.topologySpec.pathToFile)
val numHosts = topology.sumOf { it.hostSpecs.size }