Commit Graph

11307 Commits

Author SHA1 Message Date
Adelina Tuvenie
23bc3db914 Enable critest on Windows
Signed-off-by: Adelina Tuvenie <atuvenie@cloudbasesolutions.com>
2021-07-27 16:35:38 +03: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
Maksym Pavlenko
158901756c
Merge pull request #5606 from zwtop/master
grpc config add options tcp_client_ca_cert
2021-07-26 20:57:29 -07: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
Maksym Pavlenko
ce3d6e9bfc
Merge pull request #5795 from mikebrow/cri-support-metrics
add CRI support matrix to RELEASES.md
2021-07-26 16:36:40 -07:00
Maksym Pavlenko
0def98e462
Merge pull request #5794 from mikebrow/clarify-host-docs
adding a little more clarity
2021-07-26 16:03:33 -07:00
Mike Brown
4fdb884644 add CRI support matrix to RELEASES.md
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-07-26 15:48:20 -05:00
Mike Brown
b5fc7846c4 adding a little more clarity
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-07-26 14:55:44 -05:00
Maksym Pavlenko
3a503acd50
Merge pull request #5793 from thaJeztah/gotestsum_1.7
update gotestsum to v1.7.0
2021-07-26 12:43:08 -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
Sebastiaan van Stijn
18d6cc1b06
update gotestsum to v1.7.0
Same as previous commit, but a release was tagged;

1a94380793...v1.7.0

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-26 13:13:17 +02:00
Derek McGowan
3b7a3d599b
Merge pull request #5756 from Kern--/discard-blocks
Discard blocks when removing a thin device
2021-07-23 14:52:15 -07:00
Derek McGowan
f6fa3fdd7b
Merge pull request #5590 from oss-qm/submit/makefile-tags
Makefile: fix passing build tags
2021-07-23 14:47:55 -07:00
Maksym Pavlenko
559f9a5b90
Merge pull request #5744 from mxpv/metrics
Add runtime label to metrics
2021-07-23 12:24:32 -07:00
Maksym Pavlenko
ee3272e9cf
Merge pull request #5745 from yylt/check
interface about shim build check
2021-07-23 10:09:44 -07:00
Maksym Pavlenko
c3f1f0e5ee
Merge pull request #5775 from kzys/pid-order
integration: log all processes to investigate the test failure
2021-07-23 10:09:04 -07:00
Maksym Pavlenko
efa8ab7158 Add runtime label to metrics
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-07-23 10:04:46 -07:00
AdamKorcz
6294235d81 Fuzzing: Add container fuzzer
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-07-23 13:01:29 +01:00
Sebastiaan van Stijn
2405671d40
platforms: add "ios" as known OS, "loong64" as known ARCH
- GOOS iOS was added in https://go-review.googlesource.com/c/go/+/254740, and part of go1.16beta1
- GOARCH loong64 was added in https://go-review.googlesource.com/c/go/+/333909, and currently only in master

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-23 10:56:08 +02:00
Fu Wei
a963242f78
Merge pull request #5779 from AdamKorcz/fuzz4 2021-07-23 09:28:17 +08:00
AdamKorcz
2556aac675 Fuzzing: Add archive fuzzer
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-07-22 16:39:27 +01:00
yylt
0d45ac14e9 interface about shim build check
Signed-off-by: Yang Yang <yang8518296@163.com>
2021-07-22 09:03:12 +08: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
Fu Wei
a137b64f50
Merge pull request #5687 from AdamKorcz/fuzz3 2021-07-22 07:28:48 +08:00
Derek McGowan
ee27cde735
Merge pull request #5735 from ktock/diffcompression
Support custom compressor for walking differ
2021-07-21 09:06:46 -07:00
Kern Walster
f1d79d33b8 Discard blocks when removing a thin device
dmsetup does not discard blocks when removing a thin device. The unused blocks
are reused by the thin-pool, but will remain allocated in the underlying
device indefinitely. For loop device backed thin-pools, this results in
"lost" disk space in the underlying file system as the blocks remain allocated
in the loop device's backing file.

This change adds an option, discard_blocks, to the devmapper snapshotter which
causes the snapshotter to issue blkdiscard ioctls on the thin device before
removal. With this option enabled, loop device setups will see disk space
return to the underlying filesystem immediately on exiting a container.

Fixes #5691

Signed-off-by: Kern Walster <walster@amazon.com>
2021-07-21 16:06:29 +00:00
Phil Estes
6389fc79f0
Merge pull request #5770 from wzshiming/fix/push-docker-remote-close
remotes/docker/pusher.go: Fix missing Close() on push to docker remote
2021-07-21 10:06:41 -04:00
Phil Estes
5a874e0812
Merge pull request #5769 from wzshiming/fix/fetch-docker-remote-close
remotes/docker/fetcher.go: Fix missing Close() on fetch from docker remote
2021-07-21 10:05:27 -04:00
Phil Estes
e325184c8c
Merge pull request #5771 from thaJeztah/update_md2man
Update cpuguy83/go-md2man binary to v2.0.1
2021-07-21 10:03:59 -04:00
Sebastiaan van Stijn
d2b6d192db
Update cpuguy83/go-md2man binary to v2.0.1
full diff: https://github.com/cpuguy83/go-md2man/compare/v2.0.0...v2.0.1

