Commit Graph

200 Commits

Author SHA1 Message Date
Kazuyoshi Kato
237ef0de9b Remove all gogoproto extensions
This commit removes the following gogoproto extensions;

- gogoproto.nullable
- gogoproto.customename
- gogoproto.unmarshaller_all
- gogoproto.stringer_all
- gogoproto.sizer_all
- gogoproto.marshaler_all
- gogoproto.goproto_unregonized_all
- gogoproto.goproto_stringer_all
- gogoproto.goproto_getters_all

None of them are supported by Google's toolchain (see #6564).

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-20 07:23:28 +00:00
Kazuyoshi Kato
fd704d3341 Build bin/gen-manpages instead of using "go run"
Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2022-04-18 21:02:27 +00:00
Jordan Karaze
cf571fa968 added make help for cri integration
Signed-off-by: Jordan Karaze <jordan.karaze@ibm.com>
2022-03-28 16:44:12 -05:00
Derek McGowan
46312f4a1b
Update makefile to remove API submodule
Signed-off-by: Derek McGowan <derek@mcg.dev>
2022-01-18 14:48:33 -08:00
Daniel Canter
34c4abc341 Fix default makefile target for windows
A recent change altered the default target that would get run for the makefile.
This ended up making a standalone 'make' invocation only build the Windows
shim and nothing else. This was affecting the CI of some other projects that
relied on 'make' building containerd, ctr, and friends.

Signed-off-by: Daniel Canter <dcanter@microsoft.com>
2021-12-16 06:08:04 -05:00
Brian Goff
2f31dcda7f release: change tar name to match prior releases
In prior releases we were not using this variable and instead were
self-constructing a release tar file.
This was changed in 27d7c50384
The change means the variable is being used now and is causing the
artifacts to be produced to have a different name which may break
download scripts.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-11-15 20:05:17 +00:00
Brian Goff
27d7c50384 Add arm64 to releases
This moves all the release builds into a Dockerfile which is a bit
cleaner for setting up our build environment.

Non-linux/amd64 builds are cross-compiled.
Currently onlinux linux/amd64, linux/arm64, and windows/amd64 are
supported, but is easy to add more, provided their is a cross-compile
toolchain available for it.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-11-11 20:00:34 +00:00
Davanum Srinivas
82fe0db9aa
Fix bad make protos failure
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-08-10 16:03:54 -04:00
Maksym Pavlenko
10eab21a4d Cleanup CI
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-08-06 14:59:05 -07:00
Davanum Srinivas
43117cf919
Script to check if entries in go.mod files are in sync
- ensure that the root go.mod and the module specific go.mod have the
  same `require` and `replace` directives for different dependencies.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-07-27 17:52:32 -04: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
f6fa3fdd7b
Merge pull request #5590 from oss-qm/submit/makefile-tags
Makefile: fix passing build tags
2021-07-23 14:47:55 -07:00
Sebastiaan van Stijn
2019a1e68f
Makefile: fix DESTDIR and PREFIX concatenation
Commits 77374e8 and b5f530a changed handling of the `DESTDIR` and `PREFIX`
variables, and introduced a `MANDIR` variable.

However, in those commits, the variables are concatenated with a directory
separator (`/`); `$DESTDIR/$PREFIX`. The `$PREFIX` variable (and consequently,
the `MANDIR` variable) already should have a leading `/` (absolute path), so
there should be no need to add it. In addition, adding the `/`, would not allow
either an empty path to be passed (well, it would result in `//` in the path),
or for `$PREFIX` to be used with a relative path (with an empty `$PREFIX`).

This patch removes the directory separator.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-06-25 14:12:56 +02:00
Enrico Weigelt, metux IT consult
2bb8ad7c9e Makefile: pass build tags to manpage build process
The 'go run' command in manpage build stage currently doesn't know about
build tags yet. This could lead to strange effects when eg. optional deps
are switched off.

Therefore also pass the tags to the 'go run' calls.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2021-06-15 20:58:13 +02:00
Enrico Weigelt, metux IT consult
f60d447c16 Makefile: fix tags parameter computation
In the current implementation, the build tags arguments can catch up an
extra trailing whitespace. Since this parameter is passed in quotes, the
shell won't strip it, leading to the wrong tags passed.

