Skip to content

feat: add CPU benchmarking support with stress-ng - #6

Merged
cmainas merged 4 commits into
urunc-dev:mainfrom
jim-junior:ft-cpu-bench
Aug 14, 2026
Merged

feat: add CPU benchmarking support with stress-ng#6
cmainas merged 4 commits into
urunc-dev:mainfrom
jim-junior:ft-cpu-bench

Conversation

@jim-junior

@jim-junior jim-junior commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

This PR adds a CPU performance benchmark adapter using stress-ng.

The adapter measures the bogo operation count and time spent in user and kernel spaces when carrying out those ops. It runs and collects theses metrics from stress-ng.

The PR also includes the docker files used to build the custom stress-ng image. These are in images/stress-ng and for the image used in urunc, its located in images/stress-ng-urunc.

Furthermore, new config values have been introduced in the experiment.yml. These are specific to the cpu experiment and are used to customize the stress-ng behaviour. These include the following:

cpu: 1
cpuMethod: matrixprod
timeout: 30s
metricsBrief: true

They all correspond to valid stress-ng configuration flags with the same names.

How It Works

For each benchmark trial, the adapter:

  1. Pulls the runtime-specific stress-ng image.
  2. Starts an stress-ng container and appends
  3. Within the container, the entrypoint has been updated to a custom script that prints out the metrics results in yaml format to the standard output.
  4. Extracts yaml from the command output and transforms it into JSON
  5. Stores the complete stress-ng result in the benchmark output.
  6. Lastly cleans up the containers created by the harness

Remaining tasks (This section will be removed once these tasks are done)

Building a kernel that can support the stress-ng workload for urunc

- Also added new urunc image for stress-ng

Signed-off-by: jim-junior <jimjunior854@gmail.com>
- enable `CONFIG_SYSFS` in kernel image
- add `urunit` to urunc stress-ng image
- update cpu workload image to `0.7` tag

Signed-off-by: jim-junior <jimjunior854@gmail.com>
@cmainas

cmainas commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Hello @jim-junior ,

there are some building issues.

$ go build -o harness cmd/harness/main.go
go: downloading github.com/containerd/containerd v1.7.34
go: downloading github.com/spf13/cobra v1.10.2
go: downloading google.golang.org/grpc v1.80.0
go: downloading github.com/containerd/containerd/api v1.11.1
go: downloading github.com/containerd/typeurl/v2 v2.2.3
go: downloading github.com/moby/sys/signal v0.7.1
go: downloading github.com/opencontainers/runtime-spec v1.1.0
go: downloading github.com/pelletier/go-toml/v2 v2.4.2
go: downloading google.golang.org/genproto/googleapis/rpc v0.0.0-20260406210006-6f92a3bedf2d
go: downloading google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80
go: downloading github.com/spf13/pflag v1.0.9
go: downloading github.com/klauspost/compress v1.18.5
go: downloading github.com/distribution/reference v0.6.0
go: downloading github.com/moby/locker v1.0.1
go: downloading go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.68.0
go: downloading github.com/gogo/protobuf v1.3.2
go: downloading golang.org/x/net v0.55.0
go: downloading github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c
go: downloading github.com/felixge/httpsnoop v1.0.4
go: downloading github.com/cyphar/filepath-securejoin v0.6.0
# github.com/urunc-dev/evaluation_suite/internal/cli
internal/cli/run.go:93:6: syntax error: unexpected newline in argument list; possibly missing comma or )

Can we also add an action that verifies a PR is getting built?

Signed-off-by: jim-junior <jimjunior854@gmail.com>
Signed-off-by: jim-junior <jimjunior854@gmail.com>
@jim-junior

Copy link
Copy Markdown
Collaborator Author

@cmainas

Ive fixed the syntax error and added a github action to always verify if a PR builds.

@cmainas cmainas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jim-junior

@cmainas
cmainas merged commit 2672038 into urunc-dev:main Aug 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants