Skip to content

Commit f58fda9

Browse files
authored
Merge pull request #3432 from crosbymichael/stress-size
Add new shims for checking binary sizes and concurrent exec
2 parents 4005979 + 1945e26 commit f58fda9

3 files changed

Lines changed: 18 additions & 12 deletions

File tree

cmd/containerd-stress/exec_worker.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package main
1818

1919
import (
2020
"context"
21+
"fmt"
2122
"strings"
2223
"syscall"
2324
"time"
@@ -38,8 +39,9 @@ func (w *execWorker) exec(ctx, tctx context.Context) {
3839
w.wg.Done()
3940
logrus.Infof("worker %d finished", w.id)
4041
}()
41-
c, err := w.client.NewContainer(ctx, "exec-container",
42-
containerd.WithNewSnapshot("exec-container", w.image),
42+
id := fmt.Sprintf("exec-container-%d", w.id)
43+
c, err := w.client.NewContainer(ctx, id,
44+
containerd.WithNewSnapshot(id, w.image),
4345
containerd.WithNewSpec(oci.WithImageConfig(w.image), oci.WithUsername("games"), oci.WithProcessArgs("sleep", "30d")),
4446
)
4547
if err != nil {

cmd/containerd-stress/main.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -257,17 +257,19 @@ func test(c config) error {
257257
}
258258
var exec *execWorker
259259
if c.Exec {
260-
wg.Add(1)
261-
exec = &execWorker{
262-
worker: worker{
263-
id: c.Concurrency,
264-
wg: &wg,
265-
image: image,
266-
client: client,
267-
commit: v.Revision,
268-
},
260+
for i := c.Concurrency; i < c.Concurrency+c.Concurrency; i++ {
261+
wg.Add(1)
262+
exec = &execWorker{
263+
worker: worker{
264+
id: i,
265+
wg: &wg,
266+
image: image,
267+
client: client,
268+
commit: v.Revision,
269+
},
270+
}
271+
go exec.exec(ctx, tctx)
269272
}
270-
go exec.exec(ctx, tctx)
271273
}
272274

273275
// start the timer and run the worker

cmd/containerd-stress/size.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ var binaries = []string{
2727
"ctr",
2828
"containerd",
2929
"containerd-shim",
30+
"containerd-shim-runc-v1",
31+
"containerd-shim-runc-v2",
3032
}
3133

3234
// checkBinarySizes checks and reports the binary sizes for the containerd compiled binaries to prometheus

0 commit comments

Comments
 (0)