Commit Graph

166 Commits

Author SHA1 Message Date
Derek McGowan
6f027e38a8
Remove redundant build tags
Remove build tags which are already implied by the name of the file.
Ensures build tags are used consistently

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-08-05 22:27:46 -07:00
Alakesh Haloi
3c5424454b [otel-tracing] vendor and go modules changes
This tracks all the vendor file changes and changes to go modules due
to OpenTelemetry support

Signed-off-by: Alakesh Haloi <alakeshh@amazon.com>
2021-08-04 14:25:12 -07:00
Jayme Howard
ce437864b2 mergo: Upgrade to 0.3.12 to fix panic
Signed-off-by: Jayme Howard <g.prime@gmail.com>

Run `go mod tidy`

Signed-off-by: Jayme Howard <g.prime@gmail.com>

Follow correct procedure by running `make vendor`

Signed-off-by: Jayme Howard <g.prime@gmail.com>
2021-07-29 12:20:09 -05:00
Derek McGowan
caf9e256b7
Merge pull request #5693 from kzys/sigrtmin
Support SIGRTMIN+n signals
2021-07-27 11:58:57 -07:00
Derek McGowan
6d31cdda50
Merge pull request #5716 from dims/add-new-go-module-for-api-directory
Introduce a new go module - containerd/api for use in standalone clients
2021-07-27 09:37:10 -07:00
Davanum Srinivas
494b940f14
Introduce a new go module - containerd/api for use in standalone clients
In containerd 1.5.x, we introduced support for go modules by adding a
go.mod file in the root directory. This go.mod lists all the things
needed across the whole code base (with the exception of
integration/client which has its own go.mod). So when projects that
need to make calls to containerd API will pull in some code from
containerd/containerd, the `go mod` commands will add all the things
listed in the root go.mod to the projects go.mod file. This causes
some problems as the list of things needed to make a simple API call
is enormous. in effect, making a API call will pull everything that a
typical server needs as well as the root go.mod is all encompassing.
In general if we had smaller things folks could use, that will make it
easier by reducing the number of things that will end up in a consumers
go.mod file.

