Commit Graph

13325 Commits

Author SHA1 Message Date
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
Kazuyoshi Kato
8a6c8a96c0
Merge pull request #8626 from jsturtevant/fix-windows-podstats-for-hpc
Fix issue for HPC pod metrics
2023-06-01 19:25:08 -07:00
Derek McGowan
023128bd35
Merge pull request #8627 from davidhsingyuchen/cherry-pick-no-merge 2023-06-01 18:08:25 -07:00
Hsing-Yu (David) Chen
a85b12d4d0 docs: cherry-pick individual commits instead of merge commit
Signed-off-by: Hsing-Yu (David) Chen <davidhsingyuchen@gmail.com>
2023-06-01 17:05:06 -07:00
James Sturtevant
738c4c6fa5
Fix issue for HPC pod metrics
The initial PR had a check for nil metrics but after some refactoring in the PR the test case that was suppose cover HPC was missing a scenario where the metric was not nil but didn't contain any metrics. This fixes that case and adds a testcase to cover it.

Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-06-01 15:12:36 -07:00
Phil Estes
139146ade8
Merge pull request #8619 from thaJeztah/fix_deprecation_comments
remotes/docker: ResolverOptions: fix deprecation comments
2023-06-01 12:42:17 -04:00
Sebastiaan van Stijn
52997ea983
remotes/docker: ResolverOptions: fix deprecation comments
Go deprecation comments must be formatted to have an empty comment line before
them. Fix the formatting to make sure linters and editors detect that these
are deprecated.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-06-01 09:28:12 +02:00
Fu Wei
83371c4bef
Merge pull request #8535 from cardyok/metrics_enrich_memory_cgroups
bugfix: add nil pointer check for cgroup v1 mem usage
2023-06-01 13:07:17 +08:00
Cardy.Tang
a35ead5b9d bugfix: add nil pointer check for cgroup v1 mem usage
Signed-off-by: Cardy.Tang <zuniorone@gmail.com>
2023-06-01 09:57:39 +08:00
Kazuyoshi Kato
73645b1dfe
Merge pull request #8588 from lengrongfu/feat/cleanup_config_tls
Cleanup DEPRECATED TLS config
2023-05-31 18:50:54 -07:00
Kazuyoshi Kato
45d78fb1f1
Merge pull request #8582 from chschumacher1994/patch-1
fix(docs): minor fix on the windows installation steps
2023-05-31 17:42:53 -07:00
Phil Estes
2da38b1939
Merge pull request #8605 from dmcgowan/events-cleanup-deprecated
Remove events from init context
2023-05-31 16:09:27 -04:00
Kazuyoshi Kato
659a41fd85
Merge pull request #8174 from Iceber/fix_ctr_run
ctr: fix the cleanup of task
2023-05-31 10:01:12 -07:00
Kazuyoshi Kato
9e834e761a
Merge pull request #8334 from davidhsingyuchen/fix-io-cancel
fix: cio.Cancel() should close the pipes
2023-05-31 09:58:36 -07:00
Kazuyoshi Kato
3ad032e9d0
Merge pull request #8606 from adisky/remove-conf-template-deprecation
Remove cni conf_template deprecation
2023-05-31 09:47:21 -07:00
Kazuyoshi Kato
a81f3fb817
Merge pull request #8525 from elezar/ctr-add-cdi-devices
Add support for CDI devices to ctr run command
2023-05-31 09:36:25 -07:00
Derek McGowan
2a60fe5a60
Remove events from init context
Events from the init context have been replaced by the events plugin

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-05-31 09:35:03 -07:00
Kazuyoshi Kato
30354134d4
Merge pull request #8553 from aznashwan/windows-workflow-2019-base-sku
Windows Integration: Switch Azure-based CI to vanilla 2019 image.
2023-05-31 09:29:14 -07:00
Evan Lezar
d3887b2e62 Support CDI devices in ctr --device flag
This change adds support for CDI devices to the ctr --device flag.
If a fully-qualified CDI device name is specified, this is injected
into the OCI specification before creating the container.

