Commit Graph

13325 Commits

Author SHA1 Message Date
Maksym Pavlenko
2b92c70fa4 Fix command line parsing for image list
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-25 14:19:40 -07:00
Daniel Canter
14003683f0 go.mod: Bump hcsshim to v0.9.4
This tag contains some fixes for hostprocess containers, mainly around
fixing task stats which regressed from a change in v0.9.3.

https://github.com/microsoft/hcsshim/releases/tag/v0.9.4

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-07-25 13:24:34 -07:00
James Jenkins
1e0698e8e8 Fix CRI image pull timeout test for ppc64le
The ghcr.io/containerd/registry:2.7 image does not support the ppc64le
architecture, causing the TestCRIImagePullTimeout tests to fail when
executed on a ppc64le device.

Replace the ghcr.io/containerd/registry:2.7 image name and index with
the ghcr.io/containerd/volume-ownership:2.1 image and index in the
HoldingContentOpenWriter test.

Change the image pulled in the NoDataTransferred test to the
ghcr.io/containerd/volume-ownership:2.1 image.

Signed-off-by: James Jenkins <James.Jenkins@ibm.com>
2022-07-25 16:11:42 -04:00
Daniel Canter
c15d8e1560 go.mod: Bump hcsshim to 0.9.3
This tag brings in a new field to fix an HNS issue in ws2019 as well as
an optimization for collecting Windows stats (memory, cpu, iops).

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2022-07-25 13:03:39 -07:00
Maksym Pavlenko
a9514da757 Update image references for Windows tests
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-25 11:04:59 -07:00
Maksym Pavlenko
2ae5f405d2 Use image lists instead of hardcoded images
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-25 10:54:17 -07:00
Maksym Pavlenko
552d763447 Use image lists in client tests
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-25 10:47:00 -07:00
zounengren
d121efc6d8 replace with selinux label
Signed-off-by: zounengren <zouyee1989@gmail.com>
2022-07-24 20:11:16 +08:00
zounengren
20e7b399f9 prevent Server reuse after a Shutdown
Signed-off-by: zounengren <zouyee1989@gmail.com>
2022-07-24 15:55:16 +08:00
Wei Fu
e6a2c07902 integration: simplify CNI-fp and add README.md
* Use delegated plugin call to simplify cni-bridge-cni
* Add README.md for cni-bridge-cni

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-07-24 11:45:45 +08:00
cosmoer
344431cdd4 fix: support simultaneous create diff for same parent snapshot
Signed-off-by: Qian Zhang <cosmoer@qq.com>
2022-07-24 09:34:54 +08:00
Akihiro Suda
db3ecb286b
Merge pull request #7203 from jeffwidman/drop-deprecated-ioutil
Drop deprecated `ioutil`
2022-07-24 03:18:04 +09:00
Jeff Widman
050cd58ce6 Drop deprecated ioutil
`ioutil` has been deprecated by golang. All the code in `ioutil` just
forwards functionality to code in either the `io` or `os` packages.

See https://github.com/golang/go/pull/51961 for more info.

Signed-off-by: Jeff Widman <jeff@jeffwidman.com>
2022-07-23 08:36:20 -07:00
Fu Wei
b0b9c0fb3f
Merge pull request #7201 from mxpv/service-opts 2022-07-23 16:54:28 +08:00
Maksym Pavlenko
500ff95f02 Make getServicesOpts a helper
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-22 19:38:45 -07:00
Fu Wei
294c61fbab
Merge pull request #7183 from mikebrow/add-service-environment-for-sandboxed 2022-07-23 10:20:39 +08:00
Mike Brown
ee6fc5c2ef adds an env var commented out for sandboxed mode
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2022-07-22 17:13:25 -05:00
Wei Fu
cbebeb9440 pkg/failpoint: add FreeBSD link and update pkg doc
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-07-22 23:25:40 +08:00
Wei Fu
3c5e80b63e integration: Add injected failpoint testing for RunPodSandbox
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-07-22 23:25:40 +08:00
Wei Fu
be91a219c2 integration: CNI bridge wrapper with failpoint
Introduce cni-bridge-fp as CNI bridge plugin wrapper binary for CRI
testing.

