Skip to content

Commit

Permalink
add workload param to bench and fix errors
Browse files Browse the repository at this point in the history
Signed-off-by: Plamen Petrov <plamb0brt@gmail.com>
  • Loading branch information
plamenmpetrov committed Nov 26, 2020
1 parent bad6f38 commit 1ae1698
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 14 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,23 @@ test-skip:

bench:
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchServe -args -iter 1 $(WITHSNAPSHOTS) -benchDirTest configBase -metricsTest && sudo rm -rf configBase
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchServe -args -iter 1 $(WITHSNAPSHOTS) -benchDirTest configBase -metricsTest -funcName helloworld && sudo rm -rf configBase
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchServe -args -iter 1 $(WITHSNAPSHOTS) $(WITHUPF) -benchDirTest configREAP -metricsTest && sudo rm -rf configREAP
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchServe -args -iter 1 $(WITHSNAPSHOTS) $(WITHUPF) -benchDirTest configREAP -metricsTest -funcName helloworld && sudo rm -rf configREAP
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchServe -args -iter 1 $(WITHSNAPSHOTS) $(WITHLAZY) -benchDirTest configLazy -metricsTest && sudo rm -rf configLazy
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchServe -args -iter 1 $(WITHSNAPSHOTS) $(WITHLAZY) -benchDirTest configLazy -metricsTest -funcName helloworld && sudo rm -rf configLazy
./scripts/clean_fcctr.sh

sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchParallelServe -args $(WITHSNAPSHOTS) -benchDirTest configBase -metricsTest && sudo rm -rf configBase
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchParallelServe -args $(WITHSNAPSHOTS) -benchDirTest configBase -metricsTest -funcName helloworld && sudo rm -rf configBase
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchParallelServe -args $(WITHSNAPSHOTS) $(WITHUPF) -benchDirTest configREAP -metricsTest && sudo rm -rf configREAP
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchParallelServe -args $(WITHSNAPSHOTS) $(WITHUPF) -benchDirTest configREAP -metricsTest -funcName helloworld && sudo rm -rf configREAP
./scripts/clean_fcctr.sh
sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.err &
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchParallelServe -args $(WITHSNAPSHOTS) $(WITHLAZY) -benchDirTest configLazy -metricsTest && sudo rm -rf configLazy
sudo env "PATH=$(PATH)" go test $(EXTRAGOARGS) -run TestBenchParallelServe -args $(WITHSNAPSHOTS) $(WITHLAZY) -benchDirTest configLazy -metricsTest -funcName helloworld && sudo rm -rf configLazy
./scripts/clean_fcctr.sh

sudo mkdir -m777 -p $(CTRDLOGDIR) && sudo env "PATH=$(PATH)" /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.out 2>$(CTRDLOGDIR)/fccd_orch_noupf_log_bench.err &
Expand Down
2 changes: 1 addition & 1 deletion ctriface/iface.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import (
_ "github.com/davecgh/go-spew/spew" //tmp
)

