Commit Graph

11956 Commits

Author SHA1 Message Date
Casey Callendrello
0166783c79 cni: pass in the cgroupPath capability argument
There is a new CNI capability argument, cgroupPath, where runtimes can
pass cgroup paths to CNI plugins.

Implement that.

Signed-off-by: Casey Callendrello <cdc@isovalent.com>
2023-02-14 16:49:29 +01:00
Casey Callendrello
d14758b605 go.mod: bump to go-cni main
Signed-off-by: Casey Callendrello <c1@caseyc.net>
2023-02-14 16:49:17 +01:00
Wei Fu
e855a59984 cmd/ctr/commands/images: support usage subcommand
The `ctr image usage` can display the usage of snapshots with a given
image ref. It's easy for user to get chain snapshot IDs and unpack
usage. And according to the [discuss][1], this subcommand can be used to
ensure if snapshot's pagecache has been discarded in a unexpected
reboot.

How to use it:

```bash
$ bin/ctr image usage --snapshotter native docker.io/library/golang:1.19.3
ctr: image docker.io/library/golang:1.19.3 isn't unpacked in snapshotter native

$ bin/ctr image usage --snapshotter overlayfs docker.io/library/golang:1.19.3
KEY                                                                     SIZE      INODES
sha256:28114d8403bac6352c3e09cb23e37208138a0cd9d309edf3df38e57be8075a1d 16.0 KiB  4
sha256:f162c02ce6b9b594757cd76eda1c1dd119b88e69e882cb645bf7ad528b54f0d2 476.2 MiB 13660
sha256:a5b9faceaa495819b9ba7011b7276c4ffaffe6c7b9de0889e11abc1113f7b5ca 225.5 MiB 3683
sha256:412b2615d27d6b0090558d25b201b60a7dff2a40892a7e7ca868b80bf5e5de41 159.8 MiB 6196
sha256:dbce1593502d39c344ce089f98187999f294de5182a7106dcb6c9d04ce0c7265 19.4 MiB  502
sha256:8953bf5d24149e9b2236abc76bd0aa14b73828f1b63e816cb4b457249f6125bc 12.2 MiB  958
sha256:ccba29d6937047c719a6c048a7038d3907590fbb8556418d119469b2ad4f95bc 134.7 MiB 7245

$ bin/ctr image usage --snapshotter overlayfs docker.io/library/golang:1.19
ctr: failed to ensure if image docker.io/library/golang:1.19 exists: image "docker.io/library/golang:1.19": not found
```

[1]: <https://github.com/containerd/containerd/issues/5854#issuecomment-1415915765>

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-02-14 23:24:10 +08:00
Fu Wei
ce215971d4
Merge pull request #8104 from AkihiroSuda/xx-1.2.1
release: xx v1.2.1
2023-02-14 22:41:27 +08:00
Akihiro Suda
9c82e929fd
release: xx v1.2.1
https://github.com/tonistiigi/xx/compare/v1.1.0...v1.2.1

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-14 14:25:59 +09: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
Brian Goff
8442521645 Add fallback for windows platforms without osversion
The background for this change:

1. Windows host-process containers do not have an OS version set
2. Buildx v0.10 started pushing manifest lists by default, but it never
   has the OSVersion in the platform data (not that there is any way to
   specify what particular OS version you want). The change means that
   containerd cannot run images created with the new buildx on Windows
   because there is no matching OSVersion in the list of manifests.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-02-13 23:07:06 +00:00
