Commit Graph

11596 Commits

Author SHA1 Message Date
Maksym Pavlenko
b7b0ee060c
Merge pull request #7891 from AkihiroSuda/integration-in-docker
contrib/Dockerfile.test: add "integration", "cri-integration", "critest" stages
2023-01-03 20:27:43 -08:00
Maksym Pavlenko
0d6e61a609
Merge pull request #7914 from changweige/fix-tracing-doc-typo
docs: fix a typo in tracing documentation
2023-01-03 20:26:51 -08:00
Changwei Ge
88c8d2e39c docs: fix a typo in tracing documentation
It should be "daemon"

Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
2023-01-04 10:27:36 +08:00
Derek McGowan
8b15917123
Merge pull request #7913 from kevpar/rate-limit
CI: Pass GITHUB_TOKEN to containerd/project-checks
2023-01-03 16:39:59 -08:00
Kevin Parsons
79d09c69b4 CI: Pass GITHUB_TOKEN to containerd/project-checks
Previously the project-checks action was failing sometimes due to
hitting GitHub API rate limits. Since no token was supplied, the rate
limits were only 60 requests/hour keyed off the IP address of the
runner.

Now, passing GITHUB_TOKEN secret through to project-checks, we have a
limit of 1000 requests/hour for the whole repo. This should alleviate
the rate limits that were being seen.

I believe it is safe to pass this secret as project-checks is also owned
by the containerd organization. The secret is also scoped to the actions
run, and is invalidated upon completion.

project-checks version is also updated to the version that supports
repo-access-token input.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
2023-01-03 15:48:51 -08:00
Akihiro Suda
c6aa1db8e6
Merge pull request #7911 from mxpv/dupword
Enable dupword linter
2023-01-04 07:38:36 +09:00
Samuel Karp
f15563c26d
Merge pull request #7905 from dcantah/ctr-ocispec-plat 2023-01-03 14:33:06 -08:00
Maksym Pavlenko
06bfcd658c Enable dupword linter
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-01-03 12:47:16 -08:00
Danny Canter
0abc2f160c ctr: Add platform flag to 'oci spec' command
This adds in a simple flag to control what platform the spec it generates
is for. Useful to easily get a glance at whats the default across platforms.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-01-03 12:44:26 -08:00
Maksym Pavlenko
c5c636b7a9
Merge pull request #7907 from AkihiroSuda/vagrantfile-fix-virtualbox
Vagrantfile: fix disk resize error with VirtualBox
2023-01-03 12:08:02 -08:00
Mike Brown
b21d28b458
Merge pull request #7908 from AkihiroSuda/vagrantfile-fix-comments
Vagrantfile: fix comments about SELinux
2023-01-03 11:19:08 -06:00
Akihiro Suda
4adf3fb3af
Merge pull request #7906 from Iceber/use_label_uncompressed
Use the const labels.LabelUncompressed
2023-01-04 01:04:20 +09:00
Akihiro Suda
24a255ce96
Merge pull request #7850 from dmcgowan/sandbox-store-local-plugin
[sandbox] Add sandbox store plugin type
2023-01-04 00:21:06 +09:00
Akihiro Suda
12955d291e
Vagrantfile: fix comments about SELinux
SELinux has been enforcing since commit a7f24b29c2
(PR 4698, v1.5.0)

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-01-03 21:02:33 +09:00
Akihiro Suda
bb86c6e576
contrib/Dockerfile.test: add "integration", "cri-integration", "critest" stages
For ease of running the entire tests locally

```
cd contrib

docker build -t containerd-test -f Dockerfile.test --target integration ..
docker run --privileged containerd-test

docker build -t containerd-test -f Dockerfile.test --target cri-integration ..
docker run --privileged --sysctl net.ipv6.conf.all.disable_ipv6=0 containerd-test

docker build -t containerd-test -f Dockerfile.test --target critest ..
docker run --privileged --sysctl net.ipv6.conf.all.disable_ipv6=0 containerd-test
```

Tested on Ubuntu 22.10 (amd64, cgroup v2).

Known issues:
- cri-integration and critest: require `--sysctl net.ipv6.conf.all.disable_ipv6=0` to avoid
  errors like `failed to set bridge addr: could not add IP address to "cni0": permission denied`