With CNI `io.kubernetes.cri.pod-annotations` capability enabled, the user
can inject the failpoint setting by pod's annotation
`cniFailpointControlStateDir`, which stores each pod's failpoint setting
named by `${K8S_POD_NAMESPACE}-${K8S_POD_NAME}.json`.

When the plugin is invoked, the plugin will check the CNI_ARGS to get
the failpoint for the CNI_COMMAND from disk. For the testing, the user
can prepare setting before RunPodSandbox.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-07-22 23:25:40 +08:00
Wei Fu
1ae6e8b076 pkg/failpoint: add DelegatedEval API
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-07-22 23:25:40 +08:00
Wei Fu
b297775eaf runtime/v2/shim: return if error in load plugin
If there is any unskipable error during setuping shim plugins, we should
fail return error to prevent from leaky shim instance. For example,
there is error during init task plugin, the shim ttrpc server will not
contain any shim API method. The any call to the shim will receive that

  failed to create shim task: service containerd.task.v2.Task: not implemented

Then containerd can't use `Shutdown` to let the shim close. The shim
will be leaky. And also fail return if there is no ttrpc service.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-07-22 23:25:40 +08:00
Wei Fu
5f9b318e50 bin/ctr,integration: new runc-shim with failpoint
Added new runc shim binary in integration testing.

The shim is named by io.containerd.runc-fp.v1, which allows us to use
additional OCI annotation `io.containerd.runtime.v2.shim.failpoint.*` to
setup shim task API's failpoint. Since the shim can be shared with
multiple container, like what kubernetes pod does, the failpoint will be
initialized during setup the shim server. So, the following the
container's OCI failpoint's annotation will not work.

This commit also updates the ctr tool that we can use `--annotation` to
specify annotations when run container. For example:

```bash
➜  ctr run -d --runtime runc-fp.v1 \
     --annotation "io.containerd.runtime.v2.shim.failpoint.Kill=1*error(sorry)" \
     docker.io/library/alpine:latest testing sleep 1d

➜  ctr t ls
TASK       PID       STATUS
testing    147304    RUNNING

➜  ctr t kill -s SIGKILL testing
ctr: sorry: unknown

➜  ctr t kill -s SIGKILL testing

➜  sudo ctr t ls
TASK       PID       STATUS
testing    147304    STOPPED
```

The runc-fp.v1 shim is based on core runc.v2. We can use it to inject
failpoint during testing complicated or big transcation API, like
kubernetes PodRunPodsandbox.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-07-22 23:25:40 +08:00
Wei Fu
822cc51d84 runtime/v2: manager supports server interceptor
Currently, the runc shimv2 commandline manager doesn't support ttrpc
server's customized option, for example, the ttrpc server interceptor.
This commit is to allow the task plugin can return the
`UnaryServerInterceptor` option to the manager so that the task plugin
can do enhancement before handling the incoming request, like API-level
failpoint control.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-07-22 23:25:40 +08:00
Wei Fu
ffd59ba600 pkg/failpoint: init failpoint package
Failpoint is used to control the fail during API call when testing, especially
the API is complicated like CRI-RunPodSandbox. It can help us to test
the unexpected behavior without mock. The control design is based on freebsd
fail(9), but simpler.