Now coming to a specific problem, the root containerd go.mod has various
k8s.io/* modules listed. Also kubernetes depends on containerd indirectly
via both moby/moby (working with docker maintainers seperately) and via
google/cadvisor. So when the kubernetes maintainers try to use latest
1.5.x containerd, they will see the kubernetes go.mod ending up depending
on the older version of kubernetes!

So if we can expose just the minimum things needed to make a client API
call then projects like cadvisor can adopt that instead of pulling in
the entire go.mod from containerd. Looking at the existing code in
cadvisor the minimum things needed would be the api/ directory from
containerd. Please see proof of concept here:
github.com/google/cadvisor/pull/2908

To enable that, in this PR, we add a go.mod file in api/ directory. we
split the Protobuild.yaml into two, one for just the things in api/
directory and the rest in the root directory. We adjust various targets
to build things correctly using `protobuild` and also ensure that we
end up with the same generated code as before as well. To ensure we
better take care of the various go.mod/go.sum files, we update the
existing `make vendor` and also add a new `make verify-vendor` that one
can run locally as well in the CI.

Ideally, we would have a `containerd/client` either as a standalone repo
or within `containerd/containerd` as a separate go module. but we will
start here to experiment with a standalone api go module first.

Also there are various follow ups we can do, for example @thaJeztah has
identified two tasks we could do after this PR lands:

github.com/containerd/containerd/pull/5716#discussion_r668821396

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-07-27 07:34:59 -04:00
Derek McGowan
b5b5dcc273
Merge pull request #5162 from claudiubelu/integration-test-images
integration: Windows volume-copy-up images
2021-07-26 17:29:40 -07:00
Kazuyoshi Kato
1d3d08026d Support SIGRTMIN+n signals
systemd uses SIGRTMIN+n signals, but containerd didn't support the signals
since Go's sys/unix doesn't support them.

This change introduces SIGRTMIN+n handling by utilizing moby/sys/signal.

Fixes #5402.

https://www.freedesktop.org/software/systemd/man/systemd.html#Signals

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-07-26 09:36:43 -07:00
Kazuyoshi Kato
00d52bb159 integration: log all processes to investigate the test failure
The test is failing on
https://github.com/containerd/containerd/runs/3129202049#step:10:43.

I'd like to know whether the order of the array is the cause, or
the result is completely off.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-07-21 16:54:04 -07:00
Akihiro Suda
a12c7bd1cf
go.mod: runc v1.0.1
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-07-18 20:39:34 +09:00
Derek McGowan
18321f539c
Move loop check to before sleep
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-07-13 12:07:21 -07:00
Derek McGowan
2e8a572dfd
Add timestamp to flaky restart monitor test
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-07-13 12:07:21 -07:00
Akihiro Suda
55fd2ab5d6
integration/client: go mod tidy
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-07-13 14:36:02 +09:00
Maksym Pavlenko
d38c186d9d
Merge pull request #5578 from claudiubelu/integration/failed-container
test integration: Adds a test that restarts a failed container
2021-07-09 12:08:20 -07:00
Phil Estes
cf600abecc
Merge pull request #5619 from mikebrow/cri-add-v1-proxy-alpha
[CRI] move up to CRI v1 and support v1alpha in parallel
2021-07-09 14:07:24 -04:00
Claudiu Belu
16deba098c integration: Windows volume-copy-up images
For Windows, the container image's OS version must closely match the host's OS version.
For this reason, we need to add the --os-version annotation in image manifest lists,
so the Windows nodes can pull the appropriate image from the list.

Previously, the docker manifest CLI did not have the capability to set the --os-version,
it, but it has been introduced in docker 20.10.0.

We're also adding busybox.exe in the image, so we can run Linux commands inside the
container, so the tests will be simpler.

When building Windows images, a docker buildx builder needs to be created and used. When
building Windows images with docker buildx, the flag --output=type=registry is required,
otherwise it cannot be referenced on a Linux node.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-06-30 11:19:54 +00:00
Mike Brown
a5c417ac06 move up to CRI v1 and support v1alpha in parallel
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-06-28 09:34:12 -05:00
Claudiu Belu
04ab4418fd test integration: Adds a test that restarts a failed container
If a container failed to start due to a bad command, the container could not be
recreated with a proper command in its stead. Adds a test that verifies this scenario.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-06-25 10:33:38 +00:00
Akihiro Suda
e1f28659bc
Merge pull request #5287 from claudiubelu/cri-integration-cleanup
Cri integration cleanup
2021-06-25 12:42:33 +09:00
Davanum Srinivas
d9694b2976
Sync integration/go.mod with root go.mod
the root go.mod no longer pins these two imports to specific versions

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-06-21 16:32:07 -04:00
ktock
cd33c007ce CI: Switch to available latest images
`mirror.gcr.io/library/busybox:1.32.0` is unavailable.

```console
$ curl -s https://mirror.gcr.io//v2/library/busybox/tags/list | jq '.tags'
[
  "1.26.2",
  "1.27.2",
  "1.28",
  "1.29",
  "1.29.2",
  "1.29.3",
  "1.30",
  "1.30.1",
  "1.31",
  "1.31.0",
  "1.31.1",
  "1.32",
  "latest"
]
```

`mirror.gcr.io/library/alpine:3.13` is unavailable.

```console
$ curl -s https://mirror.gcr.io//v2/library/alpine/tags/list | jq '.tags'
[
  "20200428",
  "3",
  "3.10",
  "3.11",
  "3.12",
  "3.12.0",
  "3.12.1",
  "3.13.5",
  "3.3",
  "3.4",
  "3.6",
  "3.7",
  "3.8",
  "3.9",
  "latest"
]
```

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2021-06-21 14:54:50 +09:00
Davanum Srinivas
01585595a5
update integration/client go.sum
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-06-07 09:12:41 -04:00
Claudiu Belu
cabe677369 tests: Use EnsureImageExists for image pulling
A previous commit introduced EnsureImageExists, which ensures that a particular image
already exists. It also deduplicates the image pulling code. Some tests missed this
update.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-06-03 16:02:42 +00:00
Claudiu Belu
a78bdf22df tests: Refactors PodSandbox creation
Most of the tests creating and using Pod Sandboxes in the same way. We can create
a common function that will do that for us, so we can have less duplicated code,
and make it easier to add new tests in the future.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-06-03 16:02:38 +00:00
Claudiu Belu
93e268f625 tests: Symlink volume tests
There was a known issue regarding how the symlink files mounted as
volumes were being handled on Windows. This commit adds tests that
will check against those issue to ensure there won't be any
regressions.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-06-03 13:26:22 +00:00
Ma Xinjian
e1c845df50 Fix small typo
Signed-off-by: Ma Xinjian <maxj.fnst@fujitsu.com>
2021-05-24 11:49:55 +08:00
Priyanka Saggu
ec28288f45
bump runc version to v1.0.0-rc95
Signed-off-by: Priyanka Saggu <priyankasaggu11929@gmail.com>
2021-05-19 17:24:56 +05:30
Phil Estes
a152049d7d
Merge pull request #5163 from claudiubelu/test-windows
tests: Adds support for Windows cri-integration tests
2021-05-17 09:24:31 -04:00
Priyanka Saggu
b6a2517491
bump hcsshim version to v0.8.17
Signed-off-by: Priyanka Saggu <priyankasaggu11929@gmail.com>
2021-05-16 01:38:43 +05:30
Claudiu Belu
09a0c9471b tests: Adds support for Windows cri-integration tests
Currently, the cri-integration tests do not work on Windows due to various reasons.
One of the reasons is because all the tests are using Linux-specific images.
Previous commits refactored the image pulling / usage in the cri-integration tests,
making it easier to update, and easier to configure a custom registry to pull images
with Windows support.

For Windows runs, custom registries can be created, which will also contain Windows
images, and the cri-integration tests can be configured to use those registries by
specifying the "--repo-list" argument, a YAML file which will contain an alternative
mapping of the default registries. This is similar to how E2E tests are handled for
Windows runs in Kubernetes.

Some of the tests are Skipped, as they do not pass yet on Windows.

Windows does not collect inodes used stats, thus, the tests that were expecting non-zero
inodes stats were failing.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-05-14 11:27:35 +00:00
Derek McGowan
fc4da9728e Pin integration test image for alpine
The latest tag is no longer available for alpine, pin
to the latest version rather than using latest

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-05-13 14:10:59 -04:00
Fu Wei
c7e4747cfb
Merge pull request #5313 from claudiubelu/pull-images-once
cri-integration tests: Pull images once
2021-05-13 11:10:52 +08:00
Sebastiaan van Stijn
e26fc84729
go.mod: cut circular dependency on github.com/containerd/containerd
This forces vendoring to only take dependencies of this repository to
be taken into account, effectively cutting the circular dependency (for
the vendored code), and to prevent depending on transitive dependencies
coming from older versions of containerd.

go mod does not allow using the main module as a local "replace" rule using
a path; see golang/go#45492 and golang/go#34417, so instead, an empty module
is used.

One change observed is that older versions containerd depended on an older
version of imgcrypt that had an "indirect" dependency on more current versions
of gopkg.in/yaml.v2 and prometheus/procfs.

For those, a temporary "indirect" dependency was added, until prometheus/client_golang
and kubernetes are updated.

from go mod graph (before):

    github.com/containerd/imgcrypt@v1.0.4-0.20210301171431-0ae5c75f59ba gopkg.in/yaml.v2@v2.4.0
    github.com/containerd/imgcrypt@v1.0.4-0.20210301171431-0ae5c75f59ba github.com/prometheus/procfs@v0.6.0

For some reason, some older versions of containerd are still taken into account,
causing satori/go.uuid to be added as "indirect" dependency, likely because some
modules have this dependency in their go.sum. This should likely disappear once
those plugins are updated to contain a current version of containerd.

    git grep 'github.com/satori/go.uuid'
    vendor/github.com/Microsoft/hcsshim/go.sum:github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
    vendor/github.com/containerd/aufs/go.sum:github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
    vendor/github.com/containerd/imgcrypt/go.sum:github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
    vendor/github.com/containerd/nri/go.sum:github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
    vendor/github.com/containerd/zfs/go.sum:github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-05-01 13:49:23 +02:00
Sebastiaan van Stijn
15e0bd513e
integration/client: go mod tidy
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-05-01 13:11:55 +02:00
Claudiu Belu
3187b6dc81 tests: Adds consumed memory stats test
We can check that the reported containers stats are not lower than it should
by using the resource-consumer image. This image contains stress / testlimit.exe
which can consume a specified amount of memory.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-04-29 14:11:34 +00:00
Claudiu Belu
273c2bb168 tests: Prepull images used in tests
Most of the tests are pulling and deleting the same test images, which
can be quite inefficient, especially on Windows nodes, where the images
are larger than the Linux ones (a nanoserver Container image is ~250MB
in size). We can instead pull them only once, and reuse them. This will
reduce the test run time on Windows considerably.

Additionally, some of the test images are currently hosted on dockerhub
(busybox image), which has introduced image ratelimiting in November 2020,
which means that test runners could potentially hit that limit faster with
the current implementation. This will reduce that risk.

Some tests are specifically deleting images, so we always have to ensure
that they are pulled.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-04-28 09:43:39 +00:00
Claudiu Belu
5847340a7d tests: Refactors container image usage
Currently, the cri-integration tests do not work on Windows due to various reasons.
One of the reasons is because all the tests are using Linux-specific images. This
commit refactors the image pulling / usage in the cri-integration tests, making it
easier to update, and easier to configure the a custom registry to pull those images
from.

For Windows runs, custom registries can be created, which will also contain Windows
images, and the cri-integration tests can be configured to use those registries by
specifying the "--image-list" argument, a TOML file which will contain an alternative
mapping of the default images.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-04-27 08:44:21 +00:00
Davanum Srinivas
2e4c1d4b74
Use the multi-arch version of the test images
volume-copy-up:2.0 and volume-ownership:2.0

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-04-25 17:49:57 -04:00
Davanum Srinivas
1b5d59dfe2
Add multi-arch support for test images
- Add a multi-arch image with linux/amd64 and linux/arm64 (limit to just
  what we are running in CI)
- Bump versions to 2.0 as 1.0 is the single-arch image
- Use `docker buildx` instead of just docker, so we don't need to build
  manifests by hand
- busybox now does not have `nogroup`, since the test needs it, switch
  over from busybox to ubuntu for just the volume-ownership image

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-04-23 15:07:33 -04:00
Derek McGowan
3ef337ae3a
Update containerd vendors to tags
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-04-19 10:59:29 -07:00
Akihiro Suda
d2d0afac05
Merge pull request #5385 from thaJeztah/bump_kubernetes_1.20.6 2021-04-19 23:42:33 +09:00
Sebastiaan van Stijn
5d79d3adbc
go.mod: update kubernetes to v1.20.6
Includes updated protos with the gogo/protobuf fixes for CVE-2021-3121
(https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3121)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-19 09:43:25 +02:00
Sebastiaan van Stijn
1c03c377e5
go.mod: github.com/containerd/fifo v1.0.0
full diff: https://github.com/containerd/fifo/compare/115abcc95a1d...v1.0.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-19 09:27:45 +02:00
Sebastiaan van Stijn
12a2a21083
go.mod: github.com/google/uuid v1.2.0
full diff: https://github.com/google/uuid/compare/v1.1.2...v1.2.0

I did not switch to us the `uuid.NewString()` function; we are not currently using
`uuid.New()`, probably because it can `panic` in case an invalid UUID is produced;
in stead we are using `uuid.NewRandom()`, which is equivalent, but returns an
error instead.

Changes:

- v1.2.0: Add NewString()
  This release introduces the NewString() function which is the equivalent of
  uuid.New().String().
- v1.1.5: Syntactic cleanup
  There are no code changes. A missing period was add to a godoc comment and the
  linter was told to not complain that the results of hash.Write() are ignored
  (the function cannot fail)
- v1.1.4: Further error optimizations
  Do not allocate memory for errors (it is only one word)
- v1.1.3: Optimize error reporting
  Optimize length of time it takes to discover an input is bad by no longer using
  fmt.Errorf, which is quite slow. It now uses a custom error type that formats
  the string when the Error method is called rather than when generating the error.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-17 12:06:51 +02:00
Sebastiaan van Stijn
864a3322b3
go.mod: github.com/containerd/go-cni v1.0.2
full diff: https://github.com/containerd/go-cni/compare/v1.0.1...v1.0.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-14 09:09:18 +02:00
Derek McGowan
c381ea27bd
Merge pull request #5213 from thaJeztah/bump_typeurl
go.mod: github.com/containerd/typeurl v1.0.2
2021-04-13 20:31:25 -07:00
Derek McGowan
824b61075f
Merge pull request #5350 from thaJeztah/tagged_go_winio
go.mod: github.com/Microsoft/go-winio v0.4.17
2021-04-13 20:29:44 -07:00
Sebastiaan van Stijn
ee34caccb3
go.mod: github.com/Microsoft/go-winio v0.4.17
no code changes as this is the same commit, but now tagged:

https://github.com/Microsoft/go-winio/compare/5516f17a5958...v0.4.17

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-13 23:56:53 +02:00
Sebastiaan van Stijn
d478676d35
go.mod: github.com/containerd/imgcrypt v1.1.1
No code changes other than an updated changelog, and updating to
the tagged v1.1.1:

diff: https://github.com/containerd/imgcrypt/compare/0bed51b9522c...v1.1.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-13 23:41:44 +02:00
Sebastiaan van Stijn
1dd45d51c7
go.mod: github.com/containerd/typeurl v1.0.2
full diff: https://github.com/containerd/typeurl/compare/v1.0.1...v1.0.2

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-13 23:21:21 +02:00