Commit Graph

10514 Commits

Author SHA1 Message Date
Wei Fu
00d102da9f feature: support image pull progress timeout
Kubelet sends the PullImage request without timeout, because the image size
is unknown and timeout is hard to defined. The pulling request might run
into 0B/s speed, if containerd can't receive any packet in that connection.
For this case, the containerd should cancel the PullImage request.

Although containerd provides ingester manager to track the progress of pulling
request, for example `ctr image pull` shows the console progress bar, it needs
more CPU resources to open/read the ingested files to get status.

In order to support progress timeout feature with lower overhead, this
patch uses http.RoundTripper wrapper to track active progress. That
wrapper will increase active-request number and return the
countingReadCloser wrapper for http.Response.Body. Each bytes-read
can be count and the active-request number will be descreased when the
countingReadCloser wrapper has been closed. For the progress tracker,
it can check the active-request number and bytes-read at intervals. If
there is no any progress, the progress tracker should cancel the
request.

NOTE: For each blob data, the containerd will make sure that the content
writer is opened before sending http request to the registry. Therefore, the
progress reporter can rely on the active-request number.

fixed: #4984

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-04-27 00:02:27 +08:00
Phil Estes
320ef912bc
Merge pull request #6835 from kzys/proto-upgrade-5
Prepare for google.golang.org/protobuf
2022-04-21 14:24:04 +01:00
Kazuyoshi Kato
01dfb110c4 Add go_package on all proto files
Seems it is no longer optional after migratring off from
gogo/protobuf (see #6564).

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-20 17:29:15 +00:00
Kazuyoshi Kato
aa1526defc Use proto.Marshal instead of calling Marshal() on objects
With google.golang.org/protobuf, proto-generated objects only have
ProtoReflect(). They don't have Marshal() anymore (see #6564).

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-20 17:14:24 +00:00
Kazuyoshi Kato
95dde4959d Embed "Unimplemented" structs as proto recommended
Embedding these structs will be mandatory after migratring off from
gogo/protobuf (see #6564).

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-20 17:14:23 +00:00
Phil Estes
1a236784dc
Merge pull request #6833 from Junnplus/monitor-restart
fix the restart desired to running when task not found
2022-04-20 18:09:22 +01:00
Phil Estes
eb66262121
Merge pull request #6829 from kzys/always-ptr
Remove all gogoproto extensions
2022-04-20 14:45:46 +01:00
Ye Sijun
35994a475c
fix monitor restart
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2022-04-20 21:44:29 +08:00
Fu Wei
d85ac56050
Merge pull request #6830 from Junnplus/fix-monitor 2022-04-20 15:56:04 +08:00
Kazuyoshi Kato
237ef0de9b Remove all gogoproto extensions
This commit removes the following gogoproto extensions;

- gogoproto.nullable
- gogoproto.customename
- gogoproto.unmarshaller_all
- gogoproto.stringer_all
- gogoproto.sizer_all
- gogoproto.marshaler_all
- gogoproto.goproto_unregonized_all
- gogoproto.goproto_stringer_all
- gogoproto.goproto_getters_all

None of them are supported by Google's toolchain (see #6564).

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-20 07:23:28 +00:00
Ye Sijun
22cd13b370
fix nil pointer panic for monitor
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2022-04-20 15:04:36 +08:00
Fu Wei
9b33526ef6
Merge pull request #5681 from kzys/info-url
remotes/docker: log registry URLs as info instead of debug
2022-04-20 14:21:15 +08:00
Fu Wei
fe7f0aeef4
Merge pull request #6827 from mxpv/renames 2022-04-20 14:06:29 +08:00
Derek McGowan
809549e566
Merge pull request #6828 from kzys/fix-fieldpath
Fix protoc-gen-go-fieldpath
2022-04-19 21:48:09 -07:00
Maksym Pavlenko
bd90ce043b Keep shim API backward compatible
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-19 18:46:02 -07:00
Maksym Pavlenko
e2fd25f3d8 Move runtime v2 proto
Move runtime v2 protos to api/runtime package.

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-04-19 17:59:33 -07:00
Kazuyoshi Kato
3742c756e8 Don't generate a Go file, if that would be empty
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-19 22:15:45 +00:00
Kazuyoshi Kato
5f3b724323 Fix protoc-gen-go-fieldpath
The generator has to handle nested fields such as
902212651b/api/events/container.proto (L31-L35).

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-19 22:11:03 +00:00
Derek McGowan
902212651b
Merge pull request #6826 from kzys/ptypes
Consolidate gogo/protobuf dependencies under our own protobuf package
2022-04-19 10:13:56 -07:00
Fu Wei
9503d7219e
Merge pull request #6744 from Junnplus/restart-policy
Add restart policy for enhanced restart manager
2022-04-20 00:12:31 +08:00
Kazuyoshi Kato
88c0c7201e Consolidate gogo/protobuf dependencies under our own protobuf package
This would make gogo/protobuf migration easier.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-19 15:53:36 +00:00
Phil Estes
184883b0a6
Merge pull request #6821 from kzys/remove-std-time
Remove gogoproto.stdtime
2022-04-19 16:37:07 +01:00
Kazuyoshi Kato
80b825ca2c Remove gogoproto.stdtime
This commit removes gogoproto.stdtime, since it is not supported by
Google's official toolchain
(see https://github.com/containerd/containerd/issues/6564).

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-19 13:39:30 +00:00
Phil Estes
45b868927c
Merge pull request #6781 from phanhuy1502/metrics-collector-stats-timeout
Set timeout when collecting metrics from shim's Stat
2022-04-19 14:27:36 +01:00
Fu Wei
26a3ab446b
Merge pull request #6819 from kzys/native-fuzz-filter
Fuzz filter package with Go 1.18's fuzzer
2022-04-19 21:25:13 +08:00
Phil Estes
476b9c78a3
Merge pull request #6810 from henry118/ptrace
allow ptrace(2) by default for kernel >= 4.8
2022-04-19 14:23:53 +01:00
Phil Estes
4ea2202c44
Merge pull request #6820 from kzys/gen-manpages
Build bin/gen-manpages instead of using "go run"
2022-04-19 14:22:55 +01:00
Phil Estes
22655d4583
Merge pull request #6822 from thaJeztah/bump_golang_1.18.1
update golang to 1.18.1, 1.17.9
2022-04-19 14:17:55 +01:00
Sebastiaan van Stijn
dbdf50cc09
update golang to 1.18.1, 1.17.9
go1.18.1 (released 2022-04-12) includes security fixes to the crypto/elliptic,
crypto/x509, and encoding/pem packages, as well as bug fixes to the compiler,
linker, runtime, the go command, vet, and the bytes, crypto/x509, and go/types
packages. See the Go 1.18.1 milestone on the issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.18.1+label%3ACherryPickApproved

Includes fixes for:

- CVE-2022-24675 (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24675)
- CVE-2022-27536 (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-27536)
- CVE-2022-28327 (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-28327)

go1.17.9 (released 2022-04-12) includes security fixes to the crypto/elliptic
and encoding/pem packages, as well as bug fixes to the linker and runtime. See
the Go 1.17.9 milestone on the issue tracker for details:

Includes fixes for:

- CVE-2022-24675 (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24675)
- CVE-2022-28327 (https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-28327)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-04-19 09:39:10 +02:00
Derek McGowan
be60973a30
Merge pull request #6703 from mxpv/s
Sandbox API
2022-04-18 20:55:06 -07:00
Kazuyoshi Kato
fd704d3341 Build bin/gen-manpages instead of using "go run"
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-18 21:02:27 +00:00
Kazuyoshi Kato
b497e64143 Fuzz filter package with Go 1.18's fuzzer
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-18 20:49:29 +00:00
Henry Wang
94faa70df4 allow ptrace(2) by default for kernel >= 4.8
Signed-off-by: Henry Wang <henwang@amazon.com>
2022-04-18 20:45:29 +00:00
Fu Wei
7cbde74432
Merge pull request #6811 from dmcgowan/lease-plugin 2022-04-18 18:26:31 +08:00
Derek McGowan
fe8da6dcaf
Move lease manager plugin to separate package
Create lease plugin type to separate lease manager from services plugin.
This allows other service plugins to depend on the lease manager.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-04-15 11:08:47 -07:00
Phil Estes
fed7df1e25
Merge pull request #6807 from shnmorimoto/fix_pool_device_test
fix pool_device_test
2022-04-15 18:09:01 +01:00
Derek McGowan
98260e1b18
Merge pull request #6806 from mikebrow/netns-hardening
check for duplicate nspath possibilities
2022-04-14 15:02:44 -07:00
Mike Brown
147f0a7e02 check for duplicate nspath possibilities
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2022-04-14 18:33:19 +00:00
Fu Wei
e0abf62710
Merge pull request #6805 from deckhouse/reset-empty-entrypoint 2022-04-14 19:43:06 +08:00
Shinichi Morimoto
942af12032 fix pool_device_test.go
While executing mke2fs, 'Not enough space to build proposed filesystem while setting up superblock' error is happend on Ubuntu20.04

Signed-off-by: Shinichi Morimoto <shnmorimoto@gmail.com>
2022-04-14 09:55:29 +09:00
Andrey Klimentyev
5f3ce9512b Do not append []string{""} to command to preserve Docker compatibility
Signed-off-by: Andrey Klimentyev <andrey.klimentyev@flant.com>
2022-04-13 13:29:49 +03:00
Nguyen Phan Huy
c525aa5f85 Set timeout when collecting metrics from shim's Stat
Signed-off-by: Nguyen Phan Huy <phanhuy1502@gmail.com>
2022-04-12 10:49:29 +08:00
Phil Estes
eaf286224b
Merge pull request #6789 from corhere/fix/otel-panic
tracing: fix panic on startup when configured
2022-04-11 14:57:56 +01:00
Phil Estes
40a16a02b6
Merge pull request #6680 from linxiulei/fast_load
Optimize loading performance for cri recover
2022-04-11 14:57:03 +01:00
Fu Wei
d6d304dd89
Merge pull request #6798 from yanghesong/change_architecture_path 2022-04-11 16:33:33 +08:00
yanghesong
49235ccbac Change architecture path in README.md
Signed-off-by: yanghesong <hesong.yang@foxmail.com>
2022-04-11 15:40:51 +08:00
Fu Wei
e5f4c29a2b
Merge pull request #6792 from Junnplus/typo 2022-04-11 11:08:39 +08:00
Mike Brown
449eb08b89
Merge pull request #6788 from fuweid/fix-issue-6772
metrics/cgroups: fix deadlock issue in Add during Collect
2022-04-10 20:00:02 -05:00
Wei Fu
8a1280b2b6 metrics/cgroups: fix deadlock issue in Add during Collect
The Collector.Collect will be the field ns'Collect's callback, which be
invoked periodically with internal lock. And Collector.Add also runs
with ns.Lock in Collector.Lock, which is easy to cause deadlock.

Goroutine X:

	ns.Collect
	  ns.Lock
	    Collector.Collect
	      Collector.RLock

Goroutine Y:

	Collector.Add
	  Collector.Lock
	    ns.Lock

We should use ns.Lock without Collector.Lock in Add.

Fix: #6772

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-04-10 09:17:21 +08:00
Eric Lin
a5dfbfcf5a cri: load sandboxes/containers/images in parallel
Parallelizing them decreases loading duration.

Time to complete recover():
* Without competing IOs + without opt: 21s
* Without competing IOs + with opt: 14s
* Competing IOs + without opt: 3m44s
* Competing IOs + with opt: 33s

Signed-off-by: Eric Lin <linxiulei@gmail.com>
2022-04-09 13:01:14 +00:00