Note that the CDI specifications and the devices that they represent
are local and mirror the behaviour of linux devices in the ctr command.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
2023-05-31 16:14:01 +02:00
Phil Estes
80eb76332e
Merge pull request #8602 from mxpv/sbevents
Publish sandbox events
2023-05-31 09:14:08 -04:00
Akihiro Suda
65bca439a9
Merge pull request #8599 from lengrongfu/doc/update-auths-code-comment
update auths code comment
2023-05-31 22:13:54 +09:00
Phil Estes
bd7f543869
Merge pull request #8601 from rye-stripe/add-ctr-run-flags
Add cpuset flags to 'ctr run'
2023-05-31 09:11:26 -04:00
Aditi Sharma
3ca5b4437e Remove cni conf_template deprecation
As discussed in the issue
https://github.com/containerd/containerd/issues/8596
It is a helpful feature at many places and no replacement
readily available

Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
2023-05-31 17:34:33 +05:30
Samuel Karp
8454b23ead
Merge pull request #8597 from thaJeztah/unpack_nits
Image: fix some minor nits
2023-05-31 02:06:48 -07:00
Sebastiaan van Stijn
94f0af3ece
Image.IsUnpacked(): make error-handling more iodiomatic
Check for "err != nil" instead of "err == nil".

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-31 09:47:48 +02:00
Sebastiaan van Stijn
54658a1152
Image: rename variable that shadowed import
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-31 09:47:27 +02:00
rongfu.leng
d2b7a1e293 cleanup DEPRECATED TLS config
Signed-off-by: rongfu.leng <rongfu.leng@daocloud.io>
2023-05-31 09:37:41 +08:00
Samuel Karp
8b66a752c9
Merge pull request #7376 from tianon/oci-platform 2023-05-30 18:14:31 -07:00
Maksym Pavlenko
f857626d64 Move PLEG event back to CRI
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-05-30 16:40:58 -07:00
Maksym Pavlenko
fc50334ca9 Generate sandbox exit events from CRI
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-05-30 16:40:58 -07:00
Derek McGowan
c7b9a95bdc
Merge pull request #8603 from cji/cji-mount
Add handling of a '.' commondir and bounds checking to mount_linux
2023-05-30 16:27:54 -07:00
Craig Ingram
d2605de734 add handling of a '.' commondir and bounds checking to mount_linux
Signed-off-by: Craig Ingram <Cjingram@google.com>
2023-05-30 21:13:16 +00:00
Maksym Pavlenko
cf56054594 Move pod sandbox recovery to podsandbox/ package
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-05-30 13:54:35 -07:00
Maksym Pavlenko
45dbb4e542 Publish sandbox events
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-05-30 13:54:35 -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
Tianon Gravi
21b3318ebe Fix several conversions of "ocispec.Image" to "ocispec.Platform"
Several bits of code unmarshal image config JSON into an `ocispec.Image`, and then immediately create an `ocispec.Platform` out of it, but then discard the original image *and* miss several potential platform fields (most notably, `variant`).

Because `ocispec.Platform` is a strict subset of `ocispec.Image`, most of these can be updated to simply unmarshal the image config directly to `ocispec.Platform` instead, which allows these additional fields to be picked up appropriately.

We can use `tianon/raspbian` as a concrete reproducer to demonstrate.

Before:

```console
$ ctr content fetch docker.io/tianon/raspbian:bullseye-slim
...

$ ctr image ls
REF                                     TYPE                                                 DIGEST                                                                  SIZE     PLATFORMS    LABELS
docker.io/tianon/raspbian:bullseye-slim application/vnd.docker.distribution.manifest.v2+json sha256:66e96f8af40691b335acc54e5f69711584ef7f926597b339e7d12ab90cc394ce 28.6 MiB linux/arm/v7 -
```

(Note that the `PLATFORMS` column lists `linux/arm/v7` -- the image itself is actually `linux/arm/v6`, but one of these bits of code leads to only `linux/arm` being extracted from the image config, which `platforms.Normalize` then updates to an explicit `v7`.)

After:

```console
$ ctr image ls
REF                                     TYPE                                                 DIGEST                                                                  SIZE     PLATFORMS    LABELS
docker.io/tianon/raspbian:bullseye-slim application/vnd.docker.distribution.manifest.v2+json sha256:66e96f8af40691b335acc54e5f69711584ef7f926597b339e7d12ab90cc394ce 28.6 MiB linux/arm/v6 -
```

Signed-off-by: Tianon Gravi <admwiggin@gmail.com>
Co-authored-by: Sebastiaan van Stijn <github@gone.nl>
2023-05-30 13:13:02 -07:00
Derek McGowan
6d7060099b
Merge pull request #8552 from dcantah/cross-plat-stats
CRI: Make stats respect sandbox's platform
2023-05-30 09:58:50 -07:00
Derek McGowan
197b27bd02
Merge pull request #8586 from mcdonagj/fix-spelling-of-repository-in-nri-docs
Fix: Correct the spelling of repository within the NRI plugin documentation.
2023-05-30 09:27:44 -07:00