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 @@ -53,3 +53,10 @@ experiments:
runtime: urunc
snapshotter: overlayfs

network:
workloads:
default:
image: networkstatic/iperf3:latest
other:
- image: docker.io/jimjuniorb/iperf3-urunc:0.3
runtime: urunc
22 changes: 22 additions & 0 deletions images/iperf3-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: networkstatic/iperf3:latest
type: raw
include:
- from: harbor.nbfc.io/nubificus/urunit:latest
source: /urunit
destination: /urunit

kernel:
from: local
path: bzImage


entrypoint: ["/urunit", "/usr/bin/iperf3"]
45 changes: 29 additions & 16 deletions internal/cli/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
harnessruntime "github.com/urunc-dev/evaluation_suite/internal/runtime"
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"
runtimeStorage "github.com/urunc-dev/evaluation_suite/internal/runtime/storage"
)

Expand Down Expand Up @@ -62,6 +63,8 @@ func NewRunCommand() *cobra.Command {
return err
}

var adapterFactories []orchestrator.AdapterFactory

containerdClient, err := containerd.New("/run/containerd/containerd.sock")
if err != nil {
return err
Expand All @@ -70,27 +73,28 @@ func NewRunCommand() *cobra.Command {

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

lifecycleAdapterFactory := func(trial plan.Trial) (harnessruntime.Adapter, error) {
return runtimeLifecycle.NewAdapter(containerdClient, &containerdNamespace), nil
}

storageAdapterFactory := func(trial plan.Trial) (harnessruntime.Adapter, error) {
return runtimeStorage.NewAdapter(containerdClient, &containerdNamespace), nil
}

httpReadinessAdapterFactory := func(trial plan.Trial) (harnessruntime.Adapter, error) {
return runtimeHTTPReadiness.NewAdapter(), nil
}

orch := orchestrator.New(
lifecycleAdapterFactory,
storageAdapterFactory,
httpReadinessAdapterFactory,
// append the adapters for different experiments
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
},
func(trial plan.Trial) (harnessruntime.Adapter, error) {
return runtimeNetwork.NewAdapter(), nil
},
func(trial plan.Trial) (harnessruntime.Adapter, error) {
return runtimeHTTPReadiness.NewAdapter(), nil
},
)

orch := orchestrator.New(adapterFactories...)

result, err := orch.Run(cmd.Context(), p, orchestrator.Options{
RunID: runID,
})

if err != nil {
return err
}
Expand Down Expand Up @@ -157,3 +161,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