Commit Graph

391 Commits

Author SHA1 Message Date
Markus Lehtonen
f4a191917b cri: annotations for controlling RDT class
Use goresctrl for parsing container and pod annotations related to RDT.

In practice, from the users' point of view, this patchs adds support for
a container annotation and two separate pod annotations for controlling
the RDT class of containers.

Container annotation can be used by a CRI client:
  "io.kubernetes.cri.rdt-class"

Pod annotations for specifying the RDT class in the K8s pod spec level:
  "rdt.resources.beta.kubernetes.io/pod"
  (pod-wide default for all containers within)

  "rdt.resources.beta.kubernetes.io/container.<container_name>"
  (container-specific overrides)

Annotations are intended as an intermediate step before the CRI API
supports RDT.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2022-01-04 09:27:54 +02:00
Markus Lehtonen
eae14688c6 tasks: add Linux rdt support
Add support for configuring the Linux resctrl pseudo-filesystem with
goresctrl library. The functionality is integrated in the
"io.containerd.service.v1.tasks-service" plugin.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2022-01-04 09:27:54 +02:00
Kazuyoshi Kato
2ee3ce510c Use insecure.NewCredentials instead of grpc.WithInsecure
grpc.WithInsecure is being deprecated.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-12-16 23:10:06 +00:00
Phil Estes
330961c2d5
Merge pull request #6358 from jonyhy96/feat-error
refactor: functions for error log and error return
2021-12-14 10:16:54 -05:00
Phil Estes
6e9e759553
Merge pull request #6225 from jonyhy96/feat-blot-open-timeout
feat: add timeout for bolt open
2021-12-13 11:22:28 -05:00
haoyun
dd26d3d092 feat: support custom timeout for blot open
Signed-off-by: haoyun <yun.hao@daocloud.io>
2021-12-13 17:02:37 +08:00
haoyun
c0d07094be feat: Errorf usage
Signed-off-by: haoyun <yun.hao@daocloud.io>
2021-12-13 14:31:53 +08:00
Maksym Pavlenko
6bccd67e84 Revert shim plugin migration
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-02 10:35:15 -08:00
Maksym Pavlenko
af93ea7f1e
Merge pull request #6241 from jterry75/main
Add support for TMP override on toml
2021-11-18 16:43:51 -08:00
Justin Terry
63895de455 Add support for TMP override on toml
When running containerd as a service it may be hard to
override the TMP location of the process. This is especially
true on Windows when running containerd in SCM. This change
allows you to set the 'temp' location in the config.toml when
the service starts up that overrides its TEMP/TMP/TMPDIR usage.

This is helpful on Linux as well but it primarily solves the
performance issue on Windows when running containerd across
volumes. IE: If you configure your data/root paths on a volume
other than the SystemDrive the snapshotter does a temporary unpack
on the SystemDrive and then has to copy contents of that data
to the snapshot folder on the destination volume. By alinging the
tmp with the destination it is a simple move operation instead of
a copy operation.

Signed-off-by: Justin Terry <jlterry@amazon.com>
2021-11-16 10:43:48 -08:00
Maksym Pavlenko
6870f3b1b8 Support custom runtime path when launching tasks
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-11-09 13:31:46 -08:00
Maksym Pavlenko
a3d298193c Fix backward compatibility with old task shims
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-11-01 07:37:01 -07:00
Maksym Pavlenko
33786ee4d2 Add plugin dependency between shim and shim services
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-11-01 07:37:00 -07:00
Maksym Pavlenko
7c4ead285d Add task manager
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-11-01 07:36:58 -07:00
Maksym Pavlenko
2d5d3541e6 Rename task manager to shim manager
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-11-01 07:36:34 -07:00
Phil Estes
0800b45dd2
Merge pull request #6145 from tonistiigi/content-close-fix
content: close stream after commit request
2021-10-28 10:02:33 -04:00
Tonis Tiigi
010a9e2bca content: close stream after commit request
This allows both client and server to determine when
stream is completed. Previously this was done by
closesend call from the client side but that is async
so client can not assume that the server side also
already thinks that stream is complete.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-10-21 19:24:28 -07:00
Brian Goff
130a9c7ddb Ensure namespace is proxied to grpc/ttrpc plugins
Before this change we only ever had the grpc incoming medata set so when
we make a request to a shim or a grpc plugin the namespace is not sent
over the RPC.

I need this for github.com/cpuguy83/systemdshim, and I am sure there are
other use-cases where this would be needed.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-10-16 00:09:50 +00:00
Derek McGowan
18d483b236
Update cgroups to v1.0.2
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-10-08 17:48:33 -07:00
Michael Crosby
f1054dbbde
fix integration client vendor
Signed-off-by: Michael Crosby <michael@thepasture.io>
2021-10-08 16:20:21 +00:00
Michael Crosby
e48bbe8394 add runc shim support for sched core
In linux 5.14 and hopefully some backports, core scheduling allows processes to
be co scheduled within the same domain on SMT enabled systems.

The containerd impl sets the core sched domain when launching a shim. This
allows a clean way for each shim(container/pod) to be in its own domain and any
additional containers, (v2 pods) be be launched with the same domain as well as
any exec'd process added to the container.

kernel docs: https://www.kernel.org/doc/html/latest/admin-guide/hw-vuln/core-scheduling.html

