Commit Graph

12660 Commits

Author SHA1 Message Date
Phil Estes
b8bd27a14e
Merge pull request #8697 from upodroid/fix-unbound-variable
Fix unbound variable used by Prow
2023-06-16 10:46:18 -04:00
upodroid
d358f1680f fix unbound variable
Signed-off-by: upodroid <cy@borg.dev>
2023-06-15 21:18:20 +01:00
Kay Yan
f4ad68d5f2 fix-push-image-rate
Signed-off-by: Kay Yan <kay.yan@daocloud.io>
2023-06-15 19:08:03 +00:00
Wei Fu
7de95cbc4c snapshots/blockfile: deflaky the testsuite
* Use direct-io mode to reduce IO.

* Add testViewHook helper to recovery the backing file since the ext4
  might need writable permission to handle recovery. If the backing file
  needs recovery and it's for View snapshot, the readonly mount will
  cause error.

* Use 8 MiB as capacity to reduce the IO.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-06-15 23:54:06 +08:00
Wei Fu
6dfb16f99a snapshots|pkg: umount without DETACH and nosync after umount
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-06-15 23:53:47 +08:00
Wei Fu
72b7d16505 mount: support direct-io for loopback device
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-06-15 23:51:46 +08:00
Kazuyoshi Kato
ded713010c
Merge pull request #8617 from corhere/reduce-exec-lock-contention
runtime/v2/runc: handle early exits w/o big locks
2023-06-14 15:55:07 -07:00
Derek McGowan
0ae64ebd4e
Merge pull request #8680 from dcantah/sb-metrics
Sandbox: Add SandboxMetrics rpc
2023-06-14 18:11:18 +00:00
Derek McGowan
70f30b2e09
Merge pull request #8692 from mxpv/merge-queues
Don't run CI on push
2023-06-14 18:11:04 +00:00
Maksym Pavlenko
437f134107 Don't run CI on push
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-06-14 11:04:07 -07:00
Jin Dong
e26c97cb8b Save marshalled empty response in streaming service
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2023-06-14 18:02:58 +00:00
Maksym Pavlenko
3065aa2aae
Merge pull request #8684 from djdongjin/nsmap-rwmutex
Use RWMutex in NSMap and reduce lock area
2023-06-14 17:52:39 +00:00
Jin Dong
9e09bfb590 Use RWMutex in NSMap and reduce lock area
Signed-off-by: Jin Dong <djdongjin95@gmail.com>
2023-06-14 17:50:54 +00:00
Derek McGowan
78b4af74a4
Merge pull request #8685 from estesp/no-nondistributable-layers
No more nondistributable layers in MS registry
2023-06-14 17:46:21 +00:00
Phil Estes
38b0f970f0
No more nondistributable layers in MS registry
Microsoft announced the removal of nondistributable layers from their
images today. This makes the convert test fail since it assumes the
first layer is nondistributable on Windows during the test.

Signed-off-by: Phil Estes <estesp@amazon.com>
2023-06-13 16:34:44 -04:00
Kazuyoshi Kato
0f6a70d970
Merge pull request #8676 from dmcgowan/overlay-options
[overlay] add configurable mount options to overlay snapshotter
2023-06-13 09:55:24 -07: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
Derek McGowan
d115129d1e
Add configurable mount options to overlay
Allows default mount options to be provided through configuration.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-06-12 09:17:07 -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
Derek McGowan
dd5e9f6538
Merge pull request #7944 from adisky/new-pinned-image
CRI Pinned image support
2023-06-10 22:29:34 -07:00
Derek McGowan
98b7dfb870
Merge pull request #8673 from thaJeztah/no_any
avoid "any" as variable name
2023-06-10 20:44:30 -07:00
Kazuyoshi Kato
cf52175301
Merge pull request #8672 from thaJeztah/save_some_trees
replace some basic uses of fmt.Sprintf()
2023-06-10 17:46:03 -07:00
Sebastiaan van Stijn
4bb709c018
avoid "any" as variable name
Avoid shadowing / confusion with Go's "any" built-in type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-06-10 13:49:06 +02:00
Sebastiaan van Stijn
577696f608
replace some basic uses of fmt.Sprintf()
Really tiny gains here, and doesn't significantly impact readability:

    BenchmarkSprintf
    BenchmarkSprintf-10    11528700     91.59 ns/op   32 B/op  1 allocs/op
    BenchmarkConcat
    BenchmarkConcat-10    100000000     11.76 ns/op    0 B/op  0 allocs/op

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-06-10 13:24:43 +02:00
Cory Snider
5cd6210ad0 runtime/v2/runc: handle early exits w/o big locks
eventSendMu is causing severe lock contention when multiple processes
start and exit concurrently. Replace it with a different scheme for
maintaining causality w.r.t. start and exit events for a process which
does not rely on big locks for synchronization.