- critest: Often fails due to Docker Hub rate limits. Fix is coming in kubernetes-sigs/cri-tools PR 1053

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-01-03 20:19:38 +09:00
Akihiro Suda
5e84f08c4a
Vagrantfile: fix disk resize error with VirtualBox
Fix the following error with VirtualBox:
```
VirtualBox Provider:
* The following settings shouldn't exist: disk
```

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-01-03 20:13:42 +09:00
Akihiro Suda
88c8480a38
Merge pull request #7893 from AkihiroSuda/fix-7890
Fix TestUpdateContainerResources_Memory* on cgroup v2 hosts
2023-01-03 19:52:50 +09:00
Iceber Gu
778e8f2af4 Use the const labels.LabelUncompressed
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2023-01-03 18:29:21 +08:00
Akihiro Suda
a0b8401ea9
Merge pull request #7904 from dcantah/cri-misc-fixes
CRI: Comment cleanup/misc fixes
2023-01-03 16:08:54 +09:00
Danny Canter
3f0edb249b CRI: Comment cleanup/misc fixes
Comments in initPlatform for Windows states that the options were
Linux specific. Additionally properly wrap an error after trying
to setup CDI on Linux.

Signed-off-by: Danny Canter <danny@dcantah.dev>
2023-01-02 18:55:31 -08:00
Fu Wei
9a7c264d25
Merge pull request #5674 from dmcgowan/metadata-snapshot-publish 2023-01-03 09:23:48 +08:00
Fu Wei
93370c806b
Merge pull request #7887 from AkihiroSuda/vagrantfile-remove-setenforce-0 2023-01-03 08:49:25 +08:00
Derek McGowan
5e2b7c5b7a
Merge pull request #7894 from my-git9/cleanup/errdefs
reused package errdefs for error
2023-01-02 11:57:58 -08:00
Derek McGowan
1d43149c79
Merge pull request #7888 from AkihiroSuda/integration-images-switch-away-from-dockerhub
integration/images: switch away from Docker Hub to avoid rate limit
2023-01-02 11:33:54 -08:00
xin.li
1753e5af7a Reused errdefs for error
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-01-02 21:39:20 +08:00
Akihiro Suda
5a00d28a6f
Fix TestUpdateContainerResources_Memory* on cgroup v2 hosts
Fix issue 7890

Tested on Ubuntu 22.10, with swapon and swapoff:
```
$ GITHUB_WORKSPACE="" ENABLE_CRI_SANDBOXES="" CONTAINERD_RUNTIME=io.containerd.runc.v2 FOCUS=TestUpdateContainerResources_Memory make cri-integration
...
=== RUN   TestUpdateContainerResources_MemorySwap
    container_update_resources_test.go:161: Create a sandbox
INFO[0000] Using the following image list: {Alpine:docker.io/library/alpine:latest BusyBox:docker.io/library/busybox:latest Pause:registry.k8s.io/pause:3.8 ResourceConsumer:registry.k8s.io/e2e-test-images/resource-consumer:1.10 VolumeCopyUp:ghcr.io/containerd/volume-copy-up:2.1 VolumeOwnership:ghcr.io/containerd/volume-ownership:2.1}
    main_test.go:663: Image "registry.k8s.io/pause:3.8" already exists, not pulling.
    container_update_resources_test.go:174: Create a container with memory limit but no swap
    container_update_resources_test.go:186: Check memory limit in container OCI spec
    container_update_resources_test.go:194: Check memory limit in container OCI spec
    container_update_resources_test.go:200: Start the container
    container_update_resources_test.go:205: Check memory limit in cgroup
    container_update_resources_test.go:211: Update container memory limit after started
    container_update_resources_test.go:217: Check memory limit in container OCI spec
    container_update_resources_test.go:222: Check memory limit in cgroup
--- PASS: TestUpdateContainerResources_MemorySwap (0.88s)
=== RUN   TestUpdateContainerResources_MemoryLimit
    container_update_resources_test.go:228: Create a sandbox
    main_test.go:663: Image "registry.k8s.io/pause:3.8" already exists, not pulling.
    container_update_resources_test.go:238: Create a container with memory limit
    container_update_resources_test.go:249: Check memory limit in container OCI spec
    container_update_resources_test.go:257: Update container memory limit after created
    container_update_resources_test.go:263: Check memory limit in container OCI spec
    container_update_resources_test.go:269: Start the container
    container_update_resources_test.go:274: Check memory limit in cgroup
    container_update_resources_test.go:280: Update container memory limit after started
    container_update_resources_test.go:286: Check memory limit in container OCI spec
    container_update_resources_test.go:292: Check memory limit in cgroup
--- PASS: TestUpdateContainerResources_MemoryLimit (0.91s)
PASS
```

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-01-02 13:15:38 +09:00
Akihiro Suda
a5ea5935b7
integration/images: switch away from Docker Hub to avoid rate limit
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-01-02 05:49:30 +09:00
Akihiro Suda
119bbec9e2
Vagrantfile: install-rootless-podman: remove setenforce 0
rootless overlayfs is compatible with SELinux since kernel 5.13

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-01-02 03:01:48 +09:00
Samuel Karp
d769f03592
Merge pull request #7882 from kinvolk/rata/userns-stateless-pods 2022-12-30 23:42:59 -08:00
Fu Wei
426175e517
Merge pull request #7881 from Iceber/sort_content_labels 2022-12-31 11:30:32 +08:00
Rodrigo Campos
72ef986222 cri: Simplify parseUsernsIDs()
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2022-12-30 16:49:28 -03:00
Rodrigo Campos
4eed20fc31 cri: Verify userns container config is consisten with sandbox
The sandbox and container both have the userns config. Lets make sure
they are the same, therefore consistent.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2022-12-30 15:07:54 -03:00
Rodrigo Campos
a44b356274 cri: Fix assert vs require in tests
Currently we require that c.containerSpec() does not return an error
if test.err is not set.

