Commit Graph

109 Commits

Author SHA1 Message Date
James Sturtevant b15a1dd0c9 Transfer ownership of FD
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2024-03-12 18:56:40 +00:00
James Sturtevant 9c375635b6 Remove depreciated functions
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2024-03-12 05:03:06 +00:00
James Sturtevant 0e7760806f Use RUST_LOG env to configure logging if present
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2024-03-06 20:28:03 +00:00
BaiQiuLi 3d4de340d8 Fix the issue of process freezing when there is a large amount of sigpipe signals occurring during containerd process restart.
Signed-off-by: BaiQiuLi <bo.qiuli@zte.com.cn>
2024-02-02 16:31:59 +00:00
jokemanfire 2236ba39d9 fmt modify 2024-01-03 19:59:52 +00:00
jokemanfire a9f1dcf777 fmt modify 2024-01-03 19:59:52 +00:00
jokemanfire 9675c9a4ab "Subsystem::Mem" add judge for the limit and swap
this error wiil ocurr
in  containerd's TestUpdateContainerResources_MemoryLimit
2024-01-03 19:59:52 +00:00
James Sturtevant 74a67025ad use process thread group id for the process
in cgroupv2 we should use the cgroups.proc file when adding a process (https://www.man7.org/linux/man-pages/man7/cgroups.7.html).  The add_tasks function was writing to the cgroup.threads file which is only avaliable when in threaded mode.  In either case our intent is to add the process not the individual threads to we should use add_task_by_tgid. See https://github.com/kata-containers/cgroups-rs/pull/104 for when this was added

Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-10-25 02:13:26 +00:00
James Sturtevant 11a6559c39 Updates cgroup rs to latest version
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-10-25 02:13:26 +00:00
James Sturtevant e31b3c634f fix up windows
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-10-11 20:13:32 +00:00
James Sturtevant f446bdb64d Add support for structured logging
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-10-11 20:13:32 +00:00
Maksym Pavlenko e8ad07d5fd
Update nix crate
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-10-05 11:37:27 -07:00
Maksym Pavlenko a0e042a46e
Merge pull request #208 from mxpv/docs
Simplify doc management and update READMEs
2023-10-04 11:24:21 -07:00
Maksym Pavlenko e9910f30b8 Simplify doc management
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-10-03 20:41:38 -07:00
James Sturtevant fd734b4e7a Use format similiar to containerd
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-10-04 03:40:46 +00:00
James Sturtevant 75d6deeac3 Retry when pipe is busy
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-10-04 03:36:08 +00:00
Bryant Biggs d3088c42ee fix: Use `rfind` to slice string up to last `/` 2023-09-21 16:27:28 +00:00
Bryant Biggs 3489707748 feat: Replace use of regex crate 2023-09-21 16:27:28 +00:00
Bryant Biggs 2c98dae3f1 refactor: Simplify longest common prefix logic 2023-09-21 16:27:28 +00:00
Bryant Biggs 0a5bf7d816 deps: Replace `regex` with the lighter weight `regex-lite` 2023-09-21 16:27:28 +00:00
jiaxiao zhou deea90ff83
feat(runc-shim): add a version flag
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
2023-08-21 21:45:01 +00:00
James Sturtevant 3e7647d620 Handle cgroup v1 or v2 to enable resource updates
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-08-21 16:19:34 +00:00
Maksym Pavlenko f1d2500c1f Fix docs link
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-08-08 10:07:45 -07:00
jiaxiao zhou 39532a3c00
feat: add cgroup v2 support for metrics
This commits adds cgroup v2 support for collecting metrics in the shim.

Additionally, it uses CPU controller instead of the CPUAcct controller
for reporting CPU metrics back to containerd.

Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
2023-08-02 02:43:12 +00:00
James Sturtevant 60558b7848 Pass all commandline arguments through
Because the second invocation of the shim doesn't have the containerd pipe passed to it, a shim that wants to communicate over the pipe needs to parse the arguments its own.  This makes it so the library pass all the arguments, which has already parsed the arguments allowing shims to use the containerd address.

Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-07-20 21:43:23 +00:00
Jorge Prendes 4da0055413
Add missing condition to stop reaping child procs
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
2023-07-05 16:54:42 +01:00
James Sturtevant bdd17eb2a5
Update to use latest ttrpc library
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-06-22 12:14:29 -07:00
James Sturtevant 38545a7d56
Use inline platform branches
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-06-22 10:06:40 -07:00
James Sturtevant b97955944c
Clean up signal processing
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-06-22 10:06:39 -07:00
James Sturtevant fa4a0045e6
Make one function that works for both platforms
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-06-22 10:06:39 -07:00
James Sturtevant bceaf4aca3
Windows support for the synchronous shim
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-06-22 10:06:39 -07:00
Maksym Pavlenko dad95076c4 Move Stdio to runc-shim
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-03-16 11:35:03 -07:00
Maksym Pavlenko 2fcf8af423 Move processes to runc-shim
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-03-16 11:24:31 -07:00
Maksym Pavlenko 33d37c0c0d Move console to runc-shim
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-03-16 11:16:24 -07:00
Maksym Pavlenko 45c0c0d4e0 Move async container and task modules to runc-shim
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-03-15 14:26:15 -07:00
Zhang Tianyang ffa56dbf3b runc-shim: fix leaking thread and fd
The stdin fifo fd should be closed when containerd
calls close io, otherwise, runc-shim would hold
this fd and the copy console thread forever.

Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
2023-01-16 23:37:44 +08:00
utam0k fe1b3b0f73
Fix the warns from clippy lints
Signed-off-by: utam0k <k0ma@utam0k.jp>
2022-12-29 21:21:55 +09:00
Maksym Pavlenko 55aa661b4d Update Rust to 1.65
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-11-04 14:34:49 -07:00
Maksym Pavlenko 5ddd3e37bb Run fmt
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-09-29 11:55:31 -07:00
Maksym Pavlenko 97d00b4947
Merge pull request #95 from mxpv/ttrpc 2022-09-23 19:08:42 -07:00
Maksym Pavlenko 26ae44e5c3 Update ttrpc dependencies and switch to Protobuf 3
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-09-23 08:54:45 -07:00
Maksym Pavlenko 78cd9dda69 Fix docs
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-09-22 18:50:31 -07:00
Zhang Tianyang 132b3fb221 shim: fix bug in mount rootfs flag
Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
2022-09-20 22:16:03 +08:00
yuqitao fdd5d7c7d1 synchronous: supprt more overlayfs layers
Signed-off-by: yuqitao <yuqitao1024@qq.com>
2022-05-27 15:27:08 +08:00
Maksym Pavlenko cfe09e2227 Update nix dependency
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2022-05-05 14:55:34 -07:00
Yuna Tomida f9ae07236d
removed unsafe codes on runc client and shim
Signed-off-by: Yuna Tomida <ytomida.mmm@gmail.com>
2022-05-04 15:39:41 +09:00
Feng Shaobao df87a63c8e add exit-signal for container
to exit io copy tasks when deleting container

Signed-off-by: Feng Shaobao <fshb1988@gmail.com>
2022-03-22 14:47:41 +08:00
Feng Shaobao 93cc73cf9b upgrade rust toolchain version to 1.59
the dependent path-dedot crate updated to rust edition 2021, we have to
upgrade out toolchain version to compile

Signed-off-by: Feng Shaobao <fshb1988@gmail.com>
2022-03-18 17:26:24 +08:00
Feng Shaobao 63a4e5c891 fix tokio not exit and signal handle exit issue
make all integartion tests passed

Signed-off-by: Feng Shaobao <fshb1988@gmail.com>
2022-03-18 12:39:36 +08:00
Feng Shaobao b48cc3d993 add update/stats/pids for async
Signed-off-by: Feng Shaobao <fshb1988@gmail.com>
2022-03-16 10:07:31 +08:00