Commit Graph

497 Commits

Author SHA1 Message Date
James Sturtevant c696ce477d Release fix for cgroup parsing
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2024-03-19 21:25:23 +00:00
Jiaxiao Zhou 6b9e5b28be Update crates/shim/src/cgroup.rs
Co-authored-by: James Sturtevant <jsturtevant@gmail.com>
Signed-off-by: Jiaxiao Zhou <duibao55328@gmail.com>
2024-03-18 23:27:49 +00:00
jiaxiao zhou 69a7e651ea cargo clippy
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
2024-03-18 23:27:49 +00:00
jiaxiao zhou f4753c3493 fix: make parse_cgroups_v2_path clearer
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
2024-03-18 23:27:49 +00:00
jiaxiao zhou a5613a27df fix: more gracefully handle multiple lines in the cgroups file
Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
2024-03-18 23:27:49 +00:00
jiaxiao zhou 85a15724d0 fix(shim): rewrite cgroups v2 parsing logic
this commit rewrites the cgroups v2 parsing logic in get_cgroup function
which is used to fetch stats of a container. The reason for the rewrite
was that in some cases the original logic would panic due to index
of bound for parsing paths like

0::/kubepods-besteffort-pod162385e5_7f69_4c38_ba9c_db0a8f02b35e.slice:cri-containerd:278a0aac1fff30dfbc41b4a32ba9de4519928fe7480213dba87aa1498838ef34

we ran into this issue in deleting a spin container in the spin shim.

the rewrite replaces index access to properly propogate the error to
the caller of the function and added a few unit tests for the parsing logic.

Signed-off-by: jiaxiao zhou <jiazho@microsoft.com>
2024-03-18 23:27:49 +00:00
James Sturtevant 7591cb8ee7 Mark Error for windows only
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2024-03-15 20:37:48 +00:00
James Sturtevant 31c28428d9 Run clippy and tests on sync code in containerd-shim
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2024-03-15 20:37:48 +00:00
Maksym Pavlenko 66e513a449 Fix containerd shim
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-03-14 17:32:51 +00:00
James Sturtevant 798ab74d20 Release 0.7.0 of Shim and 0.5.0 of client
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2024-03-13 19:20:17 +00:00
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
dependabot[bot] e76ba41079 build(deps): update nix requirement from 0.27 to 0.28
Updates the requirements on [nix](https://github.com/nix-rust/nix) to permit the latest version.
- [Changelog](https://github.com/nix-rust/nix/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nix-rust/nix/compare/v0.27.0...v0.28.0)

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

Signed-off-by: dependabot[bot] <support@github.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 e37e0ac639 Fix windows CI
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-23 23:03:10 +00:00
Maksym Pavlenko 2b83df8303 Remove ci-windows.yml
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-23 23:03:10 +00:00
Maksym Pavlenko 08c563b51a Consolidate windows and linux CIs
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-23 23:03:10 +00:00
Maksym Pavlenko 84cc3d9f7b
[codecov] Suppress PR comments
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-22 12:14:10 -08:00
Maksym Pavlenko cc445f54c0 Use wget to download containerd archive
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-22 17:49:39 +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
dependabot[bot] 1b2a74aa8a build(deps): update tonic requirement from 0.10 to 0.11
Updates the requirements on [tonic](https://github.com/hyperium/tonic) to permit the latest version.
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/tonic/compare/v0.10.0...v0.10.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-15 21:02:42 +00:00
Maksym Pavlenko 9734a00462 Add job to finalize statuses
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-15 20:33:35 +00:00
Maksym Pavlenko 2d18a663a4 Add 2.0 beta 2 to CI
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-15 20:33:35 +00:00
Maksym Pavlenko 2e58639737 Update containerd versions on CI
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-15 20:33:35 +00:00
Maksym Pavlenko 49a4a832c6
Add coverage badge
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-15 12:39:37 -08:00
Maksym Pavlenko cffe94bf0b
Fix coverage CI job
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-02-15 10:09:07 -08:00
dependabot[bot] 2f0ffb98b5 build(deps): update tonic-build requirement from 0.10 to 0.11
Updates the requirements on [tonic-build](https://github.com/hyperium/tonic) to permit the latest version.
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/tonic/compare/v0.10.0...v0.10.2)

---
updated-dependencies:
- dependency-name: tonic-build
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-12 17:27:15 +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
dependabot[bot] bca3554a52 build(deps): bump codecov/codecov-action from 3 to 4
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3 to 4.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-01 23:45:23 +00:00
Maksym Pavlenko 566ccd336c Run coverage against main branch only
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-01-30 20:32:39 +00:00
Maksym Pavlenko dd07aefac5 Use codecov for tests coverage info
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-01-30 20:32:39 +00:00
Maksym Pavlenko 90e58b7b9f Fix labeler config
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2024-01-08 22:47:51 +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] 0b6ffc3b35 build(deps): bump actions/labeler from 4 to 5
Bumps [actions/labeler](https://github.com/actions/labeler) from 4 to 5.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/v4...v5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-16 09:18:55 +00:00
dependabot[bot] d29d91b888 build(deps): bump actions/upload-artifact from 3 to 4
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-16 09:18:34 +00:00
dependabot[bot] 26e4cd56de build(deps): bump actions/github-script from 6 to 7
Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-15 22:02:51 +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
dependabot[bot] db720f3608 build(deps): bump actions/setup-go from 4 to 5
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v4...v5)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-15 22:01:32 +00:00
James Sturtevant 9e1c40d634 Bump to recent go version
Signed-off-by: James Sturtevant <jstur@microsoft.com>
2023-12-15 09:50:10 +00:00
Maksym Pavlenko a003dac568 Fix publisher
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2023-10-30 13:32:54 -07: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