Therefore just strip it explicitly.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2021-06-15 20:58:07 +02:00
Enrico Weigelt, metux IT consult
77374e8b35 Makefile: FHS conformant manpage installation pathes
FHS mandates manpages should go to /usr/share/man (or /usr/local/share/man,
for site local installations) -- /usr/man was an fallout of some ancient
Unices that haven't been fully FHS conformant and usually just a symlink to
/usr/share/man, if existing at all.

Distros sometimes need to override this (eg. MVCC installs), therefore go
the 30+ years common practise way and introduce MANDIR environment variable.
Since it's a subdir under the prefix for general constant and machine
architecture independ data -- which in turn also sometimes wants to be
overridden by distros, it shall be derived from DATADIR variable.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2021-06-10 19:07:15 +02:00
Enrico Weigelt, metux IT consult
b5f530a157 Makefile: fix DESTDIR environment variable behaviour
The DESTDIR environment variable is used in the wrong way: since 30+ years
it's common practise using it for specifying *temporary* target *root*
(where eg. packaging infrastructure picks up the install image), instead
of the installation *prefix* on the final target.

Fixing this by introducing PREFIX variable (with default /usr/local) and
using both variables according to the 30 years matured common practise.
That way, distro packagers and other standardized build/installation
systems can easily do correct deployments w/o individual hacks.

changes v2: removed variables not used yet
            added documentation

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2021-06-01 10:49:25 +02:00
Enrico Weigelt, metux IT consult
923ab5b7ca Makefile: use $@ for target file names
Make rules can be formulated more generic by using the $@ symbol, instead
of duplicating the target file name.

Just a little cleanup for better maintainability.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2021-05-25 16:09:23 +02:00
Phil Estes
49321a12df
Merge pull request #5493 from oss-qm/submit/install-prog
Makefile: allow overriding install command via environment
2021-05-18 09:10:29 -04:00
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
Enrico Weigelt, metux IT consult
9643c99658 Makefile: allow overriding install command via environment
Packaging systems often want to override the install(1) command via INSTALL
environment variable, in order to do distro specific fixups (eg. splitting
out debug symbols from binaries to separate files).

Also use it for creating install target directories.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2021-05-12 15:52:51 +02:00
Enrico Weigelt, metux IT consult
4b1b8346be Makefile: make sure manpages are built before install-man
Let install-man depend on man, so manpages are really built before
trying to install them.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2021-05-12 15:50:10 +02:00
Enrico Weigelt, metux IT consult
9ea25634bd Makefile: allow overriding go command by environment
This is required for environments/build systems where a specific
go version / command needs to be used.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2021-05-04 20:39:47 +02: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
Phil Estes
6ef0d383e3
Merge pull request #5271 from cpuguy83/ci_output_junit
ci: upload junit formatted test results
2021-04-15 13:20:35 -04:00
Akihiro Suda
92ea98eda5
cri-cni-release: add imgcrypt binaries (v1.1.0)
Add `ctd-decoder` and `ctr-enc`.

Close issue 5265

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-04-07 17:38:42 +09:00
Brian Goff
af1e2af720 ci: upload junit formatted test results
This allows us to dig more details out of test runs and maintain a
better history.

For this we can use `gotestsum`, which is a utility that wraps `go test`
so that it outputs test2json (go's format) and output junit (a format
more easily imported into other systems).

