Commit Graph

10972 Commits

Author SHA1 Message Date
Gijs Peskens
ae22854e2b
Linux containers on FreeBSD
This allows running Linux containers on FreeBSD and modifies the
mounts so that they represent the linux emulated filesystems, as per:
https://wiki.freebsd.org/LinuxJails

Co-authored-by: Gijs Peskens <gijs@peskens.net>, Samuel Karp <samuelkarp@users.noreply.github.com>
Signed-off-by: Artem Khramov <akhramov@pm.me>
2022-06-01 00:56:24 +02:00
Kazuyoshi Kato
49ca87d727 Limit the response size of ExecSync
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-05-31 22:21:35 +00:00
Kazuyoshi Kato
78cd9d3b6b
Merge pull request #7001 from dcantah/cri-trun
Use t.Run for /pkg/cri tests
2022-05-31 12:26:48 -07:00
Paco Xu
1cf6f20320 promote pause image to 3.7
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2022-05-30 15:08:28 +08:00
Daniel Canter
b5e1b8f619 Use t.Run for /pkg/cri tests
A majority of the tests in /pkg/cri are testing/validating multiple
things per test (generally spec or options validations). This flow
lends itself well to using *testing.T's Run method to run each thing
as a subtest so `go test` output can actually display which subtest
failed/passed.

Some of the tests in the packages in pkg/cri already did this, but
a bunch simply logged what sub-testcase was currently running without
invoking t.Run.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-05-29 18:32:09 -07:00
Maksym Pavlenko
b572a82ad8 CRI: Remove deprecated error types and update error msg
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-05-28 13:53:28 -07:00
Daniel Canter
978ff393d2 Add validations for Windows HostProcess CRI configs
HostProcess containers require every container in the pod to be a
host process container and have the corresponding field set. The Kubelet
usually enforces this so we'd error before even getting here but we recently
found a bug in this logic so better to be safe than sorry.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-05-27 21:17:07 -07:00
Sebastiaan van Stijn
1a8024b46a
Makefile: use urfave_cli_no_docs for binaries that don't need it
We only need the `ToMan()` as part of the `bin/gen-manpages` binary, which
generates the man-pages; other binaries don't use this code, so we can
set the `urfave_cli_no_docs` build-tag to exclude `cpuguy83/md2man` and
`russross/blackfriday` (and other dependencies) from the binaries:

Before:

    ls -lh bin
    total 149M
    -rwxr-xr-x 1 root root  49M May 27 10:12 containerd
    -rwxr-xr-x 1 root root 6.1M May 27 10:13 containerd-shim
    -rwxr-xr-x 1 root root 8.1M May 27 10:13 containerd-shim-runc-v1
    -rwxr-xr-x 1 root root 8.2M May 27 10:13 containerd-shim-runc-v2
    -rwxr-xr-x 1 root root  22M May 27 10:12 containerd-stress
    -rwxr-xr-x 1 root root  26M May 27 10:11 ctr
    -rwxr-xr-x 1 root root  30M May 27 10:14 gen-manpages

    ls -l bin
    total 151676
    -rwxr-xr-x 1 root root 51280184 May 27 10:12 containerd
    -rwxr-xr-x 1 root root  6332416 May 27 10:13 containerd-shim
    -rwxr-xr-x 1 root root  8458240 May 27 10:13 containerd-shim-runc-v1
    -rwxr-xr-x 1 root root  8536064 May 27 10:13 containerd-shim-runc-v2
    -rwxr-xr-x 1 root root 22567160 May 27 10:12 containerd-stress
    -rwxr-xr-x 1 root root 26873752 May 27 10:11 ctr
    -rwxr-xr-x 1 root root 30508888 May 27 10:14 gen-manpages

After:

    ls -lh bin
    total 147M
    -rwxr-xr-x 1 root root  49M May 27 10:26 containerd
    -rwxr-xr-x 1 root root 6.1M May 27 10:26 containerd-shim
    -rwxr-xr-x 1 root root 8.1M May 27 10:26 containerd-shim-runc-v1
    -rwxr-xr-x 1 root root 8.2M May 27 10:26 containerd-shim-runc-v2
    -rwxr-xr-x 1 root root  22M May 27 10:26 containerd-stress
    -rwxr-xr-x 1 root root  26M May 27 10:26 ctr
    -rwxr-xr-x 1 root root  30M May 27 10:27 gen-manpages

    ls -l bin
    total 149912
    -rwxr-xr-x 1 root root 50930360 May 27 10:26 containerd
    -rwxr-xr-x 1 root root  6332416 May 27 10:26 containerd-shim
    -rwxr-xr-x 1 root root  8458240 May 27 10:26 containerd-shim-runc-v1
    -rwxr-xr-x 1 root root  8536064 May 27 10:26 containerd-shim-runc-v2
    -rwxr-xr-x 1 root root 22209144 May 27 10:26 containerd-stress
    -rwxr-xr-x 1 root root 26523896 May 27 10:26 ctr
    -rwxr-xr-x 1 root root 30508888 May 27 10:27 gen-manpages

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-05-27 19:57:12 +02:00
Kazuyoshi Kato
c76559a6a9
Merge pull request #6997 from thaJeztah/update_urfave
vendor: github.com/urfave/cli v1.22.9 and fix "verify-vendor" script
2022-05-27 10:30:58 -07:00
Sebastiaan van Stijn
5bb47fb956
vendor: github.com/urfave/cli v1.22.9
The regression in v1.22.2 has been resolved, so we can drop the
replace rule and use the latest v1.22.x version.

