Merge pull request #3432 from crosbymichael/stress-size

Add new shims for checking binary sizes and concurrent exec
This commit is contained in:
Derek McGowan 2019-07-19 15:38:25 -07:00 committed by GitHub
commit f58fda97ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 12 deletions

View File

@ -18,6 +18,7 @@ package main
import ( import (
"context" "context"
"fmt"
"strings" "strings"
"syscall" "syscall"
"time" "time"
@ -38,8 +39,9 @@ func (w *execWorker) exec(ctx, tctx context.Context) {
w.wg.Done() w.wg.Done()
logrus.Infof("worker %d finished", w.id) logrus.Infof("worker %d finished", w.id)
}() }()
c, err := w.client.NewContainer(ctx, "exec-container", id := fmt.Sprintf("exec-container-%d", w.id)
containerd.WithNewSnapshot("exec-container", w.image), c, err := w.client.NewContainer(ctx, id,
containerd.WithNewSnapshot(id, w.image),
containerd.WithNewSpec(oci.WithImageConfig(w.image), oci.WithUsername("games"), oci.WithProcessArgs("sleep", "30d")), containerd.WithNewSpec(oci.WithImageConfig(w.image), oci.WithUsername("games"), oci.WithProcessArgs("sleep", "30d")),
) )
if err != nil { if err != nil {

View File

@ -257,10 +257,11 @@ func test(c config) error {
} }
var exec *execWorker var exec *execWorker
if c.Exec { if c.Exec {
for i := c.Concurrency; i < c.Concurrency+c.Concurrency; i++ {
wg.Add(1) wg.Add(1)
exec = &execWorker{ exec = &execWorker{
worker: worker{ worker: worker{
id: c.Concurrency, id: i,
wg: &wg, wg: &wg,
image: image, image: image,
client: client, client: client,
@ -269,6 +270,7 @@ func test(c config) error {
} }
go exec.exec(ctx, tctx) go exec.exec(ctx, tctx)
} }
}
// start the timer and run the worker // start the timer and run the worker
r.start() r.start()

View File

@ -27,6 +27,8 @@ var binaries = []string{
"ctr", "ctr",
"containerd", "containerd",
"containerd-shim", "containerd-shim",
"containerd-shim-runc-v1",
"containerd-shim-runc-v2",
} }
// checkBinarySizes checks and reports the binary sizes for the containerd compiled binaries to prometheus // checkBinarySizes checks and reports the binary sizes for the containerd compiled binaries to prometheus