Commit Graph

297 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
dependabot[bot] d32d023eb3 build(deps): update command-fds requirement from 0.2.1 to 0.3.0
Updates the requirements on [command-fds](https://github.com/google/command-fds) to permit the latest version.
- [Commits](https://github.com/google/command-fds/compare/0.2.1...0.3.0)

---
updated-dependencies:
- dependency-name: command-fds
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.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
Qiao 21973bd49e add oom monitor for rustshim 2024-03-06 20:29:02 +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
Maksym Pavlenko af09869cee Patch invalid proto comments
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-22 17:49:39 +00:00
Maksym Pavlenko 1d819cc0c4 Suppress warnings for generated code
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-22 17:49:39 +00:00
Maksym Pavlenko b769e85b33 Update vendor
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-22 17:49:39 +00:00
Maksym Pavlenko 202c785059 Add update vendor script
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-22 17:49:39 +00:00
zhang yu 10307750 3a7b9ce173 feat: set THP_DISABLE=true in shim, and restore it before starting runc
If /sys/kernel/mm/transparent_hugepage/enabled=always, the shim process
will use huge pages, which will consume a lot of memory.

Just like this:
ps -efo pid,rss,comm | grep shim
    PID   RSS COMMAND
   2614  7464 containerd-shim

I don't think shim needs to use huge pages, and if we turn off the huge
pages option, we can save a lot of memory resources.

After we set THP_DISABLE=true:
ps -efo pid,comm,rss
    PID COMMAND           RSS
1629841 containerd-shim  5648

containerd
    |
    |--shim1   --start
        |
        |--shim2    (this shim will on host)
            |
            |--runc create (when containerd send create request by ttrpc)
                |
                |--runc init (this is the pid 1 in container)

    we should set thp_disabled=1 in shim1 --start, because if we set this
    in shim 2, the huge page has been setted while func main() running,
    we set thp_disabled cannot change the setted huge pages.
    So We need to set thp_disabled=1 in shim1 so that shim2 inherits the
    settings of the parent process shim1, and shim2 has closed the
    hugepage when it starts.

    For runc processes, we need to set thp_disabled='before' in shim2 after
    fork() and before execve(). So we use cmd.pre_exec to do this.
2024-02-20 02:43:24 +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
Andrew Baxter 9ac1f26516 `Runc::state()` returns wrong type with async feature
It's a very small change so I figured it's simpler to open a PR than an issue first.

The sync `state` method returns `Container` but for async returns `Vec<usize>`, and I couldn't locate an explanation for why these might be different so I assume it's a mistake.  From a user perspective too I want Container rather than a usize vec.

Signed-off-by: Andrew Baxter <i@isandrew.com>
2023-12-25 17:56:09 +00:00
dependabot[bot] c43b1e4a41 build(deps): update windows-sys requirement from 0.48.0 to 0.52.0
Updates the requirements on [windows-sys](https://github.com/microsoft/windows-rs) to permit the latest version.
- [Release notes](https://github.com/microsoft/windows-rs/releases)
- [Commits](https://github.com/microsoft/windows-rs/compare/0.48.0...0.52.0)

---
updated-dependencies:
- dependency-name: windows-sys
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-15 22:02:09 +00:00
James Sturtevant fca511e235 Create v0.6.0 release of containerd-shim and shim-protos
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-10-30 18:05:57 +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
Maksym Pavlenko 0701d3602a
Update TTRPC
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-10-19 12:44:58 -07: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 85557745e0 Make examples compilable
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-10-03 20:41:38 -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 5e1b7760a1 chore: Standardize Cargo.toml files, enable more workspace dependencies 2023-09-21 13:04:22 -04: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
Bryant Biggs 125ad82a43 fix: Remove runtime protos and add streaming and transfer services into build.rs 2023-09-18 21:31:53 +00:00
Bryant Biggs 273b527bd2 fix: Replace tabs with spaces to pass CI 2023-09-18 21:31:53 +00:00
Bryant Biggs 3143c26bd2 feat: Update proto files to latest and remove gogo use 2023-09-18 21:31:53 +00:00
Maksym Pavlenko c3999253a1 Fix CI
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-09-05 10:39:25 -07:00
James Sturtevant fd1b235913 Bump the version for shim protos and containerd-shim
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-08-24 16:40:16 +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
Maksym Pavlenko 8590ef8d12
Merge pull request #177 from jsturtevant/fix-update-cgroup-taskupdate
Handle cgroup v1 or v2 to enable resource updates
2023-08-21 09:52:03 -07: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
James Sturtevant 8fde77f1c8 Add Windows statistics protobuf pacakge
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-08-21 16:18:44 +00:00
Maksym Pavlenko 0659a93663
Bump snapshots to 0.3.0
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-08-10 15:09:05 -07:00
Maksym Pavlenko 13ae16577a
Bump client to 0.4.0
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-08-10 12:58:06 -07:00
Maksym Pavlenko 32362ace1d
Merge pull request #171 from mxpv/client
Improve containerd client ergonomics
2023-08-09 15:32:32 -07:00
Maksym Pavlenko a65ec7f6df Improve containerd client ergonomics
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-08-09 12:03:36 -07:00
dependabot[bot] 0f4812ca7a
build(deps): update page_size requirement from 0.5.0 to 0.6.0
Updates the requirements on [page_size](https://github.com/Elzair/page_size_rs) to permit the latest version.
- [Commits](https://github.com/Elzair/page_size_rs/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-08-09 18:18:51 +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
Maksym Pavlenko 77a2b87c18 [runc-shim] Move async code to package root
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-08-08 10:07:45 -07:00
Maksym Pavlenko 53cc80da4d Remove sync runc shim
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-08-08 10:07:45 -07:00