Skip to content
Open
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ harness

# linux image

images/fio-urunc/bzImage
images/*-urunc/bzImage


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

network:
workloads:
default:
image: networkstatic/iperf3:latest
other:
- image: docker.io/jimjuniorb/iperf3-urunc:0.2
runtime: urunc
18 changes: 18 additions & 0 deletions images/iperf3-urunc/bunnyfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#syntax=harbor.nbfc.io/nubificus/bunny:latest
version: v0.1

platforms:
framework: linux
monitor: qemu
architecture: x86

rootfs:
from: networkstatic/iperf3:latest
type: raw

kernel:
from: local
path: bzImage


entrypoint: ["/usr/bin/iperf3"]
46 changes: 32 additions & 14 deletions internal/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/urunc-dev/evaluation_suite/internal/plan"
harnessruntime "github.com/urunc-dev/evaluation_suite/internal/runtime"
runtimeLifecycle "github.com/urunc-dev/evaluation_suite/internal/runtime/lifecycle"
runtimeNetwork "github.com/urunc-dev/evaluation_suite/internal/runtime/network"
runtimeStorage "github.com/urunc-dev/evaluation_suite/internal/runtime/storage"
)

Expand Down Expand Up @@ -61,23 +62,31 @@ func NewRunCommand() *cobra.Command {
return err
}

containerdClient, err := containerd.New("/run/containerd/containerd.sock")
if err != nil {
return err
}
defer containerdClient.Close()

containerdNamespace := namespaces.WithNamespace(cmd.Context(), "default")

lifecycleAdapterFactory := func(trial plan.Trial) (harnessruntime.Adapter, error) {
return runtimeLifecycle.NewAdapter(containerdClient, &containerdNamespace), nil
var adapterFactories []orchestrator.AdapterFactory
if planHasExperiment(p, "lifecycle") || planHasExperiment(p, "storage") {
containerdClient, err := containerd.New("/run/containerd/containerd.sock")
if err != nil {
return err
}
defer containerdClient.Close()

containerdNamespace := namespaces.WithNamespace(cmd.Context(), "default")
adapterFactories = append(adapterFactories,
func(trial plan.Trial) (harnessruntime.Adapter, error) {
return runtimeLifecycle.NewAdapter(containerdClient, &containerdNamespace), nil
},
func(trial plan.Trial) (harnessruntime.Adapter, error) {
return runtimeStorage.NewAdapter(containerdClient, &containerdNamespace), nil
},
)
}

storageAdapterFactory := func(trial plan.Trial) (harnessruntime.Adapter, error) {
return runtimeStorage.NewAdapter(containerdClient, &containerdNamespace), nil
if planHasExperiment(p, "network") {
adapterFactories = append(adapterFactories, func(trial plan.Trial) (harnessruntime.Adapter, error) {
return runtimeNetwork.NewAdapter(), nil
})
}

orch := orchestrator.New(lifecycleAdapterFactory, storageAdapterFactory)
orch := orchestrator.New(adapterFactories...)

result, err := orch.Run(cmd.Context(), p, orchestrator.Options{
RunID: runID,
Expand Down Expand Up @@ -148,3 +157,12 @@ func NewRunCommand() *cobra.Command {

return cmd
}

func planHasExperiment(p *plan.Plan, name string) bool {
for _, trial := range p.Trials {
if trial.ExperimentName == name {
return true
}
}
return false
}
9 changes: 9 additions & 0 deletions internal/doctor/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,22 @@ func Run(
)
}

if hasNetworkExperiment(m) {
checkTool(report, "nerdctl", true)
}

checkHostPorts(report, m)
checkHostPathVolumes(report, m)
checkEnvironmentVisibility(ctx, report)

return report, nil
}

func hasNetworkExperiment(m *manifest.Manifest) bool {
_, ok := m.Experiments["network"]
return ok
}

func checkManifest(report *Report, m *manifest.Manifest) {
if err := manifest.Validate(m); err != nil {
report.Add(StatusFail, "manifest", err.Error())
Expand Down
Loading