The PR makes it possible to override the Makefile's use of `go test` to
use any other command tto executet the test. For CI we'll use `gotestsum
--`, where `gotestsum` expects everything after the `--` to be flags for
`go test`.
We then use environment variables to configure `gotestsum` (e.g.
`GOTESTSUM_JUNITFILE` is an env var accepted by `gotestsum`).

For cri tests, the test suite supports outputing test results to a
directory, these are in junit format already. The file is not named
properly just because the code that creates it (in ginkgo) is not
configured well. We can fix that upstream to give us a better name...
until then I'm keeping those results in a separate dir.

A second workflow is also added so the test results can be summed up and
a report added to the workflow run. The 2nd workflow is required for
this since PR runs do not have access to do some of this due to safety
reasons
(https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-03-31 17:00:49 +00:00
Mike Brown
548d984f27
Merge pull request #5132 from mikebrow/add-some-debug-out-for-dep-setups
adds a new install-deps in the makefile; and some refactoring of the scripts
2021-03-24 15:28:16 -05:00
Mike Brown
9ad87b9ba7 adds critools-version
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-03-24 10:58:40 -05:00
Maksym Pavlenko
a47feaf462
Merge pull request #4898 from timchenxiaoyu/makefile
standard makefile,fix not work no  macos
2021-03-19 16:05:46 -07:00
Davanum Srinivas
6a4aa1e2e7
Separate go module for client tests
Will help us drop dependency to github.com/Microsoft/hcsshim/test in the
main go.mod

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-03-11 19:27:45 -05:00
Mike Brown
2205da64a6 clean up install-cni and install-critools
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-03-11 10:21:32 -06:00
Mike Brown
1b1bb48709 adds a new install-deps in the makefile; and some debug out
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-03-11 10:21:32 -06:00
Sebastiaan van Stijn
6c69cd55fb
Makefile: run "go mod tidy" when vendoring
`make vendor` did not do a `go mod tidy` after vendoring, whereas
CI does this as part of the vendor validation, causing CI to fail
if `make vendor` was used to update vendoring, without doing a
`go mod tidy` as well.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-01-27 16:17:50 +01:00
Derek McGowan
7dffdfa560
Move documentation and helper directories out of root
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-01-12 12:19:50 -08:00
weixian.cxy
d649174037 standard makefile,fix not work no macos
Signed-off-by: timchenxiaoyu <837829664@qq.com>
2021-01-04 09:37:56 +08:00
Shengjing Zhu
5988bfc1ef docs: Various typo found by codespell
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2020-12-22 13:22:16 +08:00
Akihiro Suda
7e6e4c466f
remove "selinux" build tag
The build tag was removed in go-selinux v1.8.0: opencontainers/selinux#132

Related: remove "apparmor" build tag: 0a9147f3aa

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-12-15 20:05:25 +09:00
Akihiro Suda
0a9147f3aa
remove "apparmor" build tag
The "apparmor" build tag does not have any cgo dependency and can be removed safely.

Related: https://github.com/opencontainers/runc/issues/2704

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-12-08 19:22:39 +09:00
Shengjing Zhu
089d2183bf Replace vndr in Makefile
Signed-off-by: Shengjing Zhu <zhsj@debian.org>
2020-12-01 01:33:56 +08:00
Sebastiaan van Stijn
1edeea7663
install-runc: remove unused USESUDO variable
This is no longer needed, as the script is already run with sudo.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-11-10 12:49:21 +01:00
Mike Brown
c876b15b54 getting cri integration up and running
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2020-10-19 10:02:05 -05:00
Derek McGowan
1c60ae7f87
Use local version of cri packages
Signed-off-by: Derek McGowan <derek@mcg.dev>
2020-10-07 10:59:40 -07:00
Derek McGowan
65df8db289
Remove sudo from installation and cri release
Signed-off-by: Derek McGowan <derek@mcg.dev>
2020-09-25 14:40:59 -07:00
Derek McGowan
4e0b13544e
Update CRI tests to build and push to gcs
This enables to the CRI e2e tests to use the build from a PR

Signed-off-by: Derek McGowan <derek@mcg.dev>
2020-09-25 14:12:57 -07:00
Derek McGowan
f35f21dd0b
Add CRI release functionality to makefile
Signed-off-by: Derek McGowan <derek@mcg.dev>
2020-09-23 14:10:27 -07:00
Derek McGowan
3216a16959
Remove unused Travis configuration
Remove related stale cri release files

Signed-off-by: Derek McGowan <derek@mcg.dev>
2020-09-21 21:15:42 -07:00
Derek McGowan
3275a216fd
Update go list to respect build tags
This prevents packages with no Go included files due to build constraints
being included in the package list. These packages cause the test command
to fail with "can't load package build constraints exclude all Go files".

Signed-off-by: Derek McGowan <derek@mcg.dev>
2020-08-21 09:39:00 -07:00
Akihiro Suda
6988b4d640
remove seccomp buildtag
The cgo dependency on libseccomp was removed in containerd/cri#1548.

The `seccomp` build tag is now ignored (and the seccomp support is always built-in).

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-07-31 14:41:41 +09:00
Davanum Srinivas
49200a1dd4
CRI plugin needs selinux tag as well
A simple `grep selinux_stub bin/containerd` shows that we are not using
selinux tag when building containerd. The CRI plugin pulls in a bunch of
selinux related code, so we need to enable this tag as well.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-04-13 09:29:07 -04:00