Commit Graph

109 Commits

Author SHA1 Message Date
Liu Jiang 4b3efbc875 runc: move runc commandline constants into options.rs
Move runc commandline related constants into options.rs, so options.rs
hosts all commandline parsing related code. And util.rs only hosts
utilities.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2022-02-14 16:57:04 +08:00
Liu Jiang cfdbb4dbcd runc: rename ConfigBuilder as GlobalOpts and moves it into options.rs
Rename ConfigBuilder as GlobalOpts and moves it into options.rs,
to follow the runc man pages.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2022-02-14 16:48:08 +08:00
Liu Jiang 2cba19f230 runc: avoid using unwrap() in util.rs
Introduce helper path_to_string() to avoid using unwrap().

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2022-02-14 16:48:08 +08:00
Maksym Pavlenko ab45a92d6d Add async feature
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-02-13 14:23:16 -08:00
Maksym Pavlenko 0c6ca068ed
Merge pull request #26 from jiangliu/doc 2022-02-12 08:44:33 -08:00
Liu Jiang f1b90cc9b2 shim: add inline doc for set_subreaper() and SOCKET_FD
As follow-on work, add inline documentation for set_reapder(#19)
and SOCKET_FD (#20).

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2022-02-12 16:25:10 +08:00
Maksym Pavlenko 64306e3e4d Remove target checks
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-02-11 11:41:12 -08:00
Maksym Pavlenko 14dceb116f Remove duplicated config builder
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-02-11 11:18:16 -08:00
Maksym Pavlenko 3b2b00f206 Update README
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-02-11 10:10:42 -08:00
Akihiro Suda 6e17be8d75
crates/shim-protos: regenerate with rust-protobuf 2.27.1
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-02-06 18:33:18 +09:00
Akihiro Suda 522e26fab8
crates/runc/src/lib.rs: fix compilation on non-Linux
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-02-06 18:32:35 +09:00
Yuna Tomida eddd107601
remove unnecessary 'forget'
Signed-off-by: Yuna Tomida <ytomida.mmm@gmail.com>
2022-02-04 02:27:54 +00:00
Yuna Tomida 8f3e556a1b
renamed crate and applied recommended changes
Signed-off-by: Yuna Tomida <ytomida.mmm@gmail.com>
2022-02-04 00:39:39 +00:00
Yuna Tomida 8bbd4e7baf
fixed clippy warnings in shim::args and example in client
Signed-off-by: Yuna Tomida <ytomida.mmm@gmail.com>
2022-02-03 13:35:24 +00:00
Yuna Tomida 43cf334648
applied fmt
Signed-off-by: Yuna Tomida <ytomida.mmm@gmail.com>
2022-02-03 08:35:04 +00:00
Yuna Tomida 2663849a52
confirmed tests
Signed-off-by: Yuna Tomida <ytomida.mmm@gmail.com>
2022-02-03 07:04:26 +00:00
Yuna Tomida 7c2b93f187
removed chrono from dependencies and applied fmt
Signed-off-by: Yuna Tomida <ytomida.mmm@gmail.com>
2022-02-03 05:09:17 +00:00
Yuna Tomida d34fa454ad
runc client
Signed-off-by: Yuna Tomida <ytomida.mmm@gmail.com>
2022-02-03 02:19:22 +00:00
Maksym Pavlenko f035941680
Merge pull request #20 from Burning1020/fix-socket-address
[shim] Fix socket binding address
2022-02-02 10:14:26 -08:00
Burning 88882cb2e2 [shim] Fix socket binding address
As there is no need in "-socket" flag, we'd better use SOCKET_FD as the binding address of task server only.

Signed-off-by: Burning <burning9699@gmail.com>
2022-01-22 20:28:12 +08:00
Burning 7c9a6a5a25 [shim] Set the "child subreaper" attribute
The shim process can have "child subreaper" attribute when arg2 is nonzero.

Signed-off-by: Burning <burning9699@gmail.com>
2022-01-22 19:50:19 +08:00
Maksym Pavlenko 9030cffa98
Merge pull request #17 from mxpv/ttrpc
Update ttrpc-rust to 0.6
2022-01-20 10:30:30 -08:00
dependabot[bot] 62755062d3
Update simple_logger requirement from 1.16 to 2.0
Updates the requirements on [simple_logger](https://github.com/borntyping/rust-simple_logger) to permit the latest version.
- [Release notes](https://github.com/borntyping/rust-simple_logger/releases)
- [Commits](https://github.com/borntyping/rust-simple_logger/compare/v1.16.0...v2.0.0)

---
updated-dependencies:
- dependency-name: simple_logger
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-19 21:37:30 +00:00
Maksym Pavlenko 17ea78a0e0 Update ttrpc-rust to 0.6
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-01-19 08:47:43 -08:00
Samuel Ortiz f2ad153965 [shim] README: Update the example to the latest API
Use the skeleton.rs code.

Signed-off-by: Samuel Ortiz <s.ortiz@apple.com>
2022-01-19 08:31:34 -08:00
Maksym Pavlenko 4e84e9b800 [logger] Update documentation
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-31 12:29:13 +02:00
Maksym Pavlenko 0befc3d4f7 [shim] Rename empty shim example
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-30 10:16:56 +02:00
Maksym Pavlenko 55cd05887d [shim] Add runtime section to README
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-30 10:06:14 +02:00
Maksym Pavlenko f43b11df48 Bump shim to 0.2.0
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-30 09:23:57 +02:00
Maksym Pavlenko 559bf7bc8d Bump shim-protos to 0.1.2
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-30 09:14:03 +02:00
Maksym Pavlenko 4ad21f61b3 [shim-protos] Update README
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-30 09:12:54 +02:00
Maksym Pavlenko 39065ec9ed Rename shim-client to shim-protos
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-30 08:43:32 +02:00
Maksym Pavlenko d901356551 Update dependencies
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-28 10:54:59 +02:00
bin liu cfca48d75c containerd-client: add example to create container and task
Add an example to show how to create/delete containers and tasks.

Signed-off-by: bin liu <bin@hyper.sh>
2021-12-19 20:09:17 -08:00
bin liu 2010a32a47 containerd-client: add task service and with_namespace macro
There is no task service included yet, add the task
service protocol file to build.rs.

Add a with_namespace maro to let user inject namespace

Signed-off-by: bin liu <bin@hyper.sh>
2021-12-19 20:09:17 -08:00
Maksym Pavlenko fcb5cc5966 Update crate description
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-18 10:39:28 -08:00
Maksym Pavlenko a6b32c32bd Add README
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-18 10:39:28 -08:00
Maksym Pavlenko e5d003c8bb Add snapshots example
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-18 10:39:28 -08:00
Maksym Pavlenko 70f7cacdc1 Implement GRPC wrapper for snapshots
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-18 10:39:28 -08:00
Maksym Pavlenko e3b7f97813 Generate GRPC bindings for snapshots
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-18 10:39:28 -08:00
Maksym Pavlenko b342a674b1 Add snapshots crate
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-18 10:39:28 -08:00
Maksym Pavlenko b7e673d7a7 Add cargo deny
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-12-15 20:58:32 -08:00
Liu Jiang 95e8049398 shim: distinguish between runtime id and container id
There's a misuse of runtime id and container id in Shim::new(). Both
runtime id and container id are needed by shim implentions, so add
parameter `container id` to Shim::new().

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-12-14 13:44:45 +08:00
bin liu c12ac9ee68 shim: update README.md to run shim examples
The content of README.md is out of date, update it
with the correct steps to run the examples.

Signed-off-by: bin liu <bin@hyper.sh>
2021-12-14 11:37:00 +08:00
bin liu e5e0ebbe36 shim: pass the correct ID of containers to shim
The ID passed from shim::run::<Service> is the shim name,
the container ID can get from command-line flags.

Signed-off-by: bin liu <bin@hyper.sh>
2021-12-13 18:14:51 +08:00
Liu Jiang 72aebb1b39 shim: trivial documentation enhancements
Trivial documentation enhancements:
1) comments for unsafe code
2) list supported platforms

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-12-13 10:13:05 +08:00
Liu Jiang a2bfeed2ca shim: introduce Shim::wait()
Introduce Shim::wait() to wait for a shim instance to exit, so the
`Shim` implementor could customize the way to manage exit event.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-12-13 10:08:20 +08:00
Liu Jiang fdd50661f3 shim: add interface Shim::get_task_service()
Currently Containerd shimv2 runtime only provides task service, but it
may provide more service in future. So add interface
Shim::get_task_service() to get the task service object instead of
"Shim: Task".

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-12-13 10:08:19 +08:00
Liu Jiang 7a8fa4413e shim: implement ExitSignal with Condvar
Implement ExitSignal with Condvar instead of busy looping.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-12-13 10:08:15 +08:00
Liu Jiang 04af4df73a shim: pass environment variables to spawned process
Enhanace spawn() to pass envrionment variables to child process.

Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
2021-12-13 10:08:15 +08:00