Commit Graph
14 Commits
Author SHA1 Message Date
Adin ScannellandgVisor bot 2911d8c3b8 Add default_applicable_licenses rules to packages.
PiperOrigin-RevId: 513581243
2023-03-02 10:50:04 -08:00
Konstantin BogomolovandgVisor bot ac81190a2b Pass through panic-log flag to the base runsc cmd, not a subcommand.
Previously this flag was attempted to be passed into the Create subcommand,
which would not accept the flag.

PiperOrigin-RevId: 513028383
2023-02-28 13:48:29 -08:00
Zach KoopmansandgVisor bot d9ff7d13d0 Internal Change
PiperOrigin-RevId: 488706692
2022-11-15 11:06:14 -08:00
Kevin KrakauerandgVisor bot 3a76efe831 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
Konstantin BogomolovandgVisor bot e8cddcfbb4 Add shim support for calling runsc create with --panic-log.
Making the panic log directory be inside of the normal user-log directory makes
it possible to simply reuse the same spec annotation.

PiperOrigin-RevId: 466785655
2022-08-10 14:31:14 -07:00
Fabricio VoznikaandgVisor bot cd24fab369 Ensure that errors from the shim are properly translated
Golang wrapped errors are lost when they go through gRPC. Every
error returned from `task.TaskService` interface should be
translated using `errdefs.ToGRPC`.

Fixes #7504

PiperOrigin-RevId: 447863123
2022-05-10 17:09:00 -07:00
Kevin KrakauerandgVisor bot b8dd528b97 prohibit direct use of sync/atomic (u)int64 functions
All atomic 64 bit ints are changed to atomicbitops.(Ui|I)nt64. A nogo checker
enforces that sync/atomic 64 bit functions are not called.

For reviewers: the interesting changes are in the atomicbitops and checkaligned
packages.

Why do this?
- It is very easy to accidentally use atomic values without sync/atomic funcs.
- We have checkatomics, but this is optional and is forgotten in several places.
  - Using a type+checker to enforce this seems less error prone and simpler.
- We get NoCopy protection.
- Use of 64 bit atomics can break 32 bit builds. We have types to handle this
  without any runtime cost, so we might as well use them.

PiperOrigin-RevId: 440473398
2022-04-08 16:06:26 -07:00
Fabricio VoznikaandgVisor bot a1067e151a Use consistent naming for subcontainers
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-07-13 11:36:13 -07:00
Fabricio VoznikaandgVisor bot 0643f7e7bb Delete PID files right after they are read
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-29 14:49:33 -07:00
Fabricio VoznikaandgVisor bot 00dbb51f5a Redirect all calls from errdefs.ToGRPC to utils.ErrToGRPC
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-29 10:56:17 -07:00
Noah Fontes eddb856f6f Do not attempt to kill stopped exec processes
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-23 10:54:47 -07:00
Fabricio VoznikaandgVisor bot 0b39816a36 Improve stopped container handling
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-06-21 17:19:05 -07:00
Ayush RanjanandgVisor bot c3ff9f93bc [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
Fabricio VoznikaandgVisor bot 29ebab9ef0 Delete shim v1
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-12 17:54:10 -08:00