Commit Graph

43 Commits

Author SHA1 Message Date
Zach Koopmans 324735cfc0 Update docker packages to new moby repo.
PiperOrigin-RevId: 555358714
2023-08-09 20:48:47 -07:00
Nicolas Lacasse 25cc1596e9 Automated rollback of changelist 523138695
PiperOrigin-RevId: 523233101
2023-04-10 15:53:54 -07:00
Nicolas Lacasse ef03c57c55 Apply net-related sysctls when configuring host network.
This is needed to support things like ipv6, which are configured by sysctls
passed to Docker.

PiperOrigin-RevId: 523138695
2023-04-10 09:49:09 -07:00
Zach Koopmans f92957314c Add portforward command to runsc
Add portforward comand so that we can use runsc to forward connections
to container ports. This will eventually be supported in k8s.

PiperOrigin-RevId: 520739913
2023-03-30 14:16:19 -07:00
Adin Scannell 1ceb814544 Add default_applicable_licenses rules to packages.
PiperOrigin-RevId: 513581243
2023-03-02 10:50:04 -08:00
Zach Koopmans cc0dc87fa2 Add usage benchmarks
Add the usage benchmark which queries memory usage from the container. This
is meant to replace the size benchmark which has a ton of noise.

Flakes are due to the complicated measurement technique of dropping caches ->
parse /proc/meminfo -> start containers -> drops caches again -> parse
/proc/meminfo -> take the diference. This was done because not all runtimes
support docker/containerd stats.

Buuuut...gVisor does, so we'll just take the stats figures to reduce noise
for the memory usage benchmark.

In addition, the returned types.StatsJSON object contains several useful stats
like page faults and CPU usage, so adding these will be trivial and will not
slow down benchmark performance.

