Commit Graph

34 Commits

Author SHA1 Message Date
Paweł Gronowski
6b5efba83b client: Respect client.WithTimeout option
Fix the gRPC client dialer not using the timeout passed by the
containerd client timeout option.

Commit 63b4688175 replaced the usage of deprecated `grpc.DialContext`
with `grpc.NewClient`.

However, the `dialer.ContextDialer` relied on the context deadline to
propagate the timeout:

388fb336b0/vendor/google.golang.org/grpc/clientconn.go (L216)

This assumption is now broken, because `grpc.NewClient` doesn't do any
initial connection and defers it to the first RPC usage.

This commit passes the timeout via the `MinConnectTimeout` grpc
connection param, which will be applied to **every** connection attempt
(not just the first).

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-03-13 18:11:16 +00:00
Abel Feng
e4df672ab8 sandbox: add sandbox controller v2
Signed-off-by: Abel Feng <fshb1988@gmail.com>
2024-10-16 17:37:05 +08:00
Swagat Bora
c0cdcb34f1 Add spans to CRI runtime service and related client methods
This adds otel spans to CRI service mainly targeting mutating apis which includes:
* Sandbox apis - RunPodSandbox, StopPodSandbox, RemovePodSandbox
* Container apis - CreateContainer, StartContainer, StopContainer, RemoveContainer
* Attach, Exec and Exec Sync
* Containerd client methods: container.go, client.go, process.go and task.go

Signed-off-by: Swagat Bora <sbora@amazon.com>
2024-08-05 02:34:20 +00:00
Samuel Karp
1e3c35bd0d
Merge pull request #10488 from dcantah/avoid-realloc
Avoid potential reallocs by pre-sizing some slices
2024-07-22 05:39:19 +00:00
Danny Canter
b41bb6df73 Avoid potential reallocs by pre-sizing some slices
There's a couple spots where we know exactly how large
the destination buffer should be, so pre-size these to
avoid any reallocs to a higher capacity.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2024-07-19 13:05:49 -07:00
Maksym Pavlenko
fb674f8b48 Add resolver workaround for error: name resolver error: produced zero addresses
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-07-18 15:26:02 -07:00
Maksym Pavlenko
63b4688175 Use grpc.NewClient instead of deprecated ones
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-07-18 15:26:02 -07:00
Akhil Mohan
300fd770a0
use typeurl funcs for marshalling anypb.Any
Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
2024-07-10 22:26:27 +05:30
Derek McGowan
2ac2b9c909
Make api a Go sub-module
Allow the api to stay at the same v1 go package name and keep using a
1.x version number. This indicates the API is still at 1.x and allows
sharing proto types with containerd 1.6 and 1.7 releases.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-05-02 11:03:00 -07:00
Derek McGowan
e1b94c0e7d
Move protobuf package under pkg
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-05-02 10:52:03 -07:00
Maksym Pavlenko
7d2bc0620b
Merge pull request #9911 from dmcgowan/introspection-split
Cleanup introspection interface
2024-03-05 03:20:45 +00:00
Derek McGowan
1bf781d8eb
Cleanup introspection interface
Split service proxy from service plugin.
Make introspection service easier for clients to use.
Update service proxy to support grpc and ttrpc.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-03-01 23:07:42 -08:00
Derek McGowan
5bd204109f
Remove grpc from Client connection interface
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-03-01 14:27:28 -08:00
Derek McGowan
347346e3cf
Add ttrpc support to content proxy
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-03-01 14:27:27 -08:00
Derek McGowan
9104e6a24f
Add events proxy interface
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-03-01 14:27:27 -08:00
Derek McGowan
72f21833b1
Move events to plugins and core
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-02-27 22:09:20 -08:00
Derek McGowan
fb9b59a843
Switch to new errdefs package
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-25 22:18:45 -08:00
Akihiro Suda
22d586e515
api/services/instrospection: add PluginInfo
The new `PlunginInfo()` call can be used for instrospecting the details
of the runtime plugin.

```console
$ ctr plugins inspect-runtime --runtime=io.containerd.runc.v2 --runc-binary=runc
{
    "Name": "io.containerd.runc.v2",
    "Version": {
        "Version": "v2.0.0-beta.0-XX-gXXXXXXXXX.m",
        "Revision": "v2.0.0-beta.0-XX-gXXXXXXXXX.m"
    },
    "Options": {
        "binary_name": "runc"
    },
    "Features": {
        "ociVersionMin": "1.0.0",
        "ociVersionMax": "1.1.0-rc.2",
        ...,
    },
    "Annotations": null
}
```

The shim binary has to support `-info` flag, see `runtime/v2/README.md`

Replaces PR 8509 (`api/services/task: add RuntimeInfo()`)

Co-authored-by: Derek McGowan <derek@mcg.dev>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-01-25 10:00:30 +09:00
Derek McGowan
e79ec7a095
Remove deprecated platforms package
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-23 09:14:03 -08:00
Derek McGowan
fa8cae99d1
Move namespaces to pkg/namespaces
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:55:39 -08:00
Derek McGowan
44a836c9b5
Move errdefs to pkg/errdefs
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:54:45 -08:00
Derek McGowan
70ed2696fa
Move events to pkg/events
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:54:36 -08:00
Derek McGowan
fcd39ccc53
Move snapshots to core/snapshots
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:54:09 -08:00
Derek McGowan
92d2a5fc02
Move services to plugins/services
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:52:57 -08:00
Derek McGowan
228ad5a5ca
Move sandbox to core/sandbox
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:52:39 -08:00
Derek McGowan
0dabf6f154
Move remotes to core/remotes
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:52:21 -08:00
Derek McGowan
f80760f9ff
Move leases to core/leases
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:51:45 -08:00
Derek McGowan
57ea8aef3d
Move images to core/images
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:51:26 -08:00
Derek McGowan
9456048f46
Move containers to core/containers
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:50:40 -08:00
Derek McGowan
21b4f3f0aa
Move content to core/content
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:50:32 -08:00
James Jenkins
8aa2551ce0 Move DefaultSnapshotter constants
Move the DefaultSnapshotter constants to the defaults package.
Fixes issue #8226.

Signed-off-by: James Jenkins <James.Jenkins@ibm.com>
2024-01-12 13:28:46 -05:00
Abel Feng
0cf48bab2c sandbox: podsandbox init its own client
To break the cyclic dependency of cri plugin and podsandbox plugin,
we define a new plugin type of SandboxesServicePlugin and when cri init
it's own client, it will add the all the controllers by get them from
the SandboxesServicePlugin.
when podsandbox controller init it's client, it will not Require the
SandboxesServicePlugin.

Signed-off-by: Abel Feng <fshb1988@gmail.com>
2023-11-15 09:22:10 +08:00
Derek McGowan
b85df264ef
Rename opt to avoid stutter
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-11-01 10:39:54 -07:00
Derek McGowan
261e01c2ac
Move client to subpackage
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-11-01 10:37:00 -07:00