Keep track of all processes for which a Task(Exec)Start event has been
published and have not yet exited in a map, keyed by their PID.
Processing exits then is as simple as looking up which process
corresponds to the PID. If there are no started processes known with
that PID, the PID must either belong to a process which was started by
s.Start() and before the s.Start() call has added the process to the map
of running processes, or a reparented process which we don't care about.
Handle the former case by having each s.Start() call subscribe to exit
events before starting the process. It checks if the PID has exited in
the time between it starting the process and publishing the TaskStart
event, handling the exit if it has. Exit events for reparented processes
received when no s.Start() calls are in flight are immediately
discarded, and events received during an s.Start() call are discarded
when the s.Start() call returns.

Co-authored-by: Laura Brehm <laurabrehm@hey.com>
Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-06-09 16:53:43 -04:00
Derek McGowan
ee2c8b79bf
Merge pull request #8664 from laurazard/timeout-integration-test-shim-oomscore
integration/client: add timeout to `TestShimOOMScore`
2023-06-09 11:49:48 -07:00
Laura Brehm
df280942a7
integration/client: add timeout to TestShimOOMScore
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-06-09 10:10:42 +01:00
Kazuyoshi Kato
326cd0623e
Merge pull request #8362 from gabriel-samfira/fix-non-c-volume
Fix non C volumes on Windows
2023-06-08 21:07:23 -07:00
Gabriel Adrian Samfira
6dd529e400
Pass in imagespec.Platform to WithVolumes()
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-06-08 12:31:04 +03:00
Derek McGowan
67349c1141
Merge pull request #8643 from laurazard/io-close-before-cancel
task: don't `close()` io before `cancel()`
2023-06-07 12:29:36 -07:00
Derek McGowan
b03103152a
Merge pull request #8652 from hangscer8/release_ticker_correctly
fix release `ticker` correctly in `HandleProgress`
2023-06-07 10:47:00 -07:00
Phil Estes
0a821b968c
Merge pull request #8633 from jsturtevant/fix-for-init-containers-windows-pod-stats
[CRI] Windows Pod Stats: Add a check to skip stats for containers that are not running.
2023-06-07 13:29:27 -04:00
Samuel Karp
d9ff3236bd
Merge pull request #8645 from cpuguy83/otlp_from_env 2023-06-07 02:05:23 -07:00
hang.jiang
d18026592f release ticker correctly
Signed-off-by: hang.jiang <hang.jiang@daocloud.io>
2023-06-07 11:45:38 +08:00
James Sturtevant
28a5199ff6
Add a check to skip stats for containers that are not running
When a container is just created, exited state the container will not have stats. A common case for this in k8s is the init containers for a pod. The will be present in the listed containers but will not have a running task and there for no stats.

Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-06-06 12:59:56 -07:00
Derek McGowan
87dbdd2ca1
Merge pull request #8572 from Jenkins-J/proto-docs
Document Protocol Buffer Setup
2023-06-06 10:36:34 -07:00
Laura Brehm
34a93a0c2c task: don't close() io before cancel()
The contract for `cio/io.go/IO` states that a call to `Close()`
will always be preceded by a call to `Cancel()` -
f3a07934b4/cio/io.go (L59)
which isn't being held up here.