full diff: https://github.com/urfave/cli/compare/v1.22.1...v1.22.9

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-05-27 13:05:54 +02:00
Sebastiaan van Stijn
a3a2d14ecc
fix verify-vendor if go.mod does not contain replace rules
Before this patch, if the go.mod did not contain a replace rule, jq would fail
(Cannot iterate over null), and Bash would produce an error when trying to add
an empty `$key` to `map_requires`:

    make verify-vendor
    + verify-vendor
      jq: error (at <stdin>:581): Cannot iterate over null (null)
      /go/src/github.com/containerd/containerd//script/verify-go-modules.sh: line 44: map_replaces_1[$key]: bad array subscript
      make: *** [Makefile:435: verify-vendor] Error 1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-05-27 12:57:12 +02:00
Maksym Pavlenko
688b30cf52 CRI: Move truncindex to pkg
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-05-26 13:02:45 -07:00
Maksym Pavlenko
e44335800e CRI: Move reference sorting to reference package
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-05-26 12:52:36 -07:00
Maksym Pavlenko
b5366f8d7e CRI: Retrieve image spec on client
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-05-26 12:38:55 -07:00
Derek McGowan
c4e29027d4
Merge pull request #6937 from mythi/sandbox-errors
sandbox: replace github.com/pkg/errors with native errors
2022-05-26 10:44:15 -07:00
Phil Estes
da2db02369
Merge pull request #6983 from ethan-lowman-dd/ethan.lowman/fix-makefile-check-protos
build: Fix references to check-protos target in Makefile
2022-05-25 18:23:49 +01:00
Derek McGowan
8ba075c3dd
Merge pull request #6954 from Iceber/fix_ctr_new_container
ctr: fix label args used in NewContainer
2022-05-25 09:01:32 -07:00
Derek McGowan
928ae45e39
Merge pull request #6959 from mythi/ctr-sb
ctr sandbox: handle sandbox config
2022-05-24 18:25:31 -07:00
Ethan Lowman
4ba5415fb3
build: Fix references to check-protos target in Makefile
Signed-off-by: Ethan Lowman <ethan.lowman@datadoghq.com>
2022-05-24 17:41:10 -04:00
Derek McGowan
11de19af68
Merge pull request #6975 from AdamKorcz/fuzz3
Fix broken oss-fuzz build
2022-05-24 13:12:07 -07:00
Phil Estes
da9f9e464c
Merge pull request #6982 from AkihiroSuda/improve-userns-lchown-error
archive: add human-readable hint to Lchown error
2022-05-24 17:03:39 +01:00
AdamKorcz
8a3114b375 Fix broken oss-fuzz build
Signed-off-by: AdamKorcz <adam@adalogics.com>
2022-05-24 14:54:53 +01:00
Akihiro Suda
d2f30150b3
archive: add human-readable hint to Lchown error
Before:
```
$ nerdctl pull gcr.io/kubeflow-images-public/tensorflow-1.14.0-notebook-cpu:v0.7.0
FATA[0026] failed to extract layer sha256:f8a604834d388fd3d04c26e4ed832b36b617ea8a4e0b1665b9199bd10cfcb171: mount callback failed on /var/lib/containerd/tmpmounts/containerd-mount1818823128:
lchown /var/lib/containerd/tmpmounts/containerd-mount1818823128/usr/local/bin/docker-credential-gcr: invalid argument: unknown
```

After:
```
$ nerdctl pull gcr.io/kubeflow-images-public/tensorflow-1.14.0-notebook-cpu:v0.7.0
FATA[0027] failed to extract layer sha256:f8a604834d388fd3d04c26e4ed832b36b617ea8a4e0b1665b9199bd10cfcb171: mount callback failed on /var/lib/containerd/tmpmounts/containerd-mount3521205359:
failed to Lchown "/var/lib/containerd/tmpmounts/containerd-mount3521205359/usr/local/bin/docker-credential-gcr" for UID 205001, GID 5000:
lchown /var/lib/containerd/tmpmounts/containerd-mount3521205359/usr/local/bin/docker-credential-gcr: invalid argument
(Hint: try increasing the number of subordinate IDs in /etc/subuid and /etc/subgid): unknown
```

Related to moby/moby issue 43576 but for containerd

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-05-24 17:57:53 +09:00
Fu Wei
22e8fc1f40
Merge pull request #6978 from cardyok/fix-tx-closed 2022-05-24 13:02:42 +08:00
Derek McGowan
9ab02adb92
Merge pull request #6972 from AkihiroSuda/improve-config-toml-version-message
config: improve config v1 deprecation message
2022-05-23 20:52:37 -07:00
cardy.tang
9f9ebbd991 Fix tx closed error when upperdirlabel specified
When upperdirLabel specified, overlay Update will throw tx closed error since Commit is invoked before GetInfo

