Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Verify PR Build

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.26.4"

- name: Download Go modules
run: go mod download

- name: Build Conveyor
run: |
go build -o harness cmd/harness/main.go
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ harness

# linux image

images/*-urunc/bzImage

images/*/bzImage


# python cache
Expand Down
17 changes: 17 additions & 0 deletions experiment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,27 @@ experiments:
runtime: urunc
snapshotter: overlayfs


network:
workloads:
default:
image: networkstatic/iperf3:latest
other:
- image: docker.io/jimjuniorb/iperf3-urunc:0.3
runtime: urunc

cpu:
workloads:
default:
image: jimjuniorb/stress-ng-benchmark:0.1
cpu: 1
cpuMethod: matrixprod
timeout: 30s
metricsBrief: true
other:
- image: jimjuniorb/stress-ng-urunc:0.7
cpu: 1
cpuMethod: matrixprod
timeout: 30s
metricsBrief: true
runtime: urunc
22 changes: 22 additions & 0 deletions images/stress-ng-urunc/bunnyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#syntax=harbor.nbfc.io/nubificus/bunny:latest
version: v0.1

platforms:
framework: linux
monitor: qemu
architecture: x86

rootfs:
from: jimjuniorb/stress-ng-benchmark:0.1
type: raw
include:
- from: harbor.nbfc.io/nubificus/urunit:latest
source: /urunit
destination: /urunit

kernel:
from: local
path: bzImage


entrypoint: ["/urunit", "/usr/local/bin/stress-ng-wrapper"]
14 changes: 14 additions & 0 deletions images/stress-ng/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM ubuntu:24.04

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
stress-ng \
&& rm -rf /var/lib/apt/lists/*

COPY entrypoint.sh /usr/local/bin/stress-ng-wrapper

RUN chmod +x /usr/local/bin/stress-ng-wrapper

ENTRYPOINT ["/usr/local/bin/stress-ng-wrapper"]
20 changes: 20 additions & 0 deletions images/stress-ng/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

set -u

RESULT_FILE="$(mktemp /tmp/stress-ng-result.XXXXXX.yaml)"

cleanup() {
rm -f "$RESULT_FILE"
}

trap cleanup EXIT INT TERM

stress-ng "$@" --yaml "$RESULT_FILE" >&2
status=$?

if [ -s "$RESULT_FILE" ]; then
cat "$RESULT_FILE"
fi

exit "$status"
4 changes: 4 additions & 0 deletions internal/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/urunc-dev/evaluation_suite/internal/orchestrator"
"github.com/urunc-dev/evaluation_suite/internal/plan"
harnessruntime "github.com/urunc-dev/evaluation_suite/internal/runtime"
runtimeCPU "github.com/urunc-dev/evaluation_suite/internal/runtime/cpu"
runtimeHTTPReadiness "github.com/urunc-dev/evaluation_suite/internal/runtime/httpreadiness"
runtimeLifecycle "github.com/urunc-dev/evaluation_suite/internal/runtime/lifecycle"
runtimeNetwork "github.com/urunc-dev/evaluation_suite/internal/runtime/network"
Expand Down Expand Up @@ -87,6 +88,9 @@ func NewRunCommand() *cobra.Command {
func(trial plan.Trial) (harnessruntime.Adapter, error) {
return runtimeHTTPReadiness.NewAdapter(), nil
},
func(trial plan.Trial) (harnessruntime.Adapter, error) {
return runtimeCPU.NewAdapter(), nil
},
)

orch := orchestrator.New(adapterFactories...)
Expand Down
8 changes: 6 additions & 2 deletions internal/doctor/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func Run(

checkTool(report, "ctr", true)
checkTool(report, "containerd", false)

checkTool(report, "nerdctl", true)
if hasStorageExperiment(m) {
checkTool(report, "fio", false)
report.Add(
Expand Down Expand Up @@ -305,8 +305,12 @@ func checkEnvironmentVisibility(ctx context.Context, report *Report) {
}

func hasStorageExperiment(m *manifest.Manifest) bool {
return hasExperiment(m, "storage")
}

func hasExperiment(m *manifest.Manifest, expected string) bool {
for name := range m.Experiments {
if strings.EqualFold(name, "storage") {
if strings.EqualFold(name, expected) {
return true
}
}
Expand Down
14 changes: 9 additions & 5 deletions internal/manifest/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ type Workloads struct {
}

type Workload struct {
Image string `yaml:"image"`
Runtime string `yaml:"runtime,omitempty"`
Ports *Ports `yaml:"ports,omitempty"`
Snapshotter string `yaml:"snapshotter,omitempty"`
Volumes []Volume `yaml:"volumes,omitempty"`
Image string `yaml:"image"`
Runtime string `yaml:"runtime,omitempty"`
Ports *Ports `yaml:"ports,omitempty"`
Snapshotter string `yaml:"snapshotter,omitempty"`
Volumes []Volume `yaml:"volumes,omitempty"`
CPU int `yaml:"cpu,omitempty"`
CPUMethod string `yaml:"cpuMethod,omitempty"`
Timeout string `yaml:"timeout,omitempty"`
MetricsBrief bool `yaml:"metricsBrief,omitempty"`
}

type Ports struct {
Expand Down
15 changes: 15 additions & 0 deletions internal/manifest/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"strings"
"time"
)

func Validate(m *Manifest) error {
Expand Down Expand Up @@ -67,6 +68,20 @@ func Validate(m *Manifest) error {
errs = append(errs, vpath+".type is required")
}
}

if name == "cpu" {
if w.CPU <= 0 {
errs = append(errs, path+".cpu must be greater than zero")
}
if w.CPUMethod == "" {
errs = append(errs, path+".cpuMethod is required")
}
if w.Timeout == "" {
errs = append(errs, path+".timeout is required")
} else if duration, err := time.ParseDuration(w.Timeout); err != nil || duration <= 0 {
errs = append(errs, path+".timeout must be a positive Go duration such as 30s")
}
}
}

validateWorkload("experiments."+name+".workloads.default", exp.Workloads.Default)
Expand Down
4 changes: 4 additions & 0 deletions internal/plan/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ func buildTrial(
Ports: workload.Ports,
Volumes: workload.Volumes,
Snapshotter: workload.Snapshotter,
CPU: workload.CPU,
CPUMethod: workload.CPUMethod,
Timeout: workload.Timeout,
MetricsBrief: workload.MetricsBrief,
}
}

Expand Down
6 changes: 5 additions & 1 deletion internal/plan/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ type Trial struct {
Image string `json:"image"`
Ports *manifest.Ports `json:"ports,omitempty"`
Volumes []manifest.Volume `json:"volumes,omitempty"`
Snapshotter string `yaml:"snapshotter,omitempty"`
Snapshotter string `json:"snapshotter,omitempty"`
CPU int `json:"cpu,omitempty"`
CPUMethod string `json:"cpuMethod,omitempty"`
Timeout string `json:"timeout,omitempty"`
MetricsBrief bool `json:"metricsBrief,omitempty"`
}
Loading