Kazuyoshi Kato
458fd48720
Merge pull request #8100 from mxpv/options
[sandbox] Use options to pass PodSandboxConfig to shims
2023-02-13 14:47:59 -08: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
Danny Canter
646bc3a94e CRI: Create DefaultCRIAnnotations helper
All of the CRI sandbox and container specs all get assigned
almost the exact same default annotations (sandboxID, name, metadata,
container type etc.) so lets make a helper to return the right set for
a sandbox or regular workload container.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-02-13 13:05:01 -08:00
Danny Canter
5aab634e14 CRI: Pass sandbox annotations to _other platforms
!windows and !linux weren't getting passed the sandbox annotations.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-02-13 13:03:51 -08:00
Maksym Pavlenko
2b24af8d13 Use options to pass PodSandboxConfig to shims
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-13 12:36:20 -08:00
Krisztian Litkey
ebbcb57a4c pkg/cri/sbserver: experimental NRI integration for CRI.
Hook the NRI service plugin into CRI sbserver request
processing.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
2023-02-13 22:08:18 +02:00
Krisztian Litkey
8a1dca0f4a pkg/cri: split out NRI API from pkg/cri/server.
Split out the criService-agnostic bits of nri-api* from
pkg/cri/server to pkg/cri/nri to allow sharing a single
implementation betwen the server and sbserver versions.
Rework the interfaces to not require access to package
internals.

Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
2023-02-13 22:05:45 +02:00
Derek McGowan
edb8ebaf07
Merge pull request #8047 from ruiwen-zhao/send_nil
Send container events with nil PodSandboxStatus
2023-02-13 11:38:14 -08:00
Derek McGowan
164ac924f8
Merge pull request #7984 from aitumik/aitumik/add-host-network-tests
test: add hostNetwork tests for both windows and linux
2023-02-13 11:37:20 -08:00
Derek McGowan
34d83e1ff4
Merge pull request #8097 from helen-frank/feature/configloadPre-inspectionInAdvance
loadConfig pre-inspection in advance
2023-02-13 09:44:45 -08:00
Phil Estes
ee73e2e9fe
Merge pull request #8068 from thaJeztah/apparmor_remove_versioned
contrib/apparmor: remove version-dependent rules
2023-02-13 11:30:20 -05:00
helen
a8bb1ad2a0 loadConfig pre-inspection in advance
Signed-off-by: helen <haitao.zhang@daocloud.io>
2023-02-13 20:11:30 +08:00
helen
36e7dbdcbd ctr version: add args check, prohibit incoming args
Signed-off-by: helen <haitao.zhang@daocloud.io>
2023-02-13 17:20:18 +08:00
Fu Wei
2654ece1d0
Merge pull request #8066 from fuweid/cleanup-blockio-init
*: introduce wrapper pkgs for blockio and rdt
2023-02-13 14:05:32 +08:00
Derek McGowan
c6cf6b2522
Merge pull request #8093 from mxpv/instrument
Extract CRI instrument into separate package
2023-02-12 21:45:13 -08:00
Maksym Pavlenko
750d18aced Extract CRI instrument package
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-12 20:49:15 -08:00
Fu Wei
040fcf85f0
Merge pull request #8091 from dcantah/mirror-generic-toml-change 2023-02-12 11:23:34 +08:00
Fu Wei
a453e92f26
Merge pull request #8092 from AkihiroSuda/typeurl-v2 2023-02-12 11:17:37 +08:00
Wei Fu
60d04b0b0f pkg: rename {blockio,rdt}_default.go -> nonlinux.go
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-02-12 08:35:17 +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
Danny Canter
74b371b98a CRI: Mirror generic toml runtime config under server
In https://github.com/containerd/containerd/pull/7764 it was made
so that generic runtime options in the containerd toml config file
would get passed to shims regardless of if containerd knew of the
type beforehand and could supply the struct. However, this was only
added for the sandbox server fork here and not the regular ol' CRI
server. This change just mirrors the parts that need to be plopped in
pkg/cri/server

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-02-11 05:18:52 -08:00
Maksym Pavlenko
8ef298d863 Add transport credentials GRPC opt
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-10 22:01:35 -08:00
Maksym Pavlenko
77fc0948c4 Use switch when creating TTRPC/GRPC client
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-10 22:01:35 -08:00
Maksym Pavlenko
a82e37a5a2 Add shim bootstrap params
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-10 22:01:35 -08:00
Maksym Pavlenko
fc2e761e26 Initial GRPC client support
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-10 22:01:35 -08: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
Maksym Pavlenko
4b1ebef3c5 Add Sandbox service GRPC bridge
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-10 21:53:53 -08:00
Maksym Pavlenko
47cb5f64b3 Add Task Service GRPC bridge
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-02-10 21:53:53 -08:00
ruiwen-zhao
51a8db233d Send container events with nil PodSandboxStatus
Signed-off-by: ruiwen-zhao <ruiwen@google.com>
2023-02-11 01:34:39 +00:00
ruiwen-zhao
27c8f4085c Move PLEG event generation back to sbserver to avoid missing pod sandbox status
Signed-off-by: ruiwen-zhao <ruiwen@google.com>
2023-02-11 01:34:33 +00:00
Fu Wei
cf7b705dcd
Merge pull request #8086 from neersighted/apparmor_parser_regression
Revert `apparmor_parser` regression
2023-02-11 09:27:53 +08:00
Fu Wei
362ba2c743
Merge pull request #7981 from dmcgowan/sandbox-controller-interface-refactor
[sandbox] refactor controller interface
2023-02-11 09:22:36 +08:00
Nathan
7cf5560754 test: add hostNetwork tests for both windows and linux
Signed-off-by: Nathan <aitumik@protonmail.com>
2023-02-11 00:15:48 +03:00
Phil Estes
024a748c09
Merge pull request #7933 from AkihiroSuda/drop-libbtrfs
btrfs: depend on kernel UAPI instead of libbtrfs
2023-02-10 16:13:19 -05:00
Bjorn Neergaard
d33a43cc23
pkg/apparmor: clarify Godoc
Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-02-10 10:23:59 -07:00
Bjorn Neergaard
a3265102d9
Revert "Don't check for apparmor_parser to be present"
This reverts commit 1acca8bba3.

