Commit Graph

191 Commits

Author SHA1 Message Date
Feng Shaobao 01f4916f95 shim: Support async traits and helper functions
Signed-off-by: Feng Shaobao <fshb1988@gmail.com>
2022-03-07 15:33:49 +08:00
Maksym Pavlenko 3aa4a4da77
Merge pull request #48 from Burning1020/shim-cgroup
runc-shim: support shim cgroup and oom score
2022-03-05 14:50:42 -08:00
Zhang Tianyang 4e1c3a2a69 runc-shim: support shim cgroup and oom score
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
2022-03-04 15:47:29 +08:00
Maksym Pavlenko 1af2be1248
Merge pull request #49 from Burning1020/prctl
shim: refine set subreaper
2022-03-03 10:39:10 -08:00
Zhang Tianyang fda23cd59f shim: refine set subreaper
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
2022-03-03 20:46:01 +08:00
Maksym Pavlenko 3f153482bc
Merge pull request #47 from containerd/dependabot/github_actions/actions/checkout-3
build(deps): bump actions/checkout from 2 to 3
2022-03-01 22:03:36 -08:00
dependabot[bot] 3af39956be
build(deps): bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 22:35:39 +00:00
Maksym Pavlenko 375bc65791
Merge pull request #46 from Burning1020/impl-pids
runc-shim: impl close io and pids task
2022-03-01 11:29:03 -08:00
Zhang Tianyang a06ec3df2d runc-shim: implement pids task
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
2022-03-01 19:04:12 +08:00
Zhang Tianyang 3ffe778e4b runc-shim: implement close io task
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
2022-03-01 19:02:31 +08:00
Maksym Pavlenko d654b18d80
Merge pull request #45 from Burning1020/piped-io
runc: Set piped stdio as default
2022-02-28 11:11:22 -08:00
Maksym Pavlenko 1400b86a6a
Merge pull request #43 from Yuna-Tomi/fix-msrv
fixed msrv in README.md to 1.54
2022-02-28 10:52:19 -08:00
Zhang Tianyang dd90a9180f runc: Set piped stdio as default
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
2022-02-28 21:36:03 +08:00
Yuna Tomida 7e3b045e68
fix msrv to 1.54
Signed-off-by: Yuna Tomida <ytomida.mmm@gmail.com>
2022-02-28 09:49:33 +00:00
Maksym Pavlenko f7335a88a9
Merge pull request #42 from Burning1020/dev
runc-shim: implement stats and update task
2022-02-27 12:24:39 -08:00
Zhang Tianyang cdb93f2358 runc-shim: implement update task
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
2022-02-27 18:12:33 +08:00
Zhang Tianyang 9b93f39ee1 runc-shim: implement stats task
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
2022-02-27 18:12:33 +08:00
Maksym Pavlenko c630c56e57
Merge pull request #41 from mxpv/exit
Rework exit signals and task creation
2022-02-25 12:30:37 -08:00
Maksym Pavlenko fa0d72f516 Fix clippy warnings
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-02-24 11:46:22 -08:00
Maksym Pavlenko 996c8e6aa8 Rework exit signal and task creation
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-02-24 11:32:34 -08:00
Maksym Pavlenko 4d8fa81a27
Merge pull request #39 from jiangliu/runc
Bug fixes and improvements to the runc crate
2022-02-24 08:42:40 -08:00
Liu Jiang 33e940b9c8 runc: refine the way to setup Io
Refine the way to setup Io drivers for runC.

The capability to capture output/error messages from runc depends on
the Io driver used. Some add two more Io drivers: InheritedStdIo and
PipedStdIo. Also document whether the Io driver supports capturing
output/error messages.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2022-02-24 18:47:08 +08:00
Liu Jiang 41c2083eac runc: simple syntax improvments
Simple syntax only improvements.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2022-02-24 18:46:38 +08:00
Liu Jiang fc50adf2dc runc: implement sync version of ps() and stats()
Implement sync version of ps() and stats().

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2022-02-24 18:46:37 +08:00
Liu Jiang 95cda30597 runc: fix two bugs in preparing command line arguments
1) it should use "runc resume" instead of "runc pause" for resume()
2) the order of arguments to run() is wrong, other options may appear
   between "--bundle" and "bundle_id".

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2022-02-24 18:46:36 +08:00
Liu Jiang 6c6fa1ac09 runc: make async version of Runc::create() to return Response
Make async version of Runc::create() to return `Response` instead of
`()`, to keep symmetry with sync version.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2022-02-24 18:46:35 +08:00
Liu Jiang f5f18ec52b runc: avoid unwrap() in runc::launch()
In runc::launch(), it does
        let stdout = String::from_utf8(result.stdout).unwrap();
        let stderr = String::from_utf8(result.stderr).unwrap();

