summaryrefslogtreecommitdiffhomepage
path: root/pkg/shim
AgeCommit message (Collapse)Author
2021-10-25Merge release-20211019.0-33-g9262ea47a (automated)gVisor bot
2021-10-25Add support for containerd 1.5Fabricio Voznika
"cri.runtimeoptions.v1" moved to "runtimeoptions.v1" and containerd configuration format version 2 is required. Updates #6449 PiperOrigin-RevId: 405474653
2021-10-11Merge release-20210927.0-58-gb9176535c (automated)gVisor bot
2021-10-11Create subcontainer cgroups for compatibilityFabricio Voznika
Tools (e.g. cAdvisor) watches for changes inside /sys/fs/cgroup to detect when containers are created and deleted. With gVisor, container cgroups were not created because the containers are not visible to the host. This change enables the creation of [empty] subcontainer cgroups that can be used by tools to detect creation/deletion of subcontainers. This change required a new annotation to be added so that the shim can communicate the pod cgroup path to runsc, so pod and container cgroups can be identified, Fixes #6500 PiperOrigin-RevId: 402392291
2021-08-27Merge release-20210816.0-51-g0db19ea91 (automated)gVisor bot
2021-08-16Support runtime options type used in containerd v1.5zeddy
2021-07-28Merge release-20210720.0-39-g964fb3ca7 (automated)gVisor bot
2021-07-20Merge release-20210712.0-29-g1ad382220 (automated)gVisor bot
2021-07-20Add go:build directives as required by Go 1.17's gofmt.Jamie Liu
PiperOrigin-RevId: 385894869
2021-07-13Merge release-20210705.0-19-gc16e69a9d (automated)gVisor bot
2021-07-13Use consistent naming for subcontainersFabricio Voznika
It was confusing to find functions relating to root and non-root containers. Replace "non-root" and "subcontainer" and make naming consistent in Sandbox and controller. PiperOrigin-RevId: 384512518
2021-06-29Merge release-20210628.0-7-gd205926f2 (automated)gVisor bot
2021-06-29Delete PID files right after they are readFabricio Voznika
The PID files are not used after they are read, so there is no point in keeping them around until the shim is deleted. Updates #6225 PiperOrigin-RevId: 382169916
2021-06-29Merge release-20210622.0-31-g5f2b3728f (automated)gVisor bot
2021-06-29Redirect all calls from `errdefs.ToGRPC` to `utils.ErrToGRPC`Fabricio Voznika
This is to ensure that Go 1.13 error wrapping is correctly translated to gRPC errors before returning from the shim. Updates #6225 PiperOrigin-RevId: 382120441
2021-06-24Merge release-20210614.0-23-gfdf7c4903 (automated)gVisor bot
2021-06-24Merge pull request #6228 from ↵gVisor bot
puppetlabs:fix-shim-pid-leaking-on-stopped-processes PiperOrigin-RevId: 381341920
2021-06-23Do not attempt to kill stopped exec processesNoah Fontes
While #6204 addressed the stopped state for handling signals in the main process, it did not update exec processes in the same way. This change mirrors that adjustment for exec processes.
2021-06-23Ensure shim propagates errors over gRPC correctlyNoah Fontes
This change wraps containerd's errdefs.ToGRPC function with one that understands Go 1.13-style error wrapping style, which is used pervasively throughout the shim. With this change, errors that have been marked with, e.g., `errdefs.ErrNotFound`, will be correctly propagated back to the containerd server.
2021-06-22Merge release-20210614.0-8-g1e472a857 (automated)gVisor bot
2021-06-21Improve stopped container handlingFabricio Voznika
Getting state of a stopped container would fail and could lead containerd to not detecting that the container had actually stopped. Now stopped and deleted containers return `stopped` state. Also makes other messages more consistent when container is stopped. Some where still sending messages to runsc and failing in different ways. Now they go through `initState` state machine like the other messages. There are a few changes to improve debugability with it as well. Fixes #5861 PiperOrigin-RevId: 380698513
2021-05-17Merge release-20210510.0-45-gd96499d17 (automated)gVisor bot
2021-05-17Make sandbox join the pod cgroup in K8sFabricio Voznika
cgroups in K8s are setup with the following hierarchy: `.../pod/container`. The sandbox is created with the first container and consequently uses the the pause container cgroup. This change removes the container cgroup from the path to make the sandbox use the pod cgroup instead. Otherwise limits set to the pause container will apply to the entire sandbox. PiperOrigin-RevId: 374273277
2021-05-04Merge release-20210419.0-60-g95df852bf (automated)gVisor bot
2021-05-04Make Mount.Type optional for bind mountsFabricio Voznika
According to the OCI spec Mount.Type is an optional field and it defaults to "bind" when any of "bind" or "rbind" is included in Mount.Options. Also fix the shim to remove bind/rbind from options when mount is converted from bind to tmpfs inside the Sentry. Fixes #2330 Fixes #3274 PiperOrigin-RevId: 371996891
2021-03-03Merge release-20210301.0-5-ga9441aea2 (automated)gVisor bot
2021-03-03[op] Replace syscall package usage with golang.org/x/sys/unix in pkg/.Ayush Ranjan
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-01-15Merge release-20210112.0-28-g714a020ab (automated)gVisor bot
2021-01-13Fix code review issuesTravis DePrato
2021-01-13Add support for pause/restore in containerd shimTravis DePrato
2021-01-13Merge release-20201216.0-94-ge74aa25e2 (automated)gVisor bot
2021-01-12Delete shim v1Fabricio Voznika
gvisor-containerd-shim is not compatible with containerd 1.1 or earlier. Starting from containerd 1.2, shim v2 is the preferred interface. PiperOrigin-RevId: 351485556
2021-01-12Merge release-20201216.0-87-g4e03e8754 (automated)gVisor bot
2021-01-12Fix simple mistakes identified by goreportcard.Adin Scannell
These are primarily simplification and lint mistakes. However, minor fixes are also included and tests added where appropriate. PiperOrigin-RevId: 351425971
2020-12-15Merge release-20201208.0-45-gb2a697334 (automated)gVisor bot
2020-12-14Update containerd/cgroupsFabricio Voznika
PiperOrigin-RevId: 347532687
2020-12-11Merge release-20201208.0-31-g4cba3904f (automated)gVisor bot
2020-12-11Remove existing nogo exceptions.Adin Scannell
PiperOrigin-RevId: 347047550
2020-12-04Merge release-20201130.0-35-g9eb77281c (automated)gVisor bot
2020-12-03Update containerd to 1.3.9Fabricio Voznika
PiperOrigin-RevId: 345564927
2020-11-13Merge release-20201030.0-81-gcf47c8b4a (automated)gVisor bot
2020-11-12Improve shim debug loggingFabricio Voznika
- Add log statements in service entry points. - Propagate `-debug` flag from shim invokation to the service - Load options when shim process is invoked to ensure runsc commands use the correct set of options, e.g. --debug --debug-logs=... - Add debug options to the shim configuration directly, so it doesn't rely on containerd configuration (and restart) to enable shim debug. - Save shim logs to dedicated file, so it's easier to read logs. They would be mixed with containerd logs and hard to distinguish otherwise. PiperOrigin-RevId: 342179868
2020-11-06Merge release-20201030.0-36-g62b0e845b (automated)gVisor bot
2020-11-05Return failure when `runsc events` queries a stopped containerFabricio Voznika
This was causing gvisor-containerd-shim to crash because the command suceeded, but there was no stat present. PiperOrigin-RevId: 340964921
2020-10-19Merge release-20201005.0-102-g54e989ec3 (automated)gVisor bot
2020-10-19Remove legacy bazel configurations.Adin Scannell
Using the newer bazel rules necessitates a transition from proto1 to proto2. In order to resolve the incompatibility between proto2 and gogoproto, the cri runtimeoptions proto must be vendored. Further, some of the semantics of bazel caching changed during the transition. It is now necessary to: - Ensure that :gopath depends only on pure library targets, as the propagation of go_binary build attributes (pure, static) will affected the generated files (though content remains the same, there are conflicts with respect to the gopath). - Update bazel.mk to include the possibility of binaries in the bazel-out directory, as it will now put runsc and others there. This required some refinements to the mechanism of extracting paths, since some the existing regex resulted in false positives. - Change nogo rules to prevent escape generation on binary targets. For some reason, the newer version of bazel attempted to run the nogo analysis on the binary targets, which fails due to the fact that objdump does not work on the final binary. This must be due to a change in the semantics of aspects in bazel3. PiperOrigin-RevId: 337958324
2020-08-19Merge release-20200810.0-62-g41777e90e (automated)gVisor bot
2020-08-19Change runtimeoptions proto handling.Fabricio Voznika
Stolen from cl/327337408 (ascannell is OOO) PiperOrigin-RevId: 327475423
2020-07-13Merge release-20200622.1-148-gc81ac8ec3 (automated)gVisor bot
2020-07-13Merge pull request #2672 from amscanne:shim-integratedgVisor bot
PiperOrigin-RevId: 321053634