REF: https://www.freebsd.org/cgi/man.cgi?query=fail&sektion=9&apropos=0&manpath=FreeBSD%2B10.0-RELEASE

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-07-22 23:25:40 +08:00
Fu Wei
05a71fdc28
Merge pull request #7198 from endocrimes/dani/fix-panic 2022-07-22 23:23:45 +08:00
Danielle Lancashire
3125f7e1a0 cri_stats: handle missing cpu stats
Signed-off-by: Danielle Lancashire <dani@builds.terrible.systems>
2022-07-22 12:10:24 +00:00
Fu Wei
badb66113c
Merge pull request #7189 from zouyee/ctx 2022-07-22 11:09:02 +08:00
Mike Brown
f7bba3a751
Merge pull request #7173 from bobbypage/cgroup_e2e
test: Add ability to switch between  cgroupv1 or cgroupv2 for node e2e
2022-07-20 20:46:04 -05:00
Derek McGowan
24aad6dd46
Merge pull request #7182 from HeavenTonight/main
code cleanup
2022-07-20 13:09:10 -07:00
Derek McGowan
1455926416
Merge pull request #7114 from kinvolk/rata/userns-cri
Update k8s.io/cri-api to v0.25.0-alpha2
2022-07-20 13:06:58 -07:00
Derek McGowan
f1eced563e
Merge pull request #7186 from jsturtevant/windows-usage-nano-cores
Refactor usageNanoCores be to used for all OSes
2022-07-20 13:04:56 -07:00
Derek McGowan
0e6e05a0e8
Merge pull request #7191 from mikebrow/add-containerd.env-for-sbsandbox-mode-test
adds support for using env file for systemd boot
2022-07-20 13:04:35 -07:00
Kazuyoshi Kato
0d61fba052
Merge pull request #7185 from AkihiroSuda/testify-1.8.0
go.mod: github.com/stretchr/testify v1.8.0
2022-07-20 11:51:36 -07:00
Mike Brown
7eeec8987f adds support for using env file for systemd boot
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2022-07-20 12:52:10 -05:00
zounengren
7dc66eee64 using ContextDialer instead
Signed-off-by: zounengren <zouyee1989@gmail.com>
2022-07-20 22:53:42 +08:00
David Porter
6639b2b028 test: Add ability to switch between cgroupv1 or cgroupv2
For k8s e2e node tests, we want to be able to test both cgroupv1 and
cgroupv2 variants. Currently, the latest version of COS (M97) is running
as cgroupv2 and we would like the add the ability to switch to cgroupv1
for running tests on cgroupv1.

To do this, add a new flag, "CGROUP_MODE" which can be set as v1 or v2.
If the current cgroup configuration does not match the desired config,
the cgroup config will be set via `cgroup_helper` COS utility, and the
node will be rebooted.

Signed-off-by: David Porter <porterdavid@google.com>
2022-07-19 17:51:41 -07:00
James Sturtevant
0d6881898e Refactor usageNanoCores be to used for all OSes
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2022-07-19 16:49:08 -07:00
Akihiro Suda
f6bc986dc1
go.mod: github.com/stretchr/testify v1.8.0
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-07-20 08:36:10 +09:00
Derek McGowan
79fcc38b11
Merge pull request #7145 from junnplus/ctr-user
ctr: support --user for run/create
2022-07-19 13:07:37 -07:00
guiyong.ou
628f6ac681 code cleanup
Signed-off-by: guiyong.ou <guiyong.ou@daocloud.io>
2022-07-19 22:46:32 +08:00
Derek McGowan
11ded166c1
Merge pull request #7174 from oradwell/patch-1
docs: Fix sample config.toml syntax
2022-07-18 15:20:18 -07:00
Derek McGowan
e95858f93f
Merge pull request #7163 from thaJeztah/seccomp_support_pku
seccomp: seccomp: add syscalls related to PKU in default policy
2022-07-18 15:19:10 -07:00
Maksym Pavlenko
e69a83f356
Merge pull request #7168 from mxpv/linter
Update and align golangci-lint version
2022-07-18 12:23:06 -07:00
Maksym Pavlenko
8e66388f52
Merge pull request #7169 from mikebrow/test-sbsandbox
adds a comment explaining how to disable experimental sbserver
2022-07-18 12:22:28 -07:00
Derek McGowan
0bbba90480
Merge pull request #7177 from kzys/fix-cirrus
ci: workaround Cirrus CI's INVALID_ARGUMENT
2022-07-18 12:05:14 -07:00
Kazuyoshi Kato
cc30880e84 ci: workaround Cirrus CI's INVALID_ARGUMENT
We are constantly getting the message below from Cirrus CI;

> Machine type with name 'c2-standard-2' does not exist in zone 'us-central1-c'."

Seems Cirrus CI is constructing the machine type based on
the "cpu" field from the YAML file. However c2-standard's minimal vCPU
count is 4 based on the official document below.

https://cloud.google.com/compute/docs/compute-optimized-machines

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-07-18 17:48:25 +00:00
Oliver Radwell
d8d63a7aa3
docs: Fix sample config.toml syntax
Signed-off-by: Oliver Radwell <oliver.radwell@gmail.com>
2022-07-16 21:56:07 +01:00
Mike Brown
88bcbb0361 adds a comment explaining how to disable experimental sbserver
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2022-07-15 17:00:56 -05:00
Maksym Pavlenko
3a3f43f72f Fix linter warnings
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-07-15 13:29:04 -07:00