Commit Graph

14496 Commits

Author SHA1 Message Date
Samuel Karp
78d3e205a5
Merge pull request #10376 from linxiulei/concurrent_podstats
cri: optimize ListPodSandboxStats with parallelism
2024-07-16 22:09:52 +00:00
Kazuyoshi Kato
b31d3fdcef
Merge pull request #10357 from ktock/script-setup-imgcrypt-version-1.1.11
script: bump up imgcrypt version to v1.2.0-rc1
2024-07-16 18:50:36 +00:00
Kazuyoshi Kato
3e5e5b4da9
Merge pull request #10471 from colinodell/include-path-in-error
Include file path in tar copy errors
2024-07-16 17:02:13 +00:00
Colin O'Dell
c8254dfae9
Include filename in error
Signed-off-by: Colin O'Dell <colinodell@gmail.com>
2024-07-16 12:14:36 -04:00
Akihiro Suda
ca6a8a56a5
Merge pull request #10464 from containerd/dependabot/go_modules/tags.cncf.io/container-device-interface-0.8.0
build(deps): bump tags.cncf.io/container-device-interface from 0.7.2 to 0.8.0
2024-07-16 07:14:59 +00:00
Akihiro Suda
ac818cb363
Merge pull request #10465 from containerd/dependabot/go_modules/github.com/Microsoft/hcsshim-0.12.5
build(deps): bump github.com/Microsoft/hcsshim from 0.12.4 to 0.12.5
2024-07-16 05:30:06 +00:00
Kazuyoshi Kato
67a0efc589
Merge pull request #10460 from dmcgowan/update-link-gha-workflow
Add read permission limit on link workflow
2024-07-16 00:29:57 +00:00
dependabot[bot]
9eda0b73ae
build(deps): bump github.com/Microsoft/hcsshim from 0.12.4 to 0.12.5
Bumps [github.com/Microsoft/hcsshim](https://github.com/Microsoft/hcsshim) from 0.12.4 to 0.12.5.
- [Release notes](https://github.com/Microsoft/hcsshim/releases)
- [Commits](https://github.com/Microsoft/hcsshim/compare/v0.12.4...v0.12.5)

---
updated-dependencies:
- dependency-name: github.com/Microsoft/hcsshim
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-15 23:13:56 +00:00
dependabot[bot]
9315d59bfb
build(deps): bump tags.cncf.io/container-device-interface
Bumps [tags.cncf.io/container-device-interface](https://github.com/cncf-tags/container-device-interface) from 0.7.2 to 0.8.0.
- [Release notes](https://github.com/cncf-tags/container-device-interface/releases)
- [Commits](https://github.com/cncf-tags/container-device-interface/compare/v0.7.2...v0.8.0)

---
updated-dependencies:
- dependency-name: tags.cncf.io/container-device-interface
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-15 23:13:49 +00:00
Samuel Karp
0262714edb
Merge pull request #10412 from TinaMor/tinamor/dev
[Windows] Set stderr to empty string when using terminal on Windows
2024-07-15 16:29:08 +00:00
Derek McGowan
42daab9c11
Merge pull request #10449 from rata/rata/userns-ci-fixes
CI fixes for upcoming runc 1.2.0
2024-07-15 15:05:16 +00:00
Derek McGowan
7480de28a4
Remove static link to images outside of the repository
If an image is needed, it should be in the repository. In this case the
logo images are not necessary.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-07-15 07:36:06 -07:00
Derek McGowan
edd84f4a65
Add read permission limit on link workflow
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-07-15 07:05:34 -07:00
harshitasao
274de35fef updated the domain in the link
Signed-off-by: harshitasao <harshitasao@gmail.com>
2024-07-13 00:34:44 +05:30
Eric Lin
807f32573f cri: optimize ListPodSandboxStats with parallelism
Signed-off-by: Eric Lin <linxiulei@gmail.com>
2024-07-12 09:02:33 +00:00
Maksym Pavlenko
ac0f34f0ec
Merge pull request #10378 from akhilerm/use-marshall-from-type-url
use typeurl funcs for marshalling anypb.Any
2024-07-11 16:15:20 +00:00
Derek McGowan
231301c8f8
Merge pull request #10451 from dims/cri-ttrpc-closed-during-ListPodSandboxStats-main
Fix for [cri] ttrpc: closed during ListPodSandboxStats
2024-07-11 13:08:11 +00:00
Rodrigo Campos
7c4de28210 Update cri-tools to v1.30.1
This patch release includes just a fix to skip userns tests on host that
don't support the feature. See:

	https://github.com/kubernetes-sigs/cri-tools/releases/tag/v1.30.1

This is needed for CI to work fine when we update to runc 1.2 (not yet
released). It is also a blocker for the final runc release to make sure
it works in all known downstreams. This makes it work fine here :)

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-07-11 14:58:44 +02:00
Davanum Srinivas
0772d0a37b
Fix for [cri] ttrpc: closed during ListPodSandboxStats
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-07-10 20:42:06 -04: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
Rodrigo Campos
e1adfaeb92 script/setup/config-containerd: Use slow_chown
slow_chown is safe to add on all kernels, and when running in old
kernels (as some CI distros on purpose are), we want the expensive
fallback.

Vagrant setup and others use this script to config containerd. This
fixes userns tests with runc 1.2.0-rc.2 when running with old kernels.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-07-10 17:26:31 +02:00
Rodrigo Campos
89a2cac377 scripts/critest.sh: Prepare for userns tests in runc
When runc 1.2.0 is released, it will expose support for userns and
therefore the critest suite will run those tests. The thing is, runc
needs to be able to traverse the path to mount the rootfs on itself.

Let's just mark the paths from the BDIR upwards with +x permissions, so
the tests run fine. Containerd already makes sure that the paths below
(the ones it creates) have the right permissions and for the right
group, etc.

I've tested with runc 1.2.0-rc.2 and CI fails without this path, with
this patch it works just fine.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2024-07-10 17:26:31 +02:00
Maksym Pavlenko
1b24e53d09
Merge pull request #10443 from containerd/dependabot/go_modules/golang-x-8115ffb80d
build(deps): bump the golang-x group with 2 updates
2024-07-09 16:48:29 +00:00
dependabot[bot]
63b55e6dfb
build(deps): bump the golang-x group with 2 updates
Bumps the golang-x group with 2 updates: [golang.org/x/mod](https://github.com/golang/mod) and [golang.org/x/sys](https://github.com/golang/sys).


Updates `golang.org/x/mod` from 0.18.0 to 0.19.0
- [Commits](https://github.com/golang/mod/compare/v0.18.0...v0.19.0)

Updates `golang.org/x/sys` from 0.21.0 to 0.22.0
- [Commits](https://github.com/golang/sys/compare/v0.21.0...v0.22.0)

---
updated-dependencies:
- dependency-name: golang.org/x/mod
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: golang-x
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-08 23:55:10 +00:00
Kohei Tokunaga
203cb303e0
script: bump up imgcrypt version to v1.2.0-rc1
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2024-07-08 19:25:39 +09:00
Iceber Gu
efd4415062 client: fix tasks with PID 0 cannot be forced to delete
Signed-off-by: Iceber Gu <caiwei95@hotmail.com>
2024-07-08 17:24:58 +08:00
TinaMor
eaa1afe634 Set stderr to empty string when using terminal on Windows.
Windows HCSShim requires that stderr is an empty string when using terminal.
	Reference: 200feabd85/cmd/containerd-shim-runhcs-v1/service_internal.go (L127)

Signed-off-by: Christine Murimi <mor.tina@outlook.com>
2024-07-08 09:21:20 +03:00
Akihiro Suda
cbb2fc78e9
Merge pull request #10436 from AkihiroSuda/fedora-40
CI: update Fedora to 40
2024-07-07 11:15:11 +00:00
Akihiro Suda
51f34ff491
CI: update Fedora to 40
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-07-04 23:50:35 +09:00
Akihiro Suda
1117f663e7
Merge pull request #10416 from akhilerm/update-go1.22.5
update go version to 1.22.5
2024-07-03 23:57:07 +00:00
Akhil Mohan
56495b404d
update go version to 1.22.5
Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
2024-07-03 11:55:48 +05:30
Fu Wei
1fb1882c7d
Merge pull request #10375 from linxiulei/podstats
cri: get pid count from container metrics
2024-07-01 21:32:17 +00:00
Fu Wei
3b2a14bb4c
Merge pull request #10407 from dmcgowan/fsverity-internal
Move fsverity package to internal
2024-07-01 21:31:55 +00:00
Samuel Karp
ebcbbe5643
Merge pull request #10401 from samuelkarp/nri-panic
cri: ensure NRI API never has nil CRI
2024-07-01 16:37:46 +00:00
Derek McGowan
23170e20df
Move fsverity package to internal
This functionality is not directly related to containerd and could move
to external package at some point.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-07-01 09:21:24 -07:00
Eric Lin
f6e731c809 cri: get pid count from container metrics
This reduces latency of calling ListPodSandboxStats() by avoiding calling
shim API Task().

Signed-off-by: Eric Lin <linxiulei@gmail.com>
2024-07-01 15:34:47 +00:00
Fu Wei
37e0f54534
Merge pull request #10402 from thaJeztah/update_runhcs_v0.12.4
update runhcs binary to v0.12.4
2024-07-01 15:29:26 +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
Akihiro Suda
7103e381f1
Merge pull request #10007 from Jenkins-J/fsverity-content-verification
Fsverity content verification
2024-06-29 06:32:17 +00:00
Akihiro Suda
db1123b19c
Merge pull request #10394 from thaJeztah/deprecate_reference_SplitObject
pkg/reference: deprecate SplitObject, and remove for v2.0
2024-06-29 06:14:56 +00:00
Sebastiaan van Stijn
96352ad226
update runhcs binary to v0.12.4
commit 149ca6880a updated the hcsshim
module to v0.12.4, but did not add a commit to also update the runhcs
binary version.

full diff: https://github.com/microsoft/hcsshim/compare/v0.12.3...v0.12.4

These versions are decoupled since 15b13fb3ea
to allow updating the binary version without updating the module, in cases
where the module doesn't require updates.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-29 00:46:30 +02:00
Samuel Karp
10aec359a0
cri: ensure NRI API never has nil CRI
A nil CRIImplementation field can cause a nil pointer dereference and
panic during startup recovery.

Prior to this change, the nri.API struct would have a nil cri
(CRIImplementation) field after nri.NewAPI until nri.Register was
called.  Register is called mid-way through initialization of the CRI
plugin, but recovery for containers occurs prior to that.  Container
recovery includes establishing new exit monitors for existing containers
that were discovered.  When a container exits, NRI plugins are given the
opportunity to be notified about the lifecycle event, and this is done
by accessing that CRIImplementation field inside the nri.API.  If a
container exits prior to nri.Register being called, access to the
CRIImplementation field can cause a panic.

Here's the call-path:

* The CRI plugin starts running
  [here](ae71819c4f/pkg/cri/server/service.go (L222))
* It then [calls into](ae71819c4f/pkg/cri/server/service.go (L227))
  `recover()` to recover state from previous runs of containerd
* `recover()` then attempts to recover all containers through
  [`loadContainer()`](ae7d74b9e2/internal/cri/server/restart.go (L175))
* When `loadContainer()` finds a container that is still running, it waits
  for the task (internal containerd object) to exit and sets up
  [exit monitoring](ae7d74b9e2/internal/cri/server/restart.go (L391))
* Any exit that then happens must be
  [handled](ae7d74b9e2/internal/cri/server/events.go (L145))
* Handling an exit includes
  [deleting the Task](ae7d74b9e2/internal/cri/server/events.go (L188))
  and specifying [`nri.WithContainerExit`](ae7d74b9e2/internal/cri/nri/nri_api_linux.go (L348))
  to [notify](ae7d74b9e2/internal/cri/nri/nri_api_linux.go (L356))
  any subscribed NRI plugins
* NRI plugins need to know information about the pod (not just the sandbox),
  so before a plugin is notified the NRI API package
  [queries the Sandbox Store](ae7d74b9e2/internal/cri/nri/nri_api_linux.go (L232))
  through the CRI implementation
* The `cri` implementation member field in the `nri.API` struct is set as part of the
  [`Register()`](ae7d74b9e2/internal/cri/nri/nri_api_linux.go (L66)) method
* The `nri.Register()` method is only called
  [much further down in the CRI `Run()` method](ae71819c4f/pkg/cri/server/service.go (L279))

Signed-off-by: Samuel Karp <samuelkarp@google.com>
2024-06-28 15:32:11 -07:00
Sebastiaan van Stijn
a723c0c6ea
pkg/reference: remove deprecated SplitObject
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-28 19:06:30 +02:00
James Jenkins
ef98c71985 Implement fsverity functionality
Implement calls to the fsverity kernel module, allowing containerd to
enable fsverity on blob data in the content store. This causes fsverity
to veirfy the integrity of blob data when the blob is read.

Signed-off-by: James Jenkins <James.Jenkins@ibm.com>
2024-06-28 09:50:44 -04:00
Sebastiaan van Stijn
fec33aa735
pkg/reference: deprecate SplitObject
The behavior of this function is quite counter-intuitive, as it preserves
the delimiter in the result, and its use for external consumers would be
very limited.

Spec.Digest no longer uses this function, and it appears that BuildKit is
currently the only (publicly visible) external consumer of it.

This patch deprecates the function.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-27 22:11:42 +02:00
Maksym Pavlenko
ae7d74b9e2
Merge pull request #10393 from thaJeztah/improve_reference
pkg/reference: reduce allocations and improve GoDoc
2024-06-27 18:36:24 +00:00
Sebastiaan van Stijn
a5fce38f31
pkg/reference: Spec.Digest(): inline SplitObject code
Inline the relevant code from SplitObject, as we're only interested
in the digest portion.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-27 12:05:23 +02:00
Sebastiaan van Stijn
42145950bb
pkg/reference: SplitObject: add proper GoDoc
The behavior of this function is quite counter-intuitive, as it preserves
the delimiter in the result. This function should probably have been an
internal function, as its use for external consumers would be very limited,
but let's at least document the (surprising) behavior for those that are
considering to use it.

It appears that BuildKit is currently the only (publicly visible) external
consumer of this function; I am planning to inline its functionality in
Spec.Digest() and to deprecate this function so that it can be removed.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-27 12:05:23 +02:00
Sebastiaan van Stijn
74a6156ac2
pkg/reference: SplitObject: zero allocations
Before / After:

    BenchmarkSplitObject-10        2785656    428.1 ns/op     416 B/op    13 allocs/op
    BenchmarkSplitObjectNew-10    13510520     88.2 ns/op       0 B/op     0 allocs/op

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-27 12:05:10 +02:00
Sebastiaan van Stijn
799bca97f2
pkg/reference: Spec.String(): use string-concatenation instead of sprintf
These were straight concatenations of strings; reduce some allocations by
removing fmt.Sprintf for this.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-06-27 12:04:22 +02:00