Commit Graph

32 Commits

Author SHA1 Message Date
Derek McGowan
7b2a918213
Generalize the plugin package
Remove containerd specific parts of the plugin package to prepare its
move out of the main repository. Separate the plugin registration
singleton into a separate package.

Separating out the plugin package and registration makes it easier to
implement external plugins without creating a dependency loop.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-10-12 21:22:32 -07:00
Derek McGowan
a80606bc2d
Move plugin type definitions to containerd plugins package
The plugins packages defines the plugins used by containerd.
Move all the types and properties to this package.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-10-12 20:52:56 -07:00
rongfu.leng
3ddcd6120d add Duration type to compatible toml v1 version
Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
2023-10-09 14:19:23 +08:00
Derek McGowan
e0e6f870b7
Merge pull request #9086 from dmcgowan/move-to-log-repo
Use github.com/containerd/log
2023-09-22 09:25:29 -07:00
Derek McGowan
508aa3a1ef
Move to use github.com/containerd/log
Add github.com/containerd/log to go.mod

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-09-22 07:53:23 -07:00
Aditya Ramani
729c97cf39 Handle unexpected shim kill events
When a shim process is unexpectedly killed in a way that was not initiated through containerd - containerd reports the pod as not ready but the containers as running. This results in kubelet repeatedly sending container kill requests that fail since containerd cannot connect to the shim.

Changes:

- In the container exit handler, treat `err: Unavailable` as if the container has already exited out
- When attempting to get a connection to the shim, if the controller isn't available assume that the shim has been killed (needs to be done since we have a separate exit handler that cleans up the reference to the shim controller - before kubelet has the chance to call StopPodSandbox)

Signed-off-by: Aditya Ramani <a_ramani@apple.com>
2023-09-18 12:15:55 -07:00
Ethan Lowman
ac1d556b92
Add image verifier transfer service plugin system based on a binary directory
Signed-off-by: Ethan Lowman <ethan.lowman@datadoghq.com>
2023-09-07 18:45:02 -04:00
Jin Dong
cd8c8ae4bc Remove hashicorp/go-multierror
Signed-off-by: Jin Dong <jin.dong@databricks.com>
2023-08-20 17:59:45 -07:00
Danny Canter
22a7c63c07 Sandbox: Change to mount.Mount for CreateOptions
We'd wanted to swap to mount.Mount after target was introduced. That
time is now :)

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-07-03 11:14:19 -07:00
Danny Canter
d278d37caa Sandbox: Add Metrics rpc for controller
As a follow up change to adding a SandboxMetrics rpc to the core
sandbox service, the controller needed a corresponding rpc for CRI
and others to eventually implement.

This leaves the CRI (non-shim mode) controller unimplemented just to
have a change with the API addition to start.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-06-13 00:24:09 -07:00
Derek McGowan
c786994eae
Update transfer configuration
Export transfer config fields.
Determine differ based on platform or config.
Get snapshotter from metadata store.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-04-19 18:00:23 -07:00
Derek McGowan
800ec305cb
Merge pull request #8272 from DataDog/ethan.lowman/fix-ctr-transfer-pull
Fix image pulling with Transfer service
2023-04-19 17:51:30 -07:00
Ethan Lowman
3e87f05b62
Fix image pulling with Transfer service
Signed-off-by: Ethan Lowman <ethan.lowman@datadoghq.com>
2023-03-15 16:10:31 -04:00
Phil Estes
974da0503d
Merge pull request #8255 from dcantah/sbserver-handle-controllerfail
Sandbox: Cleanup shim on Start failure
2023-03-15 13:13:04 -04:00
Danny Canter
d835fd2a3a Sandbox: Correct/add some fields to Status()
CreatedAt was being used as the ExitedAt timestamp, and Info from the
response wasn't being set on the response.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-03-13 04:04:17 -07:00
Danny Canter
70da5c7830 Sandbox: Cleanup shim on Start failure
Made a change a bit ago to cleanup the shim on CreateSandbox failures and
noted that we should probably do the same on Start as well as nothing gets
cleaned up otherwise, and nothing states that a sandbox server/shim should
exit itself if Create/Start fail. Ideally this could be hooked up to
some subsystem in containerd that'd do it for us, but for now to allow
developing prototyping sandbox shims this makes things much friendlier.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-03-13 01:54:13 -07:00
Maksym Pavlenko
48a1350658
Merge pull request #8149 from Burning1020/sb-netns
sandbox: create sandbox with network namespace path
2023-03-08 14:22:00 -08:00
Zhang Tianyang
5144ba9c49 sandbox: create sandbox with network namespace path
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
2023-03-08 18:54:14 +08:00
Danny Canter
f7eb86ef3c Sandbox: Delete shim+shutdown sandbox on create failure
Currently if create fails the shim will just be kind of stuck in limbo.
This calls shutdown to allow the shim to exit, and then invokes shim
delete.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-03-04 23:09:59 -08:00
Danny Canter
6b4b6956e3 Sandbox: Fix/enhance error messages for Create
CreateSandbox states "failed to start sandbox". This is quite confusing
when you're perusing logs and trying to pinpoint how far a shim got in
its execution.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-03-04 01:15:47 -08:00
Phil Estes
477df4bd47
Merge pull request #8193 from fangn2/fix-config-dump
Create config struct to take user input
2023-03-02 11:37:49 -05:00
Tony Fang
2e96ba95e0 Create config struct to take user input
Signed-off-by: Tony Fang <nhfang@amazon.com>
2023-03-02 05:44:25 +00:00
Derek McGowan
5c6e9f83d4
Fix streaming manager deadlock on collection
Ensure that lock is released and stream is closed.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-03-01 09:40:59 -08:00
Tony Fang
47305392c6 Add configuration options to local transfer service
Signed-off-by: Tony Fang <nhfang@amazon.com>
2023-02-25 03:40:06 +00:00
Maksym Pavlenko
9e5c207e4c Wire up client bridges
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-10 22:01:35 -08:00
Derek McGowan
a788f6c799
Move local sandbox controller under plugins package
Add options to sandbox controller interface.
Update sandbox controller interface to fully utilize sandbox controller
interface.
Move grpc error conversion to service.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-02-06 22:04:45 -08:00
Derek McGowan
47fee791f6
Add sandbox store plugin type
Moves the sandbox store plugin under the plugins packages and adds a
unique plugin type for other plugins to depend on it.
Updates the sandbox controller plugin to depend on the sandbox store
plugin.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-12-20 23:05:14 -08:00
Derek McGowan
01bd314b1d
Rename local transfer plugin
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-11-30 12:56:58 -08:00
Derek McGowan
478f1c934d
Lint fixes
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-11-30 12:56:55 -08:00
Derek McGowan
6b5df1ee16
Update transfer packages
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-11-30 12:56:54 -08:00
Derek McGowan
6f64cb8598
Transfer interface and plugin work in progress
Signed-off-by: Derek McGowan <derek@mcg.dev>

Transfer service implementation

Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-11-30 12:56:50 -08:00
Derek McGowan
dcf5687cab
Add streaming service
Adds a service capable of streaming Any objects bi-directionally.
This can be used by services to send data, received data, or to
initiate requests from server to client.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-11-30 12:55:56 -08:00