Furthermore, the call to `Close()` here makes the subsequent `Wait()`
moot, and causes issues to consumers (see: https://github.com/moby/moby/issues/45689)

It seems from
f3a07934b4/task.go (L338)
that the `Close()` should be called there, the call removed in this
commit is unnecessary/erroneous.

We leave the `Close()` call on Windows only since this was introduced
in https://github.com/containerd/containerd/pull/5974 to address
https://github.com/containerd/containerd/issues/5621.

Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2023-06-06 11:03:35 +01:00
Akihiro Suda
1f54e8fb21
Merge pull request #8637 from AkihiroSuda/followup-8606
RELEASES.md: de-deprecation of CNI conf_template will be v1.7.3
2023-06-06 17:19:41 +09:00
Samuel Karp
f92e576f6b
Merge pull request #8609 from samuelkarp/issue-8607 2023-06-05 10:31:45 -07:00
Brian Goff
007c5b6e35 Setup otlp from env
This allows standard OTLP env vars to be used for configuring tracing
exporters.

Note: This does mean that, as written now, if no env var is set the
trace exporter will try to connect to the default OTLP address
(`localhost:4318`).
I've left this alone for now, but we could detect the OTLP vars
ourselves and if not set don't configure the exporter.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-06-05 16:42:39 +00:00
Phil Estes
4281a9550e
Merge pull request #8641 from cpuguy83/update_x_sys
Update x/sys to 0.8.0
2023-06-05 09:32:12 -04:00
Brian Goff
104b9ef9eb Update x/sys to 0.8.0
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-06-03 16:14:38 +00:00
Akihiro Suda
69b451af5a
RELEASES.md: de-deprecation of CNI conf_template will be v1.7.3
Cherry-pick of PR 8606 missed the v1.7.2 milestone

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-06-03 17:04:14 +09:00
Samuel Karp
f3a07934b4
Merge pull request #8628 from hangscer8/clean_atomicBool 2023-06-02 17:07:10 -07:00
Samuel Karp
ab53652228
ctr: update WritePidFile to use atomicfile
Signed-off-by: Samuel Karp <samuelkarp@google.com>
2023-06-02 16:56:34 -07:00
Samuel Karp
c409c631ca
shim: WritePidFile & WriteAddress use atomicfile
Signed-off-by: Samuel Karp <samuelkarp@google.com>
2023-06-02 16:56:34 -07:00
Samuel Karp
3c4a1ab1cb
cri: write generated CNI config atomically on Unix
The 10-containerd-net.conflist file generated from the conf_template
should be written atomically so that partial writes are not visible to
CNI plugins. Use the new consistentfile package to ensure this on
Unix-like platforms such as Linux, FreeBSD, and Darwin.

Fixes https://github.com/containerd/containerd/issues/8607

Signed-off-by: Samuel Karp <samuelkarp@google.com>
2023-06-02 16:56:34 -07:00
Samuel Karp
f3ba7c8a35
atomicfile: new package for atomic file writes
Certain files may need to be written atomically so that partial writes
are not visible to other processes. On Unix-like platforms such as
Linux, FreeBSD, and Darwin, this is accomplished by writing a temporary
file, syncing, and renaming over the destination file name. On Windows,
the same operations are performed, but Windows does not guarantee that a
rename operation is atomic.

Partial/inconsistent reads can occur due to:
1. A process attempting to read the file while containerd is writing it
   (both in the case of a new file with a short/incomplete write or in
   the case of an existing, updated file where new bytes may be written
   at the beginning but old bytes may still be present after).
2. Concurrent goroutines in containerd leading to multiple active
   writers of the same file.

The above mechanism explicitly protects against (1) as all writes are to
a file with a temporary name.

There is no explicit protection against multiple, concurrent goroutines
attempting to write the same file. However, atomically writing the file
should mean only one writer will "win" and a consistent file will be
visible.

Signed-off-by: Samuel Karp <samuelkarp@google.com>
2023-06-02 16:56:33 -07:00
hang.jiang
28d8c79de7 Replace atomicBool with the standard library atomic.Bool
Signed-off-by: hang.jiang <hang.jiang@daocloud.io>
2023-06-02 14:02:55 +08:00
Aditi Sharma
fe4f8bd884 Pinned image support
Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
2023-06-02 09:57:22 +05:30