Commit Graph

48 Commits

Author SHA1 Message Date
Aleksa Sarai
68bef803eb merge #4482 into opencontainers/runc:main
lifubang (1):
  drop runc-dmz solution according to overlay solution

LGTMs: AkihiroSuda cyphar
2024-10-29 18:14:18 +11:00
Akihiro Suda
c8f5d033c2 docs: remove prompt symbols from shell snippets
Remove prompt symbols (`$`, `%`) for ease of copy-pasting

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-10-29 01:38:24 +09:00
lifubang
871057d863 drop runc-dmz solution according to overlay solution
Because we have the overlay solution, we can drop runc-dmz binary
solution since it has too many limitations.

Signed-off-by: lifubang <lifubang@acmcoder.com>
2024-10-28 15:18:07 +00:00
Akihiro Suda
f76489f0af mv contrib/cmd tests/cmd (except memfd-bind)
The following commands are moved from `contrib/cmd` to `tests/cmd`:
- fs-idmap
- pidfd-kill
- recvtty
- remap-rootfs
- sd-helper
- seccompagent

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-08-16 00:55:48 +09:00
ver4a
171304c8a3 docs/systemd: fix a broken link
Documentation was moved from https://docs.gtk.org/glib/gvariant-text.html to https://docs.gtk.org/glib/gvariant-text-format.html.

Signed-off-by: ver4a <verca@uncontrol.me>
2024-08-07 00:27:57 +02:00
Kir Kolyshkin
1c505fffdc Revert "Set temporary single CPU affinity..."
There's too much logic here figuring out which CPUs to use. Runc is a
low level tool and is not supposed to be that "smart". What's worse,
this logic is executed on every exec, making it slower. Some of the
logic in (*setnsProcess).start is executed even if no annotation is set,
thus making ALL execs slow.

Also, this should be a property of a process, rather than annotation.

The plan is to rework this.

This reverts commit afc23e3397.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-06-10 06:31:03 +08:00
Cédric Clerget
afc23e3397 Set temporary single CPU affinity before cgroup cpuset transition.
This handles a corner case when joining a container having all
the processes running exclusively on isolated CPU cores to force
the kernel to schedule runc process on the first CPU core within the
cgroups cpuset.

The introduction of the kernel commit
46a87b3851f0d6eb05e6d83d5c5a30df0eca8f76 has affected this deterministic
scheduling behavior by distributing tasks across CPU cores within the
cgroups cpuset. Some intensive real-time application are relying on this
deterministic behavior and use the first CPU core to run a slow thread
while other CPU cores are fully used by real-time threads with SCHED_FIFO
policy. Such applications prevents runc process from joining a container
when the runc process is randomly scheduled on a CPU core owned by a
real-time thread.

Introduces isolated CPU affinity transition OCI runtime annotation
org.opencontainers.runc.exec.isolated-cpu-affinity-transition to restore
the behavior during runc exec.

Fix issue with kernel >= 6.2 not resetting CPU affinity for container processes.