Signed-off-by: cardy.tang <zuniorone@gmail.com>
2022-05-24 10:34:43 +08:00
Akihiro Suda
739cb4c99a
config: improve config v1 deprecation message
The previous wording was causing confusion.
Fix moby/moby issue 43628

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-05-23 10:10:07 +09:00
Kevin Parsons
ac85382682
Merge pull request #6969 from ShaunLawrie/patch-1
Fix Windows install powershell script
2022-05-21 20:47:58 -07:00
Shaun Lawrie
b5107a8984
Fix Windows install powershell script
Signed-off-by: Shaun Lawrie <beatbophiphop@gmail.com>
2022-05-21 19:31:17 +12:00
Kazuyoshi Kato
f8a155ff8a
Merge pull request #6955 from Iceber/update_metadata_schema_comment
fix comments on metadata schema and update namespace doc
2022-05-19 15:20:42 -07:00
Kazuyoshi Kato
868c7c3fa8
Merge pull request #6956 from my-git9/mygit2
adjust format in comment
2022-05-19 14:44:12 -07:00
Kazuyoshi Kato
6c1782107f
Merge pull request #6957 from kzys/zstd-bench
Restore decompression benchmarks
2022-05-19 13:50:01 -07:00
Iceber Gu
b69182c71d add note that a namespace cannot be named "version"
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2022-05-19 22:53:21 +08:00
Iceber Gu
8d95f2b599 fix comments on metadata schema
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2022-05-19 22:52:51 +08:00
Fu Wei
798ff6202f
Merge pull request #6960 from my-git9/mygit3
cmd/ctr/commands/content: fix typo in fetch command usage
2022-05-19 22:05:28 +08:00
Mikko Ylinen
900019b301 ctr sandbox: handle sandbox config
"ctr s r" help suggests <pod-config.json> is taken as the first
parameter and the sandbox ID becomes next. However, only the latter
is read and used.

Add code that reads <pod-config.json> and passes it to Sanbox.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-05-19 15:28:49 +03:00
xin.li
8ec1fc70d9 adjust format
Signed-off-by: xin.li <xin.li@daocloud.io>
2022-05-19 17:31:26 +08:00
Kazuyoshi Kato
a42688639c Restore decompression benchmarks
The benchmarks were deleted in #2640 but we could use that to evaluate
zstd further.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-05-18 18:25:11 +00:00
xin.li
8494f7f117 adjust format in comment
Signed-off-by: xin.li <xin.li@daocloud.io>
2022-05-19 00:24:56 +08:00
Phil Estes
405fba75dd
Merge pull request #6950 from AllenZMC/fix
fix some confusing typos
2022-05-18 11:47:29 +02:00
Phil Estes
1f9ae758cc
Merge pull request #6952 from my-git9/mygit1
update doc url about k8s
2022-05-18 11:46:24 +02:00
Iceber Gu
92b7bc9edc ctr: fix label args used in NewContainer
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2022-05-18 16:11:30 +08:00
xin.li
4da4a88796 update doc url
Signed-off-by: xin.li <xin.li@daocloud.io>
2022-05-18 09:18:45 +08:00
AllenZMC
eaec6530d7 fix some confusing typos
Signed-off-by: AllenZMC <zhongming.chang@daocloud.io>
2022-05-17 23:53:36 +08:00
Kazuyoshi Kato
42c6be80e3
Merge pull request #6946 from TBBle/separate-windows-test-results
Separate windows-2019 and windows-2022 test results
2022-05-16 13:33:17 -07:00
Paul "TBBle" Hampson
65150600d8 Separate windows-2019 and windows-2022 test results
This fixes the problem that only one upload is kept per artifact name.

Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
2022-05-15 22:00:30 +10:00
Phil Estes
e217c83e8c
Merge pull request #6910 from wllenyj/debug
shim: fix debug flag not working
2022-05-14 19:53:19 +01:00
Derek McGowan
b9bffd1f38
Merge pull request #6938 from psschwei/fix-parallel
Reverts removal of parallel run from critest
2022-05-12 12:51:26 -07:00
Phil Estes
133978f893
Merge pull request #6932 from lucacome/bump-otel-deps
Bump OpenTelemetry dependencies
2022-05-12 19:28:35 +01:00
Paul S. Schweigert
7300296cb6
reverts removal of parallel run from critest
Signed-off-by: Paul S. Schweigert <paulschw@us.ibm.com>

As discussed in https://github.com/containerd/containerd/issues/6903,
running ginkgo tests in parallel while trying to skip wasn't working.
However, now that
https://github.com/kubernetes-sigs/cri-tools/pull/930 has fixed the
issue upstream, we can revert back to running our tests in parallel
with the skip.
2022-05-12 13:41:55 -04:00