Commit Graph

31 Commits

Author SHA1 Message Date
Alakesh Haloi
0550c32330 containerd-stress: add snapshotter option for stress test to use
containerd-stress utility needs to be able to run with snapshotter
passed by user in cli in order to be able to stress test snapshotters.
This adds a cli option --snapshotter="<snapshotter-name>"

Signed-off-by: Alakesh Haloi <alakeshh@amazon.com>
2021-04-12 20:45:22 +00:00
Alakesh Haloi
24602e7a98 change default runtime for containerd-stress app
This fixes following warning message by changing the default runtime
to io.containerd.runc.v2 and does not require user to set the runtime
from command line anymore.

"WARN[2021-03-17T21:11:01.441207858Z] runtime v1 is deprecated since
containerd v1.4, consider using runtime v2"

Signed-off-by: Alakesh Haloi <alakeshh@amazon.com>
2021-03-17 21:49:30 +00:00
Michael Crosby
5a656cacb4 Move manpage gen to separate binary
This moves the man page generation to a separate binary

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-09-12 14:19:00 -04:00
Michael Crosby
f3a5b8c0a9 Add command to generate man pages
The climan package has a command that can be registered with any urfav
cli app to generate man pages.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-09-11 15:31:02 -04:00
Michael Crosby
1945e26ac3 Add concurrent execs in stress tests
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-07-19 19:12:44 +00:00
Michael Crosby
84a24711e8 Add runc.v2 multi-shim
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-02-21 11:09:46 -05:00
Michael Crosby
e86a0689fb Fix stress test for image config opt requirements
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-10-15 18:58:16 -04:00
ruicao
1f5ab28216 Typo fix: outputing -> outputting
Signed-off-by: ruicao <ruicao@alauda.io>
2018-09-07 12:47:18 +08:00
Michael Crosby
17ae673b5c Set runtime for stress tests
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-07-19 12:06:39 -04:00
Michael Crosby
a2ef6952f2 Add density stress test
Running the density tool will report Pss and Rss total and per container
values for shim memory usage. Values are reported in KB.

```bash
containerd-stress density --count 500
INFO[0000] pulling docker.io/library/alpine:latest
INFO[0000] generating spec from image
{"pss":421188,"rss":2439688,"pssPerContainer":842,"rssPerContainer":4879}
```

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-02-27 16:40:37 -05:00
Kunal Kushwaha
b12c3215a0 Licence header added
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2018-02-19 10:32:26 +09:00
Michael Crosby
94602aea63 Add execs to stress tests
This improves the exec support so that they can run along with the
normal stress tests.  You don't have to pick exec stres or container
stress.  They both run at the same time and report the different values.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-01-19 13:44:54 -05:00
Michael Crosby
0b318b476a Fix gauge constant
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-12-15 14:20:34 -05:00
Michael Crosby
0725b60402 Add binary sizes to stress test metrics
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-12-15 12:49:59 -05:00
Michael Crosby
652e078078 Add commit to stress metric
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-12-12 14:14:39 -05:00
Michael Crosby
4d55298aab Add prom timer to stress
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-12-12 14:05:14 -05:00
Michael Crosby
ca5f16c33e Move stress worker to new file
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-12-11 10:36:19 -05:00
Michael Crosby
9fcca96771 Add json output to stress test tool
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-12-11 10:33:55 -05:00
Michael Crosby
fd2e3cd326 Remove mount namespace from shim
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-12-01 17:35:14 -05:00
Michael Crosby
4363994d87 Fix stress test tool exec kill
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-29 17:54:16 -05:00
Michael Crosby
723f37d846 Add exec support to stress test tool
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-28 14:18:58 -05:00
Daniel Nephin
cdf62f69a1 Fix usage of oci in other packages.
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-11-27 16:16:17 -05:00
Michael Crosby
1cb0e81b5a Fix race in stress test tool
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-11-27 10:55:13 -05:00
Daniel Nephin
f74862a0dd Add structcheck, unused, and varcheck linters.
Warn on unused and dead code

Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-11-21 11:14:37 -05:00
Daniel Nephin
298dabc6c2 Move io.go into cio package
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-11-17 17:04:45 -05:00
Michael Crosby
d7864eb77b Use namespace in default cgroup path
By default, the generated spec will place containers in cgroups by their
ids, we need to use the namespace as the cgroup root to avoid
containers with the same name being placed in the same cgroup.

```
11:perf_event:/to/redis
10:freezer:/to/redis
9:memory:/to/redis
8:devices:/to/redis
7:net_cls,net_prio:/to/redis
6:pids:/to/redis
5:hugetlb:/to/redis
4:cpuset:/to/redis
3:blkio:/to/redis
2:cpu,cpuacct:/to/redis
1:name=systemd:/to/redis

11:perf_event:/te/redis
10:freezer:/te/redis
9:memory:/te/redis
8:devices:/te/redis
7:net_cls,net_prio:/te/redis
6:pids:/te/redis
5:hugetlb:/te/redis
4:cpuset:/te/redis
3:blkio:/te/redis
2:cpu,cpuacct:/te/redis
1:name=systemd:/te/redis
```

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-10-09 17:07:57 -04:00
Michael Crosby
c601606f84 Move spec generation to Container Create
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-08-24 10:32:16 -04:00
Michael Crosby
fa14f2ef3a Add context and client to SpecOpts
In order to do more advanced spec generation with images, snapshots,
etc, we need to inject the context and client into the spec generation
code.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-08-24 10:32:16 -04:00
Brian Goff
6ab99edb71 Convert ExitStatus to use fn to get details
Instead of requiring callers to read the struct fields to check for an
error, provide the exit results via a function instead which is more
natural.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-08-22 10:48:44 -04:00
Brian Goff
026896ac4c Make Wait() async
In all of the examples, its recommended to call `Wait()` before starting
a process/task.
Since `Wait()` is a blocking call, this means it must be called from a
goroutine like so:

```go
statusC := make(chan uint32)
go func() {
  status, err := task.Wait(ctx)
  if err != nil {
    // handle async err
  }

  statusC <- status
}()

task.Start(ctx)
<-statusC
```

This means there is a race here where there is no guarentee when the
goroutine is going to be scheduled, and even a bit more since this
requires an RPC call to be made.
In addition, this code is very messy and a common pattern for any caller
using Wait+Start.

Instead, this changes `Wait()` to use an async model having `Wait()`
return a channel instead of the code itself.
This ensures that when `Wait()` returns that the client has a handle on
the event stream (already made the RPC request) before returning and
reduces any sort of race to how the stream is handled by grpc since we
can't guarentee that we have a goroutine running and blocked on
`Recv()`.

Making `Wait()` async also cleans up the code in the caller drastically:

```go
statusC, err := task.Wait(ctx)
if err != nil {
  return err
}

task.Start(ctx)

status := <-statusC
if status.Err != nil {
  return err
}
```

No more spinning up goroutines and more natural error
handling for the caller.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2017-08-22 09:33:07 -04:00
Akihiro Suda
f8b1f4f6dc stress -> containerd-stress
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-08-15 14:54:20 +00:00