Signed-off-by: Cédric Clerget <cedric.clerget@gmail.com>
2024-04-16 08:59:49 +02:00
utam0k
bfbd0305ba Add I/O priority
Signed-off-by: utam0k <k0ma@utam0k.jp>
2024-03-30 22:31:54 +09:00
Akihiro Suda
eefc6ae254 features: implement returning potentiallyUnsafeConfigAnnotations list
See https://github.com/opencontainers/runtime-spec/blob/v1.2.0/features.md#unsafe-annotations-in-configjson

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-03-09 21:31:49 +09:00
dependabot[bot]
606251ab33 build(deps): bump github.com/opencontainers/runtime-spec
Bumps [github.com/opencontainers/runtime-spec](https://github.com/opencontainers/runtime-spec) from 1.1.1-0.20230823135140-4fec88fd00a4 to 1.2.0.
- [Release notes](https://github.com/opencontainers/runtime-spec/releases)
- [Changelog](https://github.com/opencontainers/runtime-spec/blob/main/ChangeLog)
- [Commits](https://github.com/opencontainers/runtime-spec/commits/v1.2.0)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/runtime-spec
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2024-03-07 14:43:33 +09:00
lfbzhm
55c9d6bf01 we have implemented idmapped-mounts with no limitations
Signed-off-by: lfbzhm <lifubang@acmcoder.com>
2024-01-04 19:24:21 +08:00
lfbzhm
e90d8cb8fe we have supported rsvd hugetlb cgroup
Signed-off-by: lfbzhm <lifubang@acmcoder.com>
2024-01-04 19:24:21 +08:00
Zheao.Li
98511bb40e linux: Support setting execution domain via linux personality
carry #3126

Co-authored-by: Aditya R <arajan@redhat.com>
Signed-off-by: Zheao.Li <me@manjusaka.me>
2023-10-27 19:33:37 +08:00
Akihiro Suda
0274ca2580 Merge pull request #4025 from lifubang/feat-sched-carry-3962
[Carry 3962] Support `process.scheduler`
2023-10-12 08:07:50 +09:00
utam0k
770728e16e Support process.scheduler
Spec: https://github.com/opencontainers/runtime-spec/pull/1188
Fix: https://github.com/opencontainers/runc/issues/3895

Co-authored-by: lifubang <lifubang@acmcoder.com>
Signed-off-by: utam0k <k0ma@utam0k.jp>
Signed-off-by: lifubang <lifubang@acmcoder.com>
2023-10-04 15:53:18 +08:00
Aleksa Sarai
d8d576ca4f merge #4031 into opencontainers/runc:main
Akihiro Suda (1):
  docs: clarify the supported architectures (No MIPS)

LGTMs: kolyskin cyphar
2023-10-04 16:08:08 +11:00
Zheao Li
4b3b7e9973 docs/spec-conformance: update
Since PR 3876 was merged, let's remove time namespace from the list of unimplemented features.

Signed-off-by: Zheao Li <me@manjusaka.me>
2023-09-27 20:24:43 +08:00
Akihiro Suda
9060666531 docs: clarify the supported architectures (No MIPS)
In reviewing PR 4024 ("libct/dmz: Reduce the binary size using nolibc"),
we noticed that we do not intend to actively support MIPS.

We do not intend to support i386 either.

This might be a breaking change for Debian, which has been officially
providing runc packages for `i386`, `mips64el` and `mipsel`:
https://packages.debian.org/bookworm/runc

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-09-27 05:39:47 +09:00
Kailun Qin
e1584831b6 libct/cg: add CFS bandwidth burst for CPU
Burstable CFS controller is introduced in Linux 5.14. This helps with
parallel workloads that might be bursty. They can get throttled even
when their average utilization is under quota. And they may be latency
sensitive at the same time so that throttling them is undesired.

This feature borrows time now against the future underrun, at the cost
of increased interference against the other system users, by introducing
cfs_burst_us into CFS bandwidth control to enact the cap on unused
bandwidth accumulation, which will then used additionally for burst.

The patch adds the support/control for CFS bandwidth burst.

runtime-spec: https://github.com/opencontainers/runtime-spec/pull/1120

Co-authored-by: Akihiro Suda <suda.kyoto@gmail.com>
Co-authored-by: Nadeshiko Manju <me@manjusaka.me>
Signed-off-by: Kailun Qin <kailun.qin@intel.com>
2023-09-06 23:23:30 +08:00
Kir Kolyshkin
465cb34a4b Merge pull request #3945 from opencontainers/dependabot/go_modules/github.com/opencontainers/runtime-spec-1.1.0
build(deps): bump github.com/opencontainers/runtime-spec from 1.1.0-rc.3 to 1.1.0
2023-07-28 15:41:35 -07:00
Aleksa Sarai
b4f38918a4 merge #3861 into opencontainers/runc:main
Akihiro Suda (1):
  features: graduate from experimental

LGTMs: kolyshkin cyphar
Closes #3861
2023-07-22 19:38:45 +10:00
dependabot[bot]
11b6c9b638 build(deps): bump github.com/opencontainers/runtime-spec
Bumps [github.com/opencontainers/runtime-spec](https://github.com/opencontainers/runtime-spec) from 1.1.0-rc.3 to 1.1.0.
- [Release notes](https://github.com/opencontainers/runtime-spec/releases)
- [Changelog](https://github.com/opencontainers/runtime-spec/blob/main/ChangeLog)
- [Commits](https://github.com/opencontainers/runtime-spec/compare/v1.1.0-rc.3...v1.1.0)

---
updated-dependencies:
- dependency-name: github.com/opencontainers/runtime-spec
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-07-22 13:03:35 +09:00
Rodrigo Campos
867ee90534 docs: Update spec conformance for idmap mounts
Signed-off-by: Rodrigo Campos <rodrigoca@microsoft.com>
2023-07-17 16:29:07 +02:00
Sebastiaan van Stijn
4f5c350513 Merge pull request #3899 from kolyshkin/fix-sd-linl
docs/systemd: fix a broken link
2023-06-14 01:12:46 +02:00
Kir Kolyshkin
73b5dc027d docs/systemd: fix a broken link
Apparently, developer.gnome.org/documentation no longer hosts the
documentation we used to refer to. Link to docs.gtk.org instead.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2023-06-12 16:10:06 -07:00
Akihiro Suda
0ac3376c20 go.mod: runtime-spec v1.1.0-rc.3
https://github.com/opencontainers/runtime-spec/releases/tag/v1.1.0-rc.3

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-06-10 17:19:11 +09:00
Akihiro Suda
f6c393da9e features: graduate from experimental
The type definition was merged into the OCI Runtime Spec v1.1.0-rc.2:
https://github.com/opencontainers/runtime-spec/blob/v1.1.0-rc.2/features.md

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-05-11 11:41:22 +09:00
Akihiro Suda
6beb3c6a3e go.mod: runtime-spec v1.1.0-rc.2
See https://github.com/opencontainers/runtime-spec/releases/tag/v1.1.0-rc.2
for the spec changes.

The `runc features` json is now defined in
https://github.com/opencontainers/runtime-spec/blob/v1.1.0-rc.2/specs-go/features/features.go

Replaces PR 3829

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-05-10 22:23:29 +09:00
Kir Kolyshkin
ed9651bc71 libct/cg/sd: support setting cpu.idle via systemd
Systemd v252 (available in CentOS Stream 9 in our CI) added support
for setting cpu.idle (see [1]). The way it works is:
 - if CPUWeight == 0, cpu.idle is set to 1;
 - if CPUWeight != 0, cpu.idle is set to 0.

This commit implements setting cpu.idle in systemd cgroup driver via a
unit property. In case CPUIdle is set to non-zero value, the driver sets
adds CPUWeight=0 property, which will result in systemd setting cpu.idle
to 1.

Unfortunately, there's no way to set cpu.idle to 0 without also changing
the CPUWeight value, so the driver doesn't do anything if CPUIdle is
explicitly set to 0. This case is handled by the fs driver which is
always used as a followup to setting systemd unit properties.

Also, handle cpu.idle set via unified map. In case it is set to non-zero
value, add CPUWeight=0 property, and ignore cpu.weight (otherwise we'll
get two different CPUWeight properties set).

Add a unit test for new values in unified map, and an integration test case.

[1] https://github.com/systemd/systemd/pull/23299
[2] https://github.com/opencontainers/runc/issues/3786

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2023-04-03 18:25:07 -07:00
Akihiro Suda
e412b4e88c docs: add docs/spec-conformance.md
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2023-02-10 12:10:18 +09:00
Akihiro Suda
72ad20994b docs/cgroup-v2.md: update the distro list
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-05-27 17:41:24 +09:00
Akihiro Suda
deb0a5f2ef Mark runc features experimental
Follow-up to PR 3296

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-12-07 17:51:39 +09:00
Kir Kolyshkin
75761bccf7 Fix codespell warnings, add codespell to ci
The two exceptions I had to add to codespellrc are:
 - CLOS (used by intelrtd);
 - creat (syscall name used in tests/integration/testdata/seccomp_*.json).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-08-17 16:12:35 -07:00
Kir Kolyshkin
f99d252d2b docs/terminals.md: add troubleshooting
Explain where the "/dev/tty: no such device or address" error is coming
from, and provide ways to solve the issue.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-06-02 09:36:10 -07:00
Kir Kolyshkin
44611630a5 docs/systemd: add
1. Move docs/systemd-properties.md to docs/systemd.md

2. Document the cgroupsPath to systemd unit name and slice conversion
   rules, as well as mapping of OCI runtime spec resource limits to
   systemd unit properties.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-04-01 19:50:47 -07:00
Kir Kolyshkin
636f23dd21 Merge pull request #2674 from AkihiroSuda/graduate-cgroup2-experimental
Move cgroup v2 out of experimental
2020-11-10 15:16:03 -08:00
Akihiro Suda
3f2f06dfe1 Move cgroup v2 out of experimental
After a lot of refactoring, our cgroup v1 and v2 drivers now have same level of implementation quality,
so we can move the v2 driver out of experimental.

Close #2663

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-11-10 17:07:06 +09:00
Kenta Tada
896da0b95e docs: terminals: modify the example of Pass-Through mode.
This commit removes the unnecessary ampersand.
Especially, it causes the error of "ambiguous redirect" when use bash.

Signed-off-by: Kenta Tada <Kenta.Tada@sony.com>
2020-11-09 17:10:52 +09:00
Aos Dabbagh
b448330514 Add error message
* Updated cgroups-v2 documentation to mention dbus-user-session requirement
* Added friendlier error message

Signed-off-by: Aos Dabbagh <aosdab@gmail.com>
2020-10-05 17:08:07 -04:00
Akihiro Suda
1386570498 add cgroup v2 documentation
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-06-04 00:21:31 +09:00
Aleksa Sarai
eea0fbfec1 docs: terminals: mention subreaper requirement
I realised that the terminal documentation which covers detached
terminals fails to mention that callers need to make themselves a
subreaper. Probably a good idea to mention this. I've also included a
minor comparison to LXC.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
2020-04-28 22:53:59 +10:00
Kir Kolyshkin
1cd71dfd71 systemd properties: support for *Sec values
Some systemd properties are documented as having "Sec" suffix
(e.g. "TimeoutStopSec") but are expected to have "USec" suffix
when passed over dbus, so let's provide appropriate conversion
to improve compatibility.

This means, one can specify TimeoutStopSec with a numeric argument,
in seconds, and it will be properly converted to TimeoutStopUsec
with the argument in microseconds. As a side bonus, even float
values are converted, so e.g. TimeoutStopSec=1.5 is possible.

This turned out a bit more tricky to implement when I was
originally expected, since there are a handful of numeric
types in dbus and each one requires explicit conversion.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-02-17 16:07:19 -08:00
Kir Kolyshkin
2a81236e89 Document using annotations to set systemd props
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-02-17 16:07:19 -08:00
Amye Scavarda Perrin
0061cad878 Adding .pdf of audit
Signed-off-by: Amye Scavarda Perrin <amye@linuxfoundation.org>
2020-01-31 10:59:43 +11:00
Adrian Reber
dd50c7e332 Add 'org.criu.config' annotation documentation
Signed-off-by: Adrian Reber <areber@redhat.com>
2019-01-15 19:54:47 +01:00
Aleksa Sarai
472fcb30d9 docs: add information about terminals
Users can get very confused by how terminals work with runc, and the
quite confusing "terminal: ..." option. Add a document which goes
through all of the important parts of terminal handling in runc, in the
hopes that we can just point people to this as an explanation.

Signed-off-by: Avi Deitcher <avi@deitcher.net>
[cyphar: quite a large rewrite to fix factual errors and structure]
Co-authored-by: Avi Deitcher <avi@deitcher.net>
Signed-off-by: Aleksa Sarai <asarai@suse.de>
2018-06-25 05:34:50 +10:00
Michael Crosby
8f97d39dd2 Move libcontainer into subdirectory
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-06-21 19:29:15 -07:00
Shishir Mahajan
e9f8f8528a Created man page for nsinit
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
2015-01-29 16:33:08 -05:00