Commit Graph

10081 Commits

Author SHA1 Message Date
Thomas Hartland
b48f27df6b Support PID NamespaceMode_TARGET
This commit adds support for the PID namespace mode TARGET
when generating a container spec.

The container that is created will be sharing its PID namespace
with the target container that was specified by ID in the namespace
options.

Signed-off-by: Thomas Hartland <thomas.george.hartland@cern.ch>
2021-04-21 17:54:17 +02:00
Iceber Gu
909660ea92 process: use the unbuffered channel as the done signal
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2021-04-21 18:24:18 +08:00
Maksym Pavlenko
7b7a230dd2
Merge pull request #5399 from dmcgowan/update-cgroup-vendor
Update cgroups for regenerated protos
2021-04-20 16:19:18 -07:00
Derek McGowan
0f332dadd1
Update cgroups for regenerated protos
The proto version was updated with cgroup in v1.0.0 but
the protos were not regenerated. The v1.0.1 tag fixes this.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-04-20 15:46:27 -07:00
Michael Crosby
079fe6bca8
Merge pull request #5395 from mikebrow/cmd-check-improve-error-checking
add check quiet option and update usage
2021-04-20 14:43:25 -04:00
Michael Crosby
a3fe5c84c0
Merge pull request #5383 from wzshiming/clean/process-io
move common code to pkg/process from runtime
2021-04-20 14:40:12 -04:00
Derek McGowan
c3f5a6a93d
Merge pull request #5394 from dmcgowan/prepare-1.5.0-rc.2
Prepare 1.5.0-rc.2 release notes
2021-04-20 09:37:42 -07:00
Mike Brown
391b123a5e adds quiet option for ref
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-04-20 09:20:14 -05:00
Adelina Tuvenie
421fc6ea73 Add CI periodic Windows Jobs.
Signed-off-by: Adelina Tuvenie <atuvenie@cloudbasesolutions.com>
2021-04-20 17:18:46 +03:00
Phil Estes
c4d30c173f
Merge pull request #5379 from ktock/fix-push-race
Fix PushHandler cannot push image that contains duplicated blobs
2021-04-20 08:56:07 -04:00
ktock
ab1654d0e2 Fix PushHandler cannot push image that contains duplicated blobs
Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
2021-04-20 14:00:53 +09:00
Mike Brown
00f8d32ef5 add not found debug out for check cmd; update usage
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-04-19 19:36:10 -05:00
Derek McGowan
55734b1c56
Prepare 1.5.0-rc.2 release notes
Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-04-19 14:00:49 -07:00
Derek McGowan
b1eb024d91
Merge pull request #5393 from dmcgowan/update-containerd-org-deps-1.5
Update containerd vendors to tags
2021-04-19 14:00:19 -07:00
Phil Estes
81c4ac202f
Merge pull request #5256 from kolyshkin/seccomp-enabled
pkg/seccomp: simplify and speed up isEnabled
2021-04-19 15:59:28 -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
Phil Estes
56512cca7b
Merge pull request #4741 from thaJeztah/kudo_sudo
gha: use sudo -E in some places to prevent dropping env-vars
2021-04-19 10:55:03 -04:00
Akihiro Suda
d2d0afac05
Merge pull request #5385 from thaJeztah/bump_kubernetes_1.20.6 2021-04-19 23:42:33 +09:00
Akihiro Suda
3abfb23b27
Merge pull request #5388 from thaJeztah/update_golang 2021-04-19 22:13:59 +09:00
Sebastiaan van Stijn
fbe1e140f2
Update Go to 1.16.3
go1.16.3 (released 2021/04/01) includes fixes to the compiler, linker, runtime,
the go command, and the testing and time packages. See the Go 1.16.3 milestone
on our issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.16.3+label%3ACherryPickApproved

full diff: https://github.com/golang/go/compare/go1.16.2...go1.16.3

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-19 13:10:18 +02:00
Sebastiaan van Stijn
c1d1edbad9
gha: use sudo -E in some places to prevent dropping env-vars
Using `-E` preserves environment variables, except for PATH, so PATH has to be
manually set to match the current environment.

I removed env-vars that were redundant (such as `GOPATH=$GOPATH`), which should
be handled by `-E`.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-04-19 13:04:43 +02:00
Fu Wei
93a602a8bf
Merge pull request #5269 from thaJeztah/update_fifo
go.mod: github.com/containerd/fifo v1.0.0
2021-04-19 18:34:14 +08:00
Shiming Zhang
7966a6652a Cleanup code
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
2021-04-19 16:59:45 +08: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
Akihiro Suda
bbbd851381
Merge pull request #4415 from TBBle/wcow_commit_layers
Commit writable WCOW layers as read-only parent layers
2021-04-19 14:35:08 +09:00
Maksym Pavlenko
3aae93a348
Merge pull request #5382 from thaJeztah/bump_uuid
go.mod: github.com/google/uuid v1.2.0
2021-04-18 17:00:01 -07:00
Maksym Pavlenko
69a30ad581
Merge pull request #5378 from Iceber/check-flag
runtime/shim: check the namespace flag first
2021-04-18 09:10:46 -07:00
Maksym Pavlenko
3e59ee09ab
Merge pull request #5377 from samuelkarp/freebsd-zfs
freebsd: add zfs to the default plugins
2021-04-17 19:20:57 -07: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
Akihiro Suda
688c4684a7
Merge pull request #5380 from samuelkarp/snapshotters 2021-04-17 16:34:02 +09:00
Kir Kolyshkin
3292ea5862 pkg/seccomp: use sync.Once to speed up IsEnabled
It does not make sense to check if seccomp is supported by the kernel
more than once per runtime, so let's use sync.Once to speed it up.