// StartVMResponse is the reponse return by StartVM
// StartVMResponse is the response returned by StartVM
// TODO: Integrate response with non-cri API
type StartVMResponse struct {
// GuestIP is the IP of the guest MicroVM
Expand Down
2 changes: 1 addition & 1 deletion ctriface/manual_cleanup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

func TestSnapLoad(t *testing.T) {
// Need to clean up manually after this test because StopVM does not
// work for stopping machiens which are loaded from snapshots yet
// work for stopping machines which are loaded from snapshots yet
log.SetFormatter(&log.TextFormatter{
TimestampFormat: ctrdlog.RFC3339NanoFixed,
FullTimestamp: true,
Expand Down
2 changes: 1 addition & 1 deletion fccd-orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ import (

ctrdlog "github.com/containerd/containerd/log"
log "github.com/sirupsen/logrus"
fccdcri "github.com/ustiugov/fccd-orchestrator/cri"
ctriface "github.com/ustiugov/fccd-orchestrator/ctriface"
hpb "github.com/ustiugov/fccd-orchestrator/helloworld"
fccdcri "github.com/ustiugov/fccd-orchestrator/cri"
pb "github.com/ustiugov/fccd-orchestrator/proto"
"google.golang.org/grpc"
)
Expand Down
5 changes: 2 additions & 3 deletions functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func NewFunction(fID, imageName string, Stats *Stats, servedTh uint64, isToPin b
// 2. Function (that is not pinned) can serve only up to servedTh requests (controlled by a WeightedSemaphore)
// a. The last goroutine needs to trigger the function's instance shutdown, then reset the semaphore,
// allowing new goroutines to serve their requests.
// b. The last goroutine is determined by the atomic counter: the goroutine wih syncID==0 shuts down
// b. The last goroutine is determined by the atomic counter: the goroutine with syncID==0 shuts down
// the instance.
// c. Instance shutdown is performed asynchronously because all instances have unique IDs.
func (f *Function) Serve(ctx context.Context, fID, imageName, reqPayload string) (*hpb.FwdHelloResp, *metrics.Metric, error) {
Expand Down Expand Up @@ -369,7 +369,7 @@ func (f *Function) AddInstance() *metrics.Metric {
tStart := time.Now()
funcClient, err := f.getFuncClient()
if metr != nil {
metr.MetricMap[metrics.ConnectFuncClient] = metrics.ToUS(time.Since(tStart))
metr.MetricMap[metrics.ConnectFuncClient] = metrics.ToUS(time.Since(tStart))
}
if err != nil {
logger.Panic("Failed to acquire func client")
Expand Down Expand Up @@ -613,4 +613,3 @@ func timeoutDialer(address string, timeout time.Duration) (net.Conn, error) {
return nil, errors.Errorf("dial %s: timeout", address)
}
}

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/sirupsen/logrus v1.7.0
github.com/stretchr/testify v1.6.1
github.com/ustiugov/fccd-orchestrator/cri v0.0.0-20201120135927-438ab32ec4cf
github.com/ustiugov/fccd-orchestrator/ctriface v0.0.0-20201125164330-518d167f276c
github.com/ustiugov/fccd-orchestrator/ctriface v0.0.0-20201126100131-73f5cdbb95c2
github.com/ustiugov/fccd-orchestrator/helloworld v0.0.0-20201120135927-438ab32ec4cf
github.com/ustiugov/fccd-orchestrator/metrics v0.0.0-20201125164330-518d167f276c
github.com/ustiugov/fccd-orchestrator/proto v0.0.0-20201120135927-438ab32ec4cf
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,8 @@ github.com/ustiugov/fccd-orchestrator/ctriface v0.0.0-20201125102721-6fa5429c84a
github.com/ustiugov/fccd-orchestrator/ctriface v0.0.0-20201125102721-6fa5429c84a2/go.mod h1:LJCI4BH2gNParx0LYfWc6mtgjV1ky5QQfTs64MpzulI=
github.com/ustiugov/fccd-orchestrator/ctriface v0.0.0-20201125164330-518d167f276c h1:AstorD8uiAXq0DEXcEbHGi69XYm3gXsup7o43VqDMpc=
github.com/ustiugov/fccd-orchestrator/ctriface v0.0.0-20201125164330-518d167f276c/go.mod h1:rVbfSxjHx0lcVJziyP9XA/QZLq3oDCnnuzI47vCQKI0=
github.com/ustiugov/fccd-orchestrator/ctriface v0.0.0-20201126100131-73f5cdbb95c2 h1:FoCJ4+Tsr0MMsNrXSG96ecSr9hNAdwz81WO1KX3seX0=
github.com/ustiugov/fccd-orchestrator/ctriface v0.0.0-20201126100131-73f5cdbb95c2/go.mod h1:rVbfSxjHx0lcVJziyP9XA/QZLq3oDCnnuzI47vCQKI0=
github.com/ustiugov/fccd-orchestrator/helloworld v0.0.0-20200714124456-347054937ceb/go.mod h1:5dhCs/XynpQoQcrhd/YgUBjGahhNpTknQUcC1kHRCaA=
github.com/ustiugov/fccd-orchestrator/helloworld v0.0.0-20200717125634-528c6e9f9cc9/go.mod h1:5dhCs/XynpQoQcrhd/YgUBjGahhNpTknQUcC1kHRCaA=
github.com/ustiugov/fccd-orchestrator/helloworld v0.0.0-20200803195925-0629e1cf4599 h1:I2KBmkOfR2BmRp8h2VYomP+YMNGZC4fUmKkgfMS/xq0=
Expand Down
2 changes: 1 addition & 1 deletion metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const (
// ConnectFuncClient Time it takes to reconnect function client
ConnectFuncClient = "ConnectFuncClient"

// Full Used when there is no breakdown
// LoadVMM Name of LoadVMM metric
LoadVMM = "LoadVMM"

// AddInstance Time to add instance - load snap or start vm
Expand Down

0 comments on commit 1ae1698

Please sign in to comment.