This is risk of DoS attack because the content result.stdout/sterr may
contain contents generated by the container, so it may contain malicious
non-UTF8 characters.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2022-02-24 18:46:33 +08:00
Maksym Pavlenko fa766d4e75
Merge pull request #38 from Burning1020/fix-files-leak 2022-02-23 15:47:37 -08:00
Maksym Pavlenko 05534eb40d
Merge pull request #36 from jiangliu/shim-proto-build 2022-02-23 15:46:06 -08:00
Zhang Tianyang b08e4090ea runc: fix bug that exec command leaks files
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
2022-02-23 21:16:16 +08:00
Liu Jiang 43f4702b7a shim-proto: group common proto types into types
Group generated soruce files for common protobuf source files into
src/types, also simplify the build.rs.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-02-23 16:39:09 +08:00
Maksym Pavlenko 3905a44f0f Run tests separately on CI
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-02-22 11:28:20 -08:00
Maksym Pavlenko 5c50736975
Merge pull request #35 from mxpv/dep
Remove runc dependency from shim crate
2022-02-22 10:12:56 -08:00
Maksym Pavlenko 78521c80bf Remove runc dependency from shim crate
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-02-21 10:26:19 -08:00
Maksym Pavlenko a1b2a25987 Update Cargo.toml for runc-shim
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-02-21 09:59:16 -08:00
Maksym Pavlenko 03496c936b
Merge pull request #34 from quanweiZhou/develop
support async for containerd-shim-protos
2022-02-21 09:52:01 -08:00
Maksym Pavlenko a4e923d885
Merge pull request #24 from Burning1020/mini-runc
Minimum runc shim implementation
2022-02-21 09:43:48 -08:00
Quanwei Zhou c4471c4cbf shim-proto: add async example
Fixes: #33
Signed-off-by:Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-02-21 18:10:12 +08:00
Quanwei Zhou 6e50c8741c shim-proto: support async
Fixes: #33
Signed-off-by: Quanwei Zhou <quanweiZhou@linux.alibaba.com>
2022-02-21 16:52:45 +08:00
Zhang Tianyang 117263d9be Move Io and Console
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
2022-02-17 23:06:35 +08:00
Zhang Tianyang db4e648261 Simpify Config transmission mode
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
2022-02-17 23:02:26 +08:00
Zhang Tianyang 620ce26d59 Remove extern use and refactor naming
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
2022-02-17 23:02:26 +08:00
Zhang Tianyang 0a33f3e867 Runc shim implementation
Implement shim cli commands and some basic task APIs to run a runc container

Co-authored-by: Feng Shaobao fshb1988@gmail.com
Co-authored-by: Zhang Tianyang burning9699@gmail.com
Co-authored-by: Yu Qitao yuqitao1024@qq.com

Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
2022-02-17 23:02:14 +08:00
Maksym Pavlenko 1ee67cf5d8
Merge pull request #32 from mxpv/io
IO follow up
2022-02-15 18:40:33 -08:00
Maksym Pavlenko 464af70dfa Remove IO impl for Arc
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-02-15 10:44:18 -08:00
Maksym Pavlenko 67c4279430
Merge pull request #29 from jiangliu/runc
Enhancements to the runc crate
2022-02-15 09:50:39 -08:00
Liu Jiang d453f1e38a runc: implement Io for Arc<T: Io>
Add an implementation of `impl<T: Io> Io for Arc<T>`.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2022-02-15 14:08:13 +08:00
Liu Jiang 0dc9705d7e runc: add unit test cases for io.rs
Add unit test cases for io.rs to avoid mistake.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2022-02-15 14:08:12 +08:00
Liu Jiang a52bcd0c7e runc: add helper PipedIo::create_pipe()
Add helper PipedIo::create_pipe() to reduce duplicated code.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2022-02-15 14:08:11 +08:00
Liu Jiang be8046e832 runc: simplify code a bit and refine doc
Simplify code in io.rs a bit, also refine doc and simplify code.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2022-02-15 14:08:10 +08:00