Commit Graph

415 Commits

Author SHA1 Message Date
Akihiro Suda
6df1ea0d9e
go.mod: golang.org/x/net v0.37.0
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2025-03-19 22:59:07 +09:00
Derek McGowan
d38911808a
Prepare release notes for api/v1.8.0
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-11-03 00:08:54 -07:00
Brian Goff
2123855eeb Add build tag to omit grpc
This is needed so we can build the runc shim without grpc as a
transative dependency.
With this change the runc shim binary went from 14MB to 11MB.
The RSS from an idle shim went from about 17MB to 14MB (back around
where it was in in 1.7).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2024-10-02 01:50:48 +00:00
Fu Wei
f5f11658c5
Merge pull request #9903 from abel-von/add-update-resource-only
sandbox: Add Update API for sandbox controller
2024-07-01 15:16:21 +00:00
Sebastiaan van Stijn
cb38b1e2be
api: update github.com/containerd/ttrpc v1.2.5
Update the dependency and the indirect golang.org/x/net version to align
with containerd itself, and to prevent a vulnerability being detected.

We should keep the versions <= versions used by containerd 1.7 to prevent
forcing users of containerd 1.7 in combination with the latest version
of the API module from having to update all their dependencies, but
this update should likely be fine (and aligns with 1.7).

Before this:

    Scanning your code and 254 packages across 15 dependent modules for known vulnerabilities...

    === Symbol Results ===

    Vulnerability #1: GO-2024-2687
        HTTP/2 CONTINUATION flood in net/http
      More info: https://pkg.go.dev/vuln/GO-2024-2687
      Module: golang.org/x/net
        Found in: golang.org/x/net@v0.21.0
        Fixed in: golang.org/x/net@v0.23.0
        Example traces found:
          #1: events/task_fieldpath.pb.go:85:20: events.TaskIO.Field calls fmt.Sprint, which eventually calls http2.ConnectionError.Error
          #2: events/task_fieldpath.pb.go:85:20: events.TaskIO.Field calls fmt.Sprint, which eventually calls http2.ErrCode.String
          #3: events/task_fieldpath.pb.go:85:20: events.TaskIO.Field calls fmt.Sprint, which eventually calls http2.FrameHeader.String
          #4: events/task_fieldpath.pb.go:85:20: events.TaskIO.Field calls fmt.Sprint, which eventually calls http2.FrameType.String
          #5: events/task_fieldpath.pb.go:85:20: events.TaskIO.Field calls fmt.Sprint, which eventually calls http2.Setting.String
          #6: events/task_fieldpath.pb.go:85:20: events.TaskIO.Field calls fmt.Sprint, which eventually calls http2.SettingID.String
          #7: events/task_fieldpath.pb.go:85:20: events.TaskIO.Field calls fmt.Sprint, which eventually calls http2.StreamError.Error
          #8: services/content/v1/content_ttrpc.pb.go:272:35: content.ttrpccontentClient.Write calls ttrpc.Client.NewStream, which eventually calls http2.chunkWriter.Write
          #9: events/task_fieldpath.pb.go:85:20: events.TaskIO.Field calls fmt.Sprint, which eventually calls http2.connError.Error
          #10: events/task_fieldpath.pb.go:85:20: events.TaskIO.Field calls fmt.Sprint, which eventually calls http2.duplicatePseudoHeaderError.Error
          #11: events/task_fieldpath.pb.go:85:20: events.TaskIO.Field calls fmt.Sprint, which eventually calls http2.headerFieldNameError.Error
          #12: events/task_fieldpath.pb.go:85:20: events.TaskIO.Field calls fmt.Sprint, which eventually calls http2.headerFieldValueError.Error
          #13: events/task_fieldpath.pb.go:85:20: events.TaskIO.Field calls fmt.Sprint, which eventually calls http2.pseudoHeaderError.Error
          #14: events/task_fieldpath.pb.go:85:20: events.TaskIO.Field calls fmt.Sprint, which eventually calls http2.writeData.String

    Your code is affected by 1 vulnerability from 1 module.
    This scan also found 0 vulnerabilities in packages you import and 3
    vulnerabilities in modules you require, but your code doesn't appear to call
    these vulnerabilities.
    Use '-show verbose' for more details.

