Commit Graph

21 Commits

Author SHA1 Message Date
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