As stated in the Godoc, this function is intended to check for presence
of `apparmor_parser`. Changing this regressed the public API of
containerd, and directly contradicts the way that this function is
consumed inside of containerd itself:
* fdfdc9bfc0/pkg/apparmor/apparmor.go (L20)
* fdfdc9bfc0/pkg/cri/sbserver/helpers_linux.go (L85)
* fdfdc9bfc0/pkg/cri/server/helpers_linux.go (L144)

This has lead to a number of painful regressions and attempted fixes in
Moby:
* https://github.com/moby/moby/issues/44900
* https://github.com/moby/moby/pull/44902
* https://github.com/moby/moby/issues/44970

While reverting this late into the life of 1.6 and at the start of the
life of 1.7 is likely painful, I think this is ultimately the best path
to take, as containerd is subject to the same failure to start
containers with an AppArmor kernel when `apparmor_parser` is missing as
Moby.

Signed-off-by: Bjorn Neergaard <bneergaard@mirantis.com>
2023-02-10 10:05:56 -07:00
Derek McGowan
fdfdc9bfc0
Merge pull request #8082 from AkihiroSuda/ci-skip-on-fork
CI: skip some jobs when `repo != containerd/containerd`
2023-02-10 08:35:51 -08:00
Sebastiaan van Stijn
c990e3f2ed
contrib/apparmor: remove version-dependent rules
These conditions were added in docker in 8cf89245f5
to account for old versions of debian/ubuntu (apparmor_parser < 2.8.95)
that lacked some options;

> This allows us to use the apparmor profile we have in contrib/apparmor/
> and solves the problems where certain functions are not apparent on older
> versions of apparmor_parser on debian/ubuntu.

Those patches were from 2015/2016, and all currently supported distro
versions should now have more current versions than that. Looking at the
oldest supported versions;

Ubuntu 18.04 "Bionic":

    apparmor_parser --version
    AppArmor parser version 2.12
    Copyright (C) 1999-2008 Novell Inc.
    Copyright 2009-2012 Canonical Ltd.

Debian 10 "Buster"

    apparmor_parser --version
    AppArmor parser version 2.13.2
    Copyright (C) 1999-2008 Novell Inc.
    Copyright 2009-2018 Canonical Ltd.

This patch removes the version-dependent rules.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-02-10 16:30:42 +01:00
Fu Wei
4c44ec702f
Merge pull request #8078 from Fish-pro/chore/package 2023-02-10 17:35:10 +08:00
Akihiro Suda
fe0116ec2a
CI: skip some jobs when repo != containerd/containerd
For running CI in a non-upstream repo

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-10 18:12:08 +09:00
Zechun Chen
b944b108df Clean up repeated package import
Signed-off-by: Zechun Chen <zechun.chen@daocloud.io>
2023-02-10 16:21:55 +08:00
Fu Wei
218b1a335e
Merge pull request #8076 from cpuguy83/use_data_in_descriptor
fetch: Use data from descriptor when available.
2023-02-10 15:50:17 +08:00
Maksym Pavlenko
195eca1d6c
Merge pull request #8077 from Fish-pro/chore/httpvar
chore: use http constants instead of string
2023-02-09 23:32:17 -08:00