After this:

    govulncheck ./...
    Scanning your code and 251 packages across 13 dependent modules for known vulnerabilities...

    === Symbol Results ===

    No vulnerabilities found.

    Your code is affected by 0 vulnerabilities.
    This scan also found 0 vulnerabilities in packages you import and 3
    vulnerabilities in modules you require, but your code doesn't appear to call
    these vulnerabilities.
    Use '-show verbose' for more details.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-20 16:53:50 +02:00
Abel Feng
15887d7efc sandbox: add update api for controller
Signed-off-by: Abel Feng <fshb1988@gmail.com>
2024-06-14 02:31:51 +00:00
Maksym Pavlenko
080d35b9ea
Merge pull request #10279 from dmcgowan/api-type-alias-envelope
Add type alias for event Envelope
2024-05-29 20:47:53 +00:00
Derek McGowan
3e71ccafc4
Add type alias for event Envelope
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-05-29 11:10:57 -07:00
Derek McGowan
359d84351d
Update api minimum go version to 1.21
A higher go build version is not required for the API

Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-05-28 13:05:03 -07:00
Derek McGowan
55fcebffc7
Prepare release notes for api/v1.8.0
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-05-03 16:51:50 -07:00
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
3e9cace720
Move runtimeoptions to api directory
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-05-02 10:52:02 -07:00
Derek McGowan
4a45507772
Move runc options to api directory
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-05-02 10:52:00 -07:00
Abel Feng
de38490ed6 sandbox: merge address and protocol to one url
Signed-off-by: Abel Feng <fshb1988@gmail.com>
2024-04-30 15:28:00 +08:00
Abel Feng
f6e0cf1894 sandbox: add address info in Start and Status response
Signed-off-by: Abel Feng <fshb1988@gmail.com>
2024-04-30 15:20:03 +08:00
Kohei Tokunaga
4332794384
Transfer: Registry: Enable plain HTTP
Currenlty transfer service doesn't handle plain HTTP connection.
This commit fixes this issue by propagating
`(core/remotes/docker/config).HostOptions.DefaultScheme` from client to the
transfer service.
This commit also fixes ctr to use this feature for "--plain-http" flag.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2024-04-03 10:46:10 +09:00
Kohei Tokunaga
7a3b7fba59
Transfer: Registry: Enable to use registry configuration diretory
Currently transfer service isn't aware of configurations of hosts directory and
ctr's `--hosts-dir` doesn't work.
This commit fixes this issue by using `config.ConfigureHosts` instead of
`docker.ConfigureDefaultRegistries`.
This commit also fixes ctr to use this feature for "--hosts-dir" flag.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2024-03-04 15:43:30 +09:00
Derek McGowan
f0e8749411
Add ttrpc generated services
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-02-21 14:22:25 -08:00
Derek McGowan
65031eadec
Update protobuild to build ttrpc services
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-02-21 14:22:25 -08:00
kiashok
5aa05481dd Add OSVersion to platform protobuf
It also extends the functions in api/types/platform_helpers.go

Signed-off-by: kiashok <kiashok@microsoft.com>
2024-02-07 11:33:51 -08:00
Maksym Pavlenko
0facc85925 Fix proto formatting
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-02 10:35:23 -08:00
Maksym Pavlenko
7f2d2c4f44 Move Message proto to types
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-02 10:35:23 -08:00
Phil Estes
3d93add18b
Merge pull request #9687 from akhilerm/refactor-protos
refactor: move plugin/fieldpath to api/types/
2024-01-26 15:05:39 +00:00
Akhil Mohan
b16e3572a3
refactor: move plugin/fieldpath to api/types/
Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
2024-01-26 00:24:08 +05:30
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
Akihiro Suda
a2472c0b5a
transfer: add OCI descriptors to Progress structure
The index media type and the digest are now shown in `ctr images pull --local=false`

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-01-11 23:56:13 +09:00
Wei Fu
bd5c602c4d api: introduce sync_fs to diff.ApplyRequest
It's flag to synchronize the underlying filesystem containing files
created during Apply.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-12-12 10:18:39 +08:00
Derek McGowan
5fdf55e493
Update go module to github.com/containerd/containerd/v2
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-10-29 20:52:21 -07:00
Samuel Karp
57c897f10d
api/introspection: deprecation warnings in server
The Server rpc in introspection service is extended to expose
deprecation warnings based on observed feature use in containerd.