However, if the require fails (i.e. it indeed returned an error) the
rest of the code is executed anyways. The rest of the code assumes it
did not return an error (so code assumes spec is not nil). This fails
miserably if it indeed returned an error, as spec is nil and go crashes
while running the unit tests.

Let's require it is not an error, so code does not continue to execute
if that fails and go doesn't crash.

In the test.err case is not harmful the bug of using assert, but let's
switch it to require too as that is what we really want.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2022-12-30 14:02:10 -03:00
Samuel Karp
b0b28f1d8e
Merge pull request #7879 from fuweid/clean-build-tags 2022-12-30 00:22:03 -08:00
Samuel Karp
5cf6040cce
Merge pull request #7880 from kinvolk/rata/userns-stateless-pods 2022-12-30 00:18:15 -08:00
Iceber Gu
6b333fd210 ctr contents ls sorts the labels of the content
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2022-12-30 15:58:47 +08:00
Rodrigo Campos
3b48fb5b59 cri: Shadow variables to avoid t.Parallel() issues
This is a follow-up suggested by Fu Wei.

Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2022-12-29 18:16:20 -03:00
Mike Brown
66f186d42d
Merge pull request #7679 from kinvolk/rata/userns-stateless-pods
Add support for user namespaces in stateless pods (KEP-127)
2022-12-29 14:08:24 -06:00
Wei Fu
6b7e237fc7 chore: use go fix to cleanup old +build buildtag
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-12-29 14:25:14 +08:00
Derek McGowan
cfe7ac9956
Merge pull request #7529 from iyear/refactor-metastore-tx
Refactor metastore transaction
2022-12-28 20:08:38 -08:00
Derek McGowan
729206f6d0
Merge pull request #7874 from thaJeztah/appendOSMounts_error
oci: appendOSMounts(): remove unused error, and move
2022-12-28 20:04:06 -08:00
Akihiro Suda
ec67e05738
Merge pull request #7863 from pacoxu/v1.26-kube
add kube v1.26: remove v1alph2 cri support
2022-12-29 02:47:37 +09:00
iyear
1d0619bc0c Refactor metastore transaction
Signed-off-by: Junyu Liu <ljyngup@gmail.com>
2022-12-28 18:37:28 +08:00
Fu Wei
aee92eb46e
Merge pull request #7875 from yanggangtony/runc-version
make runc 1.1 for oss_fuzz_build.sh
2022-12-28 10:42:18 +08:00
Rodrigo Campos
ca69ae2656 Add integration tests for CRI userns
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2022-12-27 22:01:12 -03:00
Derek McGowan
27f43506b4
Merge pull request #7872 from yanggangtony/cri-sbserver
CRI sbserver: Prevent server reuse after Shutdown
2022-12-27 15:54:29 -08:00
Derek McGowan
ba243ffaaf
Merge pull request #7521 from iyear/fix-defer
Fix incorrect defer usage and refactor judgement
2022-12-27 15:50:41 -08:00
Fu Wei
4fe2d14e1b
Merge pull request #7869 from dcantah/domainname-oci
oci: Add WithDomainname
2022-12-27 19:18:12 +08:00
yanggang
09243e43ff
make runc 1.1 for oss_fuzz_build.sh
Signed-off-by: yanggang <gang.yang@daocloud.io>
2022-12-27 18:25:53 +08:00
Sebastiaan van Stijn
94c68aa001
oci: appendOSMounts(): remove unused error, and move
This function was added in ae22854e2b, but never
returned an error, and the error-return was not handled on the callsite. This
patch removes the unused error return, and moves it to a file related to mounts,
which allowed for some of the stubs to be removed and shared between non-FreeBSD
platforms.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2022-12-27 10:23:26 +01:00