Signed-off-by: Michael Crosby <michael@thepasture.io>
2021-10-08 16:18:09 +00:00
zounengren
3a713811be run gofmt with Go 1.17
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2021-10-07 20:16:59 +08:00
Maksym Pavlenko
64291df71b
Merge pull request #6079 from cpuguy83/correct_task_error
task service: return known error type
2021-10-01 15:26:49 -07:00
Derek McGowan
63b7e5771e
Merge pull request #5973 from Juneezee/deprecate-ioutil
refactor: move from io/ioutil to io and os package
2021-10-01 10:52:06 -07:00
Brian Goff
02e77bcdc1 task service: return known error type
Found this error in a docker daemon log classified as an "uknown" error.
Since we know what this is return the correct error type so it can be
handled.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-10-01 17:45:51 +00:00
Brian Goff
084387e0b4 Move tracing to plugin
This just makes the implementation a little cleaner.
It also makes the trace exporter pluggable.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-09-21 21:19:46 +00:00
Eng Zer Jun
50da673592
refactor: move from io/ioutil to io and os package
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-09-21 09:50:38 +08:00
Fu Wei
e1ad779107
Merge pull request #5817 from dmcgowan/shim-plugins
Add support for shim plugins
2021-09-12 18:18:20 +08:00
Hajime Tazaki
a43fa9f284 darwin: runtime support
This commit attemts to support containerd on darwin platform.  With an
external runtime shim, ctr run should work with, for instance,
--runtime=io.containerd.runu.v1.  An example of runtime and shim is
managed under different repository (github.com/ukontainer/runu/).

Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
2021-09-03 09:48:21 +09:00
Akihiro Suda
d3aa7ee9f0
Run go fmt with Go 1.17
The new `go fmt` adds `//go:build` lines (https://golang.org/doc/go1.17#tools).

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-08-22 09:31:50 +09:00
Derek McGowan
8d135d2842
Add support for shim plugins
Refactor shim v2 to load and register plugins.
Update init shim interface to not require task service implementation on
returned service, but register as plugin if it is.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-08-17 11:06:09 -07:00
Phil Estes
7d4c95ff04
Merge pull request #5813 from mxpv/shim_cleanup
Cleanup v2 shim
2021-08-11 11:47:47 -04:00
Michael Crosby
218db0f9af
Merge pull request #5835 from dmcgowan/plugin-events-cleanup
Move plugin context events into separate plugin
2021-08-07 21:47:11 -04:00
Derek McGowan
0a0621bb47
Move plugin context events into separate plugin
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-08-05 22:59:20 -07:00
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
3597ac859d [otel-tracing] Initial opentelemetry support
Add basic intiialization of opentelemetry including minimum support to
be able to read open telemetry config from config.toml and initialize
exporter. Tracer is initialized and ready to be be used for creating
spans, sub spans etc. With no opentelemetry configuration enabled in
config file, this patch is a no-op.

Basic config stub to be added to use opentelemetry is to add following
in config.toml. We use otlp exporter with default port 4317.

[otel]
  exporter_name = "otlp"
  exporter_endpoint = "0.0.0.1:4317"

otel-collector binary needs to run listening at the same port.

Signed-off-by: Alakesh Haloi <alakeshh@amazon.com>
2021-08-04 14:25:01 -07:00
Maksym Pavlenko
d30d897ef9 Cleanup v2 shim
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-08-04 10:38:05 -07: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
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
zwtop
63fe34add6 grpc config add options tcp_tls_ca
Signed-off-by: zwtop <wang.zhan@smartx.com>
2021-06-30 10:58:32 +08:00
Samuel Karp
1f4192daf4
freebsd: exclude v1 runtimes
Signed-off-by: Samuel Karp <me@samuelkarp.com>
2021-04-15 18:09:29 -07:00
ktock
fdb76f55d8 Fix backword-compatibility issue of non-versioned config file
According to the doc about `config.toml` of containerd:

```
If no version number is specified inside the config file then it is assumed to
be a version 1 config and parsed as such.
```

However, it's not true recently.
This will break the backward-compatibility in some environment.
This commit fixes this issue.

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2021-04-15 10:00:58 +09:00
Davanum Srinivas
9ad087947d
Switch all our tests to version 2
Also warn when someone uses version 1

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-04-12 13:18:33 -04:00
Maksym Pavlenko
ddd4298a10 Migrate current TOML code to github.com/pelletier/go-toml
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-03-25 13:13:33 -07:00
Derek McGowan
35eeb24a17
Fix exported comments enforcer in CI
Add comments where missing and fix incorrect comments

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-03-12 08:47:05 -08:00
Maksym Pavlenko
a4f4a43110
Merge pull request #4916 from stefanberger/streamproc_env_vars
Allow passing environent variables to StreamProcessors
2021-01-11 16:34:12 -08:00
Stefan Berger
1917ca5f79 Allow passing environent variables to StreamProcessors
Add support for an 'env' field to the StreamProcessor configuration
and append the environment variables found there to the os.Environ()
array.
The env field takes environment variables in the form of key=value.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-01-11 13:15:12 -05:00
Akihiro Suda
a9cc2a7720
introspection: demote log level
Demote `Info("remote introspection plugin filters")` to `Debug()`

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-01-08 19:24:43 +09:00
Kathryn Baldauf
f8992f451c add optional check that snapshotter supports the image platform when unpacking
Signed-off-by: Kathryn Baldauf <kabaldau@microsoft.com>
2020-12-10 10:54:22 -08:00
Vlad Ungureanu
f12b68cc86 Allow configuration of different log formats: text, json
Signed-off-by: Vlad Ungureanu <vladu@palantir.com>
2020-12-04 13:12:41 -05:00