Signed-off-by: Samuel Karp <samuelkarp@google.com>
2023-10-24 22:38:31 -07:00
Abel Feng
d2d434b7d6 sandbox: add all sandbox information to Create method
When call sandbox controller to create sandbox, we change the param from
sandbox id to total sandbox object to git all information to controller,
so that sandbox controller do not rely on the sandbox store anymore,
this is more decouple for the sandbox controller plugin inside
containerd, and it is neccesary for remote sandbox controller plugins as
it is not able to get sandbox from the sandbox store anymore.

Signed-off-by: Abel Feng <fshb1988@gmail.com>
2023-10-16 21:17:50 +08:00
Abel Feng
f372b3501b sandbox: add sandboxer field of sandbox requests
As we are going to support more kinds of sandboxers, we have to tell
containerd which sandboxer used to manipulate a specific sandbox.

Signed-off-by: Abel Feng <fshb1988@gmail.com>
2023-10-16 20:49:36 +08:00
Akihiro Suda
66aab638da
Merge pull request #8989 from dmcgowan/add-image-delete-target
Add image delete target
2023-10-05 10:53:57 -07:00
Bryant Biggs
42eee8bf05 fix: Add containerd to the message type reference
Signed-off-by: Bryant Biggs <bryantbiggs@gmail.com>
2023-09-20 16:32:05 -04:00
Derek McGowan
f8fb2dad39
api: update image service to support target in delete request
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-09-19 17:17:16 -07:00
Sebastiaan van Stijn
e916d77c81
platforms: move ToProto, FromProto to api/types
These utilities resulted in the platforms package to have the containerd
API as dependency. As this package is used in many parts of the code, as
well as external consumers, we should try to keep it light on dependencies,
with the potential to make it a standalone module.

These utilities were added in f3b7436b61,
which has not yet been included in a release, so skipping deprecation
and aliases for these.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-09-13 16:44:52 +02:00
Danny Canter
939ccbed42 Sandbox: Add annotations to CreateSandbox surface
An oft employed scheme for a lot of our APIs is to include an
annotations field which is just a map of string to string. This
usually allows folks using the API to send over metadata or auxiliary
information without needing to get a new field added (especially where
the field might not make sense for it to be a standalone field). I think
having annotations for CreateSandbox make sense for this same use case.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-08-12 01:39:29 -07:00
Akihiro Suda
5dedb6d0d2
archive: use 1970-01-01 as the whiteout timestamp
The whiteout timestamps are no longer set to the source date epoch.
The source date epoch still applies to non-whiteout files.

Discussion happened in moby/buildkit PR 3560.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-06-30 11:30:01 +09: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
Danny Canter
d56722ef2a Sandbox: Add SandboxMetrics rpc
To gather metrics/stats about a specific sandbox instance, it'd be nice to
have a dedicated rpc for this. Due to the same "what kind of stats are going
to be returned" dilemma exists for sandboxes as well, I've re-used the metrics
type we have as the data field is just an `any`, leaving the metrics returned
entirely up to the shim author. For CRI usecases this will just be cgroup and
windows stats as that's all that's supported right now.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-06-12 03:30:48 -07:00
Maksym Pavlenko
65906335bf Add sandbox events protos
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-05-30 13:54:35 -07:00
Iceber Gu
0bbca7f1bc Cleanup protobuild config
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2023-03-22 13:28:41 +08: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
Derek McGowan
e2283edefb
[transfer] update export API types
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-03-02 09:04:29 -08:00
Jian Zeng
b9d7eae1ad
feat(api): add fields to ImageExportStream
Signed-off-by: Jian Zeng <anonymousknight96@gmail.com>
2023-03-02 09:01:53 -08:00
Akihiro Suda
4e2eb8ba4e
Merge pull request #7964 from dmcgowan/transfer-image-store-references
[transfer] update imagestore interface to support multiple references
2023-02-14 11:22:27 +09:00
Derek McGowan
081601f521
Update imagestore interface to support multiple references
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-02-13 13:58:33 -08:00
Akihiro Suda
b61988670c
go.mod: github.com/containerd/typeurl/v2 v2.1.0
Changes: https://github.com/containerd/typeurl/compare/7f6e6d160d67...v2.1.0

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-11 23:39:52 +09:00
Derek McGowan
2717685dad
Refactor sandbox controller interface
Update the sandbox controller interface to use local types rather than
using the API types.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-02-06 21:39:30 -08:00
Maksym Pavlenko
d1cd9757eb Generate GRPC for runtime task service
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-02 09:58:43 -08:00