- Fix handling multiple definition descriptions
- Fix inline markup causing table cells to split
- Remove escaping tilde character (prevents tildes (`~`) from disappearing).
- Do not escape dash, underscore, and ampersand (prevents ampersands (`&`) from disappearing).
- Ignore unknown HTML tags to prevent noisy warnings

Note that this only updates the binaries we install. The vendor code also
includes go-md2man (as indirect dependency of urfave/cli). I don't think we use that
feature, so I did not add it to our go.mod

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-21 12:21:03 +02:00
Shiming Zhang
53ec1abec2 remotes/docker/pusher.go: Fix missing Close()
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
2021-07-21 11:37:08 +08:00
Shiming Zhang
67d07fe5cf remotes/docker/fetcher.go: Fix missing Close()
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
2021-07-21 11:36:23 +08:00
AdamKorcz
0789a0c02b Add docker fetch fuzzer
Signed-off-by: AdamKorcz <adam@adalogics.com>
2021-07-20 16:33:03 +01:00
Phil Estes
b809212b18
Merge pull request #5750 from thaJeztah/cleanup_test_dockerfile
Refactor / optimize contrib/Dockerfile.test
2021-07-20 10:33:55 -04:00
ktock
b483177ee2 Support custom compressor for walking differ
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2021-07-20 11:00:01 +09:00
Phil Estes
1292c50fe9
Merge pull request #5754 from thaJeztah/update_gotestsum
update gotestsum to current master
2021-07-19 14:01:16 -04:00
Derek McGowan
51a8f969bd
Merge pull request from GHSA-c72p-9xmj-rx3w
[test] Use chmod path for checking symlink
2021-07-19 10:30:51 -07:00
Phil Estes
b88bf1eca7
Merge pull request #5755 from adisky/gce-configure-use-systemd
Use systemd cgroup driver for Kubernetes e2e tests with cgroupsv2
2021-07-19 10:09:38 -04:00
Phil Estes
29b86c5479
Merge pull request #5751 from AkihiroSuda/runc-v1.0.1
update runc  to v1.0.1
2021-07-19 10:07:36 -04:00
Aditi Sharma
150e07b648 Use systemd cgroup driver for cgroupv2 tests
Set systemdCgroup for cgroupv2 Kuberentes e2e tests

Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
2021-07-19 10:01:29 +00:00
Sebastiaan van Stijn
603962bc81
update gotestsum to current master
removes golang.org/x/cryto dependency:
full diff: 012a85e34a...1a94380793

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-19 10:00:02 +02: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
Akihiro Suda
43e0594ae9
update runc binary to v1.0.1
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-07-18 20:18:14 +09:00
Sebastiaan van Stijn
9537bc2654
Dockerfile.test: build containerd in separate stage
Looking at how this image is used, I think we don't even need the
source in the final image, so we can build containerd in a separate
stage, and copy the binaries.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-17 17:27:07 +02:00
Sebastiaan van Stijn
36be5ef3a2
Dockerfile.test: add GOLANG_IMAGE build arg to allow overriding
This allows the base image itself to be overridden with an alternative image.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-17 17:19:44 +02:00
Sebastiaan van Stijn
8faacfca16
Dockerfile.test: clean up apt indexes after installing
Not critical for intermediate stages, but a minor optimization to
reduce the image cache. Ideally, this would use cache-mounts for this,
but those may not be supported by podman, so taking the traditional
approach.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-17 17:19:43 +02:00
Sebastiaan van Stijn
9f7e6335c4
Dockerfile.test: build critools in a separate stage
Building critools only requires the install script and the critools-version
file (to determin the version to build). Moving it to a separate stage
prevents rebuilding it if unrelated changes are made in the code.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-17 17:19:40 +02:00
Sebastiaan van Stijn
7ec8e2d369
Dockerfile.test: build cni in a separate stage
Building cni only requires the install script, and the go.mod (to determin
the version to install). Moving it to a separate stage prevents it from
being rebuilt if unrelated changes were made in the codebase.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-17 17:19:34 +02:00
Sebastiaan van Stijn
f9f423c078
Dockerfile.test: standard directory to collect build aftifacts
This allows for easier copying artifacts from stages, by just copying
the directory content to the stage where it's used. These stages are
not used to be run individually so do not have to be "runnable".
Each stage is "responsible" for colllecting all aftifacts in the directory,
so that "consumer" stages do not have to be aware of what needs to be copied.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-17 17:08:47 +02:00
Sebastiaan van Stijn
e9f26eb877
Dockerfile.test: split dev stage, and optimize order
This makes the following changes:

- The containerd/config.toml, and docker-entrypoint.sh only occasionally change,
  so copy them before copying the source code to allow them to be cached.
- The cri-in-userns stage does not need files from proto3, so do not copy them
- The dev environment does need the file from the proto3 stage, so copy them there.
- Change the order of stages. Our CI uses `podman build` which (I think) does not
  skips stages that are not used for the specified target (like BuildKit does).
  So I moved stages that are not used for the `cri-in-userns` after that stage.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-07-17 17:08:04 +02:00