[types.StatsJSON linky link](https://github.com/moby/moby/blob/42c8b314993e5eb3cc2776da0bbe41d5eb4b707b/api/types/stats.go#LL153)

PiperOrigin-RevId: 503342363
2023-01-19 21:00:49 -08:00
Ayush Ranjan 110c3d76e4 Remove remaining references to vfs2.
PiperOrigin-RevId: 493998299
2022-12-08 14:37:43 -08:00
Kevin Krakauer d8aa09e04c convert uses of interface{} to any
Done via:
  find . -name "*.go" | xargs sed -i -E 's/interface\{\}/any/g'

PiperOrigin-RevId: 487033228
2022-11-08 13:14:06 -08:00
Etienne Perot 5b3d8659a0 Use runc as default runtime for unsandboxed containers.
Without this, attempting to build or test gVisor on machines where the default
runtime isn't `runc` may fail, as that runtime may not support what we need.

PiperOrigin-RevId: 486205081
2022-11-04 12:35:05 -07:00
Kevin Krakauer 94126dd4aa Limit the number of open files per sandbox
Fixes #6547.

PiperOrigin-RevId: 457594490
2022-06-27 16:41:21 -07:00
Etienne Perot 0df51fa5db integration_test: Ensure Docker has experimental features enabled.
This test relies on `docker checkpoint`, which requires experimental
features to be turned on in Docker.

PiperOrigin-RevId: 454246068
2022-06-10 14:49:01 -07:00
Andrei Vagin b8fa96e201 test/runtime: add the timeout option for proctor
proctor is running in a sandbox and it executes tests. If it is able to
handle timeouts, we will know that a test sandbox is alive and proctor
will send SIGTERM to test processes and collect all logs.

In addition, these changes contains a few things:
* upload runsc logs with other test artifacts.
* increase log level for java tests.
* call Fatalf instead of Errorf when we want to terminate a test.

PiperOrigin-RevId: 437385756
2022-03-25 19:38:39 -07:00
Lucas Manning bf86207401 Add systemd-cgroup support to runsc.
This change adds systemd-cgroup support to cgroupv2 and modifies existing
cgroup tests for systemd support.

Fixes #193

PiperOrigin-RevId: 435457762
2022-03-17 15:03:44 -07:00
Fabricio Voznika c6bb9ceb66 Remove VFS2 test dimension
The default is VFS2 enabled, so the tests setting VFS2 are redundant.

Updates #1624

PiperOrigin-RevId: 431827013
2022-03-01 18:59:30 -08:00
Adin Scannell f1a46c928f Support STAGED_BINARIES to run prebuilt binaries with the test pipeline.
In some cases, it may be desirable to prebuild binaries and run all tests,
for example to run benchmarks with various experiments. Allow the top-level
Makefile to support this by checking for a STAGED_BINARIES variable.

PiperOrigin-RevId: 410673120
2021-11-17 17:49:35 -08:00
Ayush Ranjan d924515b09 [perf] Fix profiling in benchmarking jobs.
Due to https://github.com/moby/moby/issues/42345, the docker daemon is passing
the incorrect `--root` flag to runsc. So our profiler is not able to find the
container stat files where it expects them to be.

PiperOrigin-RevId: 372067954
2021-05-05 00:02:37 -07:00
Adin Scannell 8192cccda6 Clean test tags.
PiperOrigin-RevId: 369505182
2021-04-20 13:11:25 -07:00
Fabricio Voznika 3007ae647d Fail tests when container returns non-zero status
PiperOrigin-RevId: 366839955
2021-04-05 11:39:53 -07:00
Zeling Feng 9e86dfc9c5 Fix logs for packetimpact tests cleanup
- Don't cleanup containers in Network.Cleanup, otherwise containers will
  be killed and removed several times.
- Don't set AutoRemove for containers. This will prevent the confusing
  'removal already in progress' messages.

Fixes #3795

PiperOrigin-RevId: 364404414
2021-03-22 14:10:00 -07:00
Ayush Ranjan a9441aea27 [op] Replace syscall package usage with golang.org/x/sys/unix in pkg/.
The syscall package has been deprecated in favor of golang.org/x/sys.

Note that syscall is still used in the following places:
- pkg/sentry/socket/hostinet/stack.go: some netlink related functionalities
  are not yet available in golang.org/x/sys.
- syscall.Stat_t is still used in some places because os.FileInfo.Sys() still
  returns it and not unix.Stat_t.

Updates #214

PiperOrigin-RevId: 360701387
2021-03-03 10:25:58 -08:00
Zach Koopmans ba51999fa6 Fix bug with iperf and don't profile runc.
Fix issue with iperf where b.N wasn't changing across runs.
Also, if the given runtime is runc/not given, don't run a profile against it.

PiperOrigin-RevId: 357231450
2021-02-12 11:28:16 -08:00
Adin Scannell b06e5bc5b0 Add benchmarks targets to BuildKite.
This includes minor fix-ups:

* Handle SIGTERM in runsc debug, to exit gracefully.
* Fix cmd.debug.go opening all profiles as RDONLY.
* Fix the test name in fio_test.go, and encode the block size in the test.

PiperOrigin-RevId: 350205718
2021-01-05 13:21:54 -08:00
Adin Scannell ffa9a715aa Simplify profiling and benchmarks.
- Tweak the benchmarks to work with b.N where appropriate. In many cases,
  b.N was simply being ignored. This creates an implicit dependency in the
  user passing a reasonable benchtime (less than or equal to the actual
  runtime of the test, or using the X syntax) otherwise the test runs
  forever.
- In cases where the above is impossible, explicitly set benchtime from
  the test wrapper, to prevent the above behavior (tensorflow).
- Drop the *Reverse variants, which are simply hey benchmarks. We should
  just add a hey benchmark. The platforms benchmarks already include a
  native platform, and thus these benchmarks are incredibly confusing.
  (In other words, BenchmarkNginxReverse has nothing to do with an nginx
  benchmark for runsc.)
- Remove the redunant Harness object, which contains no state, in order
  to slightly simplify the code.
- Make Block and Heap profiling actually work, but setting appropriate
  runtime parameters (and plumbing them through the config).
- Split the profiling into two phases: start and stop, since some will
  need to be started early, and others will need to happen at the end.

PiperOrigin-RevId: 349495377
2020-12-29 18:29:12 -08:00
Zeling Feng 59a2c785bf Do not start a ContainerExec twice
ContainerExecStart and ContainerExecAttach both call the /exec/id/start API
endpoint.

PiperOrigin-RevId: 344946627
2020-11-30 21:22:55 -08:00
Adin Scannell 2320ce5b7d Fail gracefully if Docker is not configured with ipv6.
PiperOrigin-RevId: 343927315
2020-11-23 14:24:27 -08:00