A quick benchmark (old implementation, before this commit, after):

BenchmarkIsEnabledOld-4           37183            27971 ns/op
BenchmarkIsEnabled-4            1252161              947 ns/op
BenchmarkIsEnabledOnce-4      666274008             2.14 ns/op

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-04-16 15:52:35 -07:00
Kir Kolyshkin
00b5c99b1a pkg/seccomp: simplify IsEnabled, update doc
Current implementation of seccomp.IsEnabled (rooted in runc) is not
too good.

First, it parses the whole /proc/self/status, adding each key: value
pair into the map (lots of allocations and future work for garbage
collector), when using a single key from that map.

Second, the presence of "Seccomp" key in /proc/self/status merely means
that kernel option CONFIG_SECCOMP is set, but there is a need to _also_
check for CONFIG_SECCOMP_FILTER (the code for which exists but never
executed in case /proc/self/status has Seccomp key).

Replace all this with a single call to prctl; see the long comment in
the code for details.

While at it, improve the IsEnabled documentation.

NOTE historically, parsing /proc/self/status was added after a concern
was raised in https://github.com/opencontainers/runc/pull/471 that
prctl(PR_GET_SECCOMP, ...) can result in the calling process being
killed with SIGKILL. This is a valid concern, so the new code here
does not use PR_GET_SECCOMP at all.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-04-16 15:52:35 -07:00
Samuel Karp
6dd29c25f4
go.mod: github.com/containerd/aufs
Signed-off-by: Samuel Karp <me@samuelkarp.com>
2021-04-16 15:09:31 -07:00
Samuel Karp
330a2a8092
go.mod: github.com/containerd/zfs
Signed-off-by: Samuel Karp <me@samuelkarp.com>
2021-04-16 15:08:25 -07:00
Phil Estes
9efd3e2384
Merge pull request #5360 from kzys/namespace-delete
metadata: improve deleting a non-empty namespace's error message
2021-04-16 14:51:03 -04:00
Phil Estes
1e5cb4edcb
Merge pull request #5368 from mxpv/runtime_cleanup
Runtime cleanup
2021-04-16 14:50:15 -04:00
Iceber Gu
34780d67ad runtime/shim: check the namespace flag first
Signed-off-by: Iceber Gu <wei.cai-nat@daocloud.io>
2021-04-16 17:32:21 +08:00
Samuel Karp
c3dde8c4bb
freebsd: add zfs to the default plugins
Signed-off-by: Samuel Karp <me@samuelkarp.com>
2021-04-16 00:52:24 -07:00
Akihiro Suda
f0890f9b3a
Merge pull request #5375 from samuelkarp/freebsd-runtime
freebsd: runtime support
2021-04-16 11:45:57 +09:00
Samuel Karp
b431fe4fc0
freebsd: don't run shim delete in deleted dir
fork/exec can fail and log a warning like this in containerd's log:
failed to clean up after shim disconnected error=": fork/exec /usr/local/bin/containerd-shim-[my-shim]: no such file or directory" id=test namespace=default

Passing the bundle path on the command line allows the shim delete
command to run successfully.

Signed-off-by: Samuel Karp <me@samuelkarp.com>
2021-04-15 18:09:29 -07:00
Samuel Karp
1f4192daf4
freebsd: exclude v1 runtimes
Signed-off-by: Samuel Karp <me@samuelkarp.com>
2021-04-15 18:09:29 -07:00
Kazuyoshi Kato
cb1580937a metadata: improve deleting a non-empty namespace's error message
Deleting a non-empty namespace fails with

> namespace must be empty: failed precondition

This change improves the error message by listing the types of
the objects in the namespace that prevent deletion.

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
2021-04-15 15:49:44 -07:00
Maksym Pavlenko
dda530a750
Merge pull request #5370 from cpuguy83/remove_junit_processor
Remove junit test result processor
2021-04-15 15:37:56 -07:00
Brian Goff
5bf84034de Remove junit test result processor
This has some problems, namely that it gets confused as to what workflow
run to add results to. Related issue:
https://github.com/EnricoMi/publish-unit-test-result-action/issues/12
This seems to be a shortcoming of the github API:
https://github.community/t/specify-check-suite-when-creating-a-checkrun/118380/7

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2021-04-15 22:03:06 +00:00
Maksym Pavlenko
b83d04f910 Add variable names to runtime's interface definitions
To ease code readability

Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-04-15 12:03:13 -07:00
Maksym Pavlenko
993b863993 Add shim start opts
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-04-15 11:55:24 -07: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
Maksym Pavlenko
cc393ea87a
Merge pull request #5279 from wzshiming/fix/backoff
Optimize content/local/store.Writer backoff
2021-04-15 10:05:33 -07:00
Maksym Pavlenko
fca0da46b0
Merge pull request #5364 from wzshiming/fix/list-pids-lock
runtime/v1: Add lock for ListPids
2021-04-15 09:18:30 -07:00