From 96e1fb4ca621129ea769c548e195a129b55ea091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 15 Jan 2026 20:53:27 +0100 Subject: [PATCH] tools: Remove runk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The runk tool hasn't been supported for a few years, with no maintainers since ManaSugi stopped being involved in the project and the CI was disabled in 2024. Signed-off-by: Fabiano FidĂȘncio --- .github/dependabot.yml | 1 - .github/workflows/basic-ci-amd64.yaml | 36 - .github/workflows/run-runk-tests.yaml | 54 - Makefile | 1 - README.md | 1 - src/tools/runk/.gitignore | 1 - src/tools/runk/Cargo.lock | 3943 ----------------- src/tools/runk/Cargo.toml | 38 - src/tools/runk/Makefile | 67 - src/tools/runk/README.md | 352 -- src/tools/runk/libcontainer/Cargo.toml | 32 - .../libcontainer/src/activated_builder.rs | 336 -- src/tools/runk/libcontainer/src/cgroup.rs | 77 - src/tools/runk/libcontainer/src/container.rs | 437 -- .../runk/libcontainer/src/created_builder.rs | 140 - .../runk/libcontainer/src/init_builder.rs | 215 - src/tools/runk/libcontainer/src/lib.rs | 12 - src/tools/runk/libcontainer/src/status.rs | 236 - src/tools/runk/libcontainer/src/utils.rs | 294 -- src/tools/runk/src/commands/create.rs | 28 - src/tools/runk/src/commands/delete.rs | 30 - src/tools/runk/src/commands/exec.rs | 32 - src/tools/runk/src/commands/kill.rs | 58 - src/tools/runk/src/commands/list.rs | 68 - src/tools/runk/src/commands/mod.rs | 17 - src/tools/runk/src/commands/pause.rs | 18 - src/tools/runk/src/commands/ps.rs | 63 - src/tools/runk/src/commands/resume.rs | 18 - src/tools/runk/src/commands/run.rs | 27 - src/tools/runk/src/commands/spec.rs | 207 - src/tools/runk/src/commands/start.rs | 24 - src/tools/runk/src/commands/state.rs | 78 - src/tools/runk/src/main.rs | 133 - tests/README.md | 1 - tests/integration/runk/gha-run.sh | 65 - tests/integration/runk/runk-tests.bats | 127 - .../kata-deploy/local-build/Makefile | 2 - .../local-build/kata-deploy-binaries.sh | 9 - 38 files changed, 7278 deletions(-) delete mode 100644 .github/workflows/run-runk-tests.yaml delete mode 100644 src/tools/runk/.gitignore delete mode 100644 src/tools/runk/Cargo.lock delete mode 100644 src/tools/runk/Cargo.toml delete mode 100644 src/tools/runk/Makefile delete mode 100644 src/tools/runk/README.md delete mode 100644 src/tools/runk/libcontainer/Cargo.toml delete mode 100644 src/tools/runk/libcontainer/src/activated_builder.rs delete mode 100644 src/tools/runk/libcontainer/src/cgroup.rs delete mode 100644 src/tools/runk/libcontainer/src/container.rs delete mode 100644 src/tools/runk/libcontainer/src/created_builder.rs delete mode 100644 src/tools/runk/libcontainer/src/init_builder.rs delete mode 100644 src/tools/runk/libcontainer/src/lib.rs delete mode 100644 src/tools/runk/libcontainer/src/status.rs delete mode 100644 src/tools/runk/libcontainer/src/utils.rs delete mode 100644 src/tools/runk/src/commands/create.rs delete mode 100644 src/tools/runk/src/commands/delete.rs delete mode 100644 src/tools/runk/src/commands/exec.rs delete mode 100644 src/tools/runk/src/commands/kill.rs delete mode 100644 src/tools/runk/src/commands/list.rs delete mode 100644 src/tools/runk/src/commands/mod.rs delete mode 100644 src/tools/runk/src/commands/pause.rs delete mode 100644 src/tools/runk/src/commands/ps.rs delete mode 100644 src/tools/runk/src/commands/resume.rs delete mode 100644 src/tools/runk/src/commands/run.rs delete mode 100644 src/tools/runk/src/commands/spec.rs delete mode 100644 src/tools/runk/src/commands/start.rs delete mode 100644 src/tools/runk/src/commands/state.rs delete mode 100644 src/tools/runk/src/main.rs delete mode 100755 tests/integration/runk/gha-run.sh delete mode 100644 tests/integration/runk/runk-tests.bats diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8de47081de..52f755bc0d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,7 +12,6 @@ updates: - "/src/tools/agent-ctl" - "/src/tools/genpolicy" - "/src/tools/kata-ctl" - - "/src/tools/runk" - "/src/tools/trace-forwarder" schedule: interval: "daily" diff --git a/.github/workflows/basic-ci-amd64.yaml b/.github/workflows/basic-ci-amd64.yaml index 883e3429c2..bf63c5db32 100644 --- a/.github/workflows/basic-ci-amd64.yaml +++ b/.github/workflows/basic-ci-amd64.yaml @@ -163,42 +163,6 @@ jobs: timeout-minutes: 10 run: bash tests/integration/nydus/gha-run.sh run - run-runk: - name: run-runk - # Skip runk tests as we have no maintainers. TODO: Decide when to remove altogether - if: false - runs-on: ubuntu-22.04 - env: - CONTAINERD_VERSION: lts - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - ref: ${{ inputs.commit-hash }} - fetch-depth: 0 - persist-credentials: false - - - name: Rebase atop of the latest target branch - run: | - ./tests/git-helper.sh "rebase-atop-of-the-latest-target-branch" - env: - TARGET_BRANCH: ${{ inputs.target-branch }} - - - name: Install dependencies - run: bash tests/integration/runk/gha-run.sh install-dependencies - - - name: get-kata-tarball - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 - with: - name: kata-static-tarball-amd64${{ inputs.tarball-suffix }} - path: kata-artifacts - - - name: Install kata - run: bash tests/integration/runk/gha-run.sh install-kata kata-artifacts - - - name: Run runk tests - timeout-minutes: 10 - run: bash tests/integration/runk/gha-run.sh run - run-tracing: name: run-tracing strategy: diff --git a/.github/workflows/run-runk-tests.yaml b/.github/workflows/run-runk-tests.yaml deleted file mode 100644 index 0c4126143d..0000000000 --- a/.github/workflows/run-runk-tests.yaml +++ /dev/null @@ -1,54 +0,0 @@ -name: CI | Run runk tests -on: - workflow_call: - inputs: - tarball-suffix: - required: false - type: string - commit-hash: - required: false - type: string - target-branch: - required: false - type: string - default: "" - -permissions: {} - -jobs: - run-runk: - name: run-runk - # Skip runk tests as we have no maintainers. TODO: Decide when to remove altogether - if: false - runs-on: ubuntu-22.04 - env: - CONTAINERD_VERSION: lts - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - with: - ref: ${{ inputs.commit-hash }} - fetch-depth: 0 - persist-credentials: false - - - name: Rebase atop of the latest target branch - run: | - ./tests/git-helper.sh "rebase-atop-of-the-latest-target-branch" - env: - TARGET_BRANCH: ${{ inputs.target-branch }} - - - name: Install dependencies - run: bash tests/integration/runk/gha-run.sh install-dependencies - env: - GH_TOKEN: ${{ github.token }} - - - name: get-kata-tarball - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 - with: - name: kata-static-tarball-amd64${{ inputs.tarball-suffix }} - path: kata-artifacts - - - name: Install kata - run: bash tests/integration/runk/gha-run.sh install-kata kata-artifacts - - - name: Run runk tests - run: bash tests/integration/runk/gha-run.sh run diff --git a/Makefile b/Makefile index 33d9142fed..5476e2dcc2 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,6 @@ TOOLS = TOOLS += agent-ctl TOOLS += kata-ctl TOOLS += log-parser -TOOLS += runk TOOLS += trace-forwarder STANDARD_TARGETS = build check clean install static-checks-build test vendor diff --git a/README.md b/README.md index 6db98ed2da..9ec5aaec34 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,6 @@ The table below lists the remaining parts of the project: | [`agent-ctl`](src/tools/agent-ctl) | utility | Tool that provides low-level access for testing the agent. | | [`kata-ctl`](src/tools/kata-ctl) | utility | Tool that provides advanced commands and debug facilities. | | [`trace-forwarder`](src/tools/trace-forwarder) | utility | Agent tracing helper. | -| [`runk`](src/tools/runk) | utility | Standard OCI container runtime based on the agent. | | [`ci`](.github/workflows) | CI | Continuous Integration configuration files and scripts. | | [`ocp-ci`](ci/openshift-ci/README.md) | CI | Continuous Integration configuration for the OpenShift pipelines. | | [`katacontainers.io`](https://github.com/kata-containers/www.katacontainers.io) | Source for the [`katacontainers.io`](https://www.katacontainers.io) site. | diff --git a/src/tools/runk/.gitignore b/src/tools/runk/.gitignore deleted file mode 100644 index 57872d0f1e..0000000000 --- a/src/tools/runk/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/vendor/ diff --git a/src/tools/runk/Cargo.lock b/src/tools/runk/Cargo.lock deleted file mode 100644 index 4c221f6baa..0000000000 --- a/src/tools/runk/Cargo.lock +++ /dev/null @@ -1,3943 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 4 - -[[package]] -name = "addr2line" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" - -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom 0.2.15", - "once_cell", - "version_check", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anstream" -version = "0.6.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" - -[[package]] -name = "anstyle-parse" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - -[[package]] -name = "anyhow" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" - -[[package]] -name = "arc-swap" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "async-broadcast" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" -dependencies = [ - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-executor" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8828ec6e544c02b0d6691d21ed9f9218d0384a82542855073c2a3f58304aaf0" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand 2.3.0", - "futures-lite 2.3.0", - "slab", -] - -[[package]] -name = "async-fs" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "blocking", - "futures-lite 1.13.0", -] - -[[package]] -name = "async-io" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" -dependencies = [ - "async-lock 2.8.0", - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-lite 1.13.0", - "log", - "parking", - "polling 2.8.0", - "rustix 0.37.28", - "slab", - "socket2 0.4.10", - "waker-fn", -] - -[[package]] -name = "async-io" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" -dependencies = [ - "async-lock 3.4.0", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite 2.3.0", - "parking", - "polling 3.7.2", - "rustix 0.38.34", - "slab", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-lock" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" -dependencies = [ - "event-listener 2.5.3", -] - -[[package]] -name = "async-lock" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" -dependencies = [ - "event-listener 5.3.1", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-process" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6438ba0a08d81529c69b36700fa2f95837bfe3e776ab39cde9c14d9149da88" -dependencies = [ - "async-io 1.13.0", - "async-lock 2.8.0", - "async-signal", - "blocking", - "cfg-if", - "event-listener 3.1.0", - "futures-lite 1.13.0", - "rustix 0.38.34", - "windows-sys 0.48.0", -] - -[[package]] -name = "async-recursion" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "async-signal" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794f185324c2f00e771cd9f1ae8b5ac68be2ca7abb129a87afd6e86d228bc54d" -dependencies = [ - "async-io 2.3.3", - "async-lock 3.4.0", - "atomic-waker", - "cfg-if", - "futures-core", - "futures-io", - "rustix 0.38.34", - "signal-hook-registry", - "slab", - "windows-sys 0.52.0", -] - -[[package]] -name = "async-task" -version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" - -[[package]] -name = "async-trait" -version = "0.1.80" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - -[[package]] -name = "autocfg" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" - -[[package]] -name = "awaitgroup" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc17ab023b4091c10ff099f9deebaeeb59b5189df07e554c4fef042b70745d68" - -[[package]] -name = "backtrace" -version = "0.3.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb531853791a215d7c62a30daf0dde835f381ab5de4589cfe7c649d2cbe92bd6" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-link", -] - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "bitmask-enum" -version = "2.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb15541e888071f64592c0b4364fdff21b7cb0a247f984296699351963a8721" -dependencies = [ - "quote", - "syn 2.0.87", -] - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "blocking" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" -dependencies = [ - "async-channel", - "async-task", - "futures-io", - "futures-lite 2.3.0", - "piper", -] - -[[package]] -name = "borsh" -version = "1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" -dependencies = [ - "borsh-derive", - "cfg_aliases", -] - -[[package]] -name = "borsh-derive" -version = "1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd1d3c0c2f5833f22386f252fe8ed005c7f59fdcddeef025c01b4c3b9fd9ac3" -dependencies = [ - "once_cell", - "proc-macro-crate 3.1.0", - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byte-unit" -version = "5.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cd29c3c585209b0cbc7309bfe3ed7efd8c84c21b7af29c8bfae908f8777174" -dependencies = [ - "rust_decimal", - "serde", - "utf8-width", -] - -[[package]] -name = "bytecheck" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" -dependencies = [ - "bytecheck_derive", - "ptr_meta", - "simdutf8", -] - -[[package]] -name = "bytecheck_derive" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -dependencies = [ - "byteorder", - "iovec", -] - -[[package]] -name = "bytes" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" - -[[package]] -name = "capctl" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a6e71767585f51c2a33fed6d67147ec0343725fc3c03bf4b89fe67fede56aa5" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", -] - -[[package]] -name = "caps" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190baaad529bcfbde9e1a19022c42781bdb6ff9de25721abdb8fd98c0807730b" -dependencies = [ - "libc", - "thiserror 1.0.61", -] - -[[package]] -name = "cc" -version = "1.0.104" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - -[[package]] -name = "cgroups-rs" -version = "0.3.5" -source = "git+https://github.com/kata-containers/cgroups-rs?rev=v0.3.5#de9625ff57d156967b5b2a637c2c41bb2366e39b" -dependencies = [ - "libc", - "log", - "nix 0.25.1", - "regex", - "thiserror 1.0.61", -] - -[[package]] -name = "chrono" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "serde", - "wasm-bindgen", - "windows-targets 0.52.5", -] - -[[package]] -name = "clap" -version = "4.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" -dependencies = [ - "clap_builder", - "clap_derive", -] - -[[package]] -name = "clap_builder" -version = "4.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" -dependencies = [ - "anstream", - "anstyle", - "clap_lex", - "strsim 0.11.1", -] - -[[package]] -name = "clap_derive" -version = "4.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c7947ae4cc3d851207c1adb5b5e260ff0cca11446b1d6d1423788e442257ce" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "clap_lex" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" - -[[package]] -name = "colorchoice" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" - -[[package]] -name = "common-path" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" - -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "const_format" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" -dependencies = [ - "const_format_proc_macros", -] - -[[package]] -name = "const_format_proc_macros" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "cpufeatures" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-epoch", - "crossbeam-queue", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-queue" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "crypto-mac" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" -dependencies = [ - "generic-array", - "subtle", -] - -[[package]] -name = "darling" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f2c43f534ea4b0b049015d00269734195e6d3f0f6635cb692251aca6f9f8b3c" -dependencies = [ - "darling_core 0.12.4", - "darling_macro 0.12.4", -] - -[[package]] -name = "darling" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" -dependencies = [ - "darling_core 0.14.4", - "darling_macro 0.14.4", -] - -[[package]] -name = "darling" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" -dependencies = [ - "darling_core 0.20.9", - "darling_macro 0.20.9", -] - -[[package]] -name = "darling_core" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e91455b86830a1c21799d94524df0845183fa55bafd9aa137b01c7d1065fa36" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", -] - -[[package]] -name = "darling_core" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "darling_core" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.11.1", - "syn 2.0.87", -] - -[[package]] -name = "darling_macro" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29b5acf0dea37a7f66f7b25d2c5e93fd46f8f6968b1a5d7a3e02e97768afc95a" -dependencies = [ - "darling_core 0.12.4", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "darling_macro" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" -dependencies = [ - "darling_core 0.14.4", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "darling_macro" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" -dependencies = [ - "darling_core 0.20.9", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", -] - -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive-new" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3418329ca0ad70234b9735dc4ceed10af4df60eff9c8e7b06cb5e520d92c3535" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d13202debe11181040ae9063d739fa32cfcaaebe2275fe387703460ae2365b30" -dependencies = [ - "derive_builder_macro 0.10.2", -] - -[[package]] -name = "derive_builder" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7" -dependencies = [ - "derive_builder_macro 0.20.0", -] - -[[package]] -name = "derive_builder_core" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66e616858f6187ed828df7c64a6d71720d83767a7f19740b2d1b6fe6327b36e5" -dependencies = [ - "darling 0.12.4", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder_core" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" -dependencies = [ - "darling 0.20.9", - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "derive_builder_macro" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58a94ace95092c5acb1e97a7e846b310cfbd499652f72297da7493f618a98d73" -dependencies = [ - "derive_builder_core 0.10.2", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder_macro" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" -dependencies = [ - "derive_builder_core 0.20.0", - "syn 2.0.87", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer 0.10.4", - "crypto-common", -] - -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "downcast" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1435fa1053d8b2fbbe9be7e97eca7f33d37b28409959813daefc1446a14247f1" - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "enumflags2" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" -dependencies = [ - "enumflags2_derive", - "serde", -] - -[[package]] -name = "enumflags2_derive" -version = "0.7.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93877bcde0eb80ca09131a08d23f0a5c18a620b01db137dba666d18cd9b30c2" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener" -version = "5.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" -dependencies = [ - "event-listener 5.3.1", - "pin-project-lite", -] - -[[package]] -name = "fail" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe5e43d0f78a42ad591453aedb1d7ae631ce7ee445c7643691055a9ed8d3b01c" -dependencies = [ - "log", - "once_cell", - "rand", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "fastrand" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" - -[[package]] -name = "fixedbitset" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" - -[[package]] -name = "flate2" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "fragile" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" - -[[package]] -name = "futures-executor" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" - -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "fastrand 1.9.0", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - -[[package]] -name = "futures-lite" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" -dependencies = [ - "fastrand 2.3.0", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - -[[package]] -name = "futures-macro" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "futures-sink" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" - -[[package]] -name = "futures-task" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" - -[[package]] -name = "futures-util" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" -dependencies = [ - "cfg-if", - "libc", - "r-efi", - "wasi 0.14.2+wasi-0.2.4", -] - -[[package]] -name = "getset" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf0fc11e47561d47397154977bc219f4cf809b2974facc3ccb3b89e2436f912" -dependencies = [ - "proc-macro-error2", - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "gimli" -version = "0.32.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7" - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" - -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hermit-abi" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac", - "digest 0.9.0", -] - -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core 0.52.0", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" -dependencies = [ - "equivalent", - "hashbrown 0.14.5", -] - -[[package]] -name = "inotify" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff" -dependencies = [ - "bitflags 1.3.2", - "futures-core", - "inotify-sys", - "libc", - "tokio", -] - -[[package]] -name = "inotify-sys" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" -dependencies = [ - "libc", -] - -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "io-uring" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b86e202f00093dcba4275d4636b93ef9dd75d025ae560d2521b45ea28ab49013" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "libc", -] - -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - -[[package]] -name = "is-terminal" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" -dependencies = [ - "hermit-abi 0.3.9", - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "is_terminal_polyfill" -version = "1.70.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "kata-sys-util" -version = "0.1.0" -dependencies = [ - "anyhow", - "byteorder", - "chrono", - "common-path", - "fail", - "hex", - "kata-types", - "lazy_static", - "libc", - "mockall", - "nix 0.26.4", - "oci-spec", - "once_cell", - "pci-ids", - "rand", - "runtime-spec", - "safe-path", - "serde", - "serde_json", - "slog", - "slog-scope", - "subprocess", - "thiserror 1.0.61", -] - -[[package]] -name = "kata-types" -version = "0.1.0" -dependencies = [ - "anyhow", - "base64", - "bitmask-enum", - "byte-unit", - "flate2", - "glob", - "hex", - "lazy_static", - "num_cpus", - "oci-spec", - "regex", - "serde", - "serde-enum-str", - "serde_json", - "sha2 0.10.9", - "slog", - "slog-scope", - "sysinfo", - "thiserror 1.0.61", - "toml", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "libc" -version = "0.2.172" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" - -[[package]] -name = "libcontainer" -version = "0.0.1" -dependencies = [ - "anyhow", - "cgroups-rs", - "chrono", - "derive_builder 0.10.2", - "kata-sys-util", - "libc", - "logging", - "nix 0.23.2", - "oci-spec", - "procfs", - "protocols", - "runtime-spec", - "rustjail", - "scopeguard", - "serde", - "serde_json", - "slog", - "tempfile", - "test-utils", -] - -[[package]] -name = "liboci-cli" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "731e7d86b6f06717b9b365895f707b229fc755e45c0122b8ac1de9c0f0cf1547" -dependencies = [ - "clap", -] - -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] - -[[package]] -name = "libseccomp" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21c57fd8981a80019807b7b68118618d29a87177c63d704fc96e6ecd003ae5b3" -dependencies = [ - "bitflags 1.3.2", - "libc", - "libseccomp-sys", - "pkg-config", -] - -[[package]] -name = "libseccomp-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7cbbd4ad467251987c6e5b47d53b11a5a05add08f2447a9e2d70aef1e0d138" - -[[package]] -name = "libsystemd" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f4f0b5b062ba67aa075e331de778082c09e66b5ef32970ea5a1e9c37c9555d1" -dependencies = [ - "hmac", - "libc", - "log", - "nix 0.23.2", - "once_cell", - "serde", - "sha2 0.9.9", - "thiserror 1.0.61", - "uuid 0.8.2", -] - -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - -[[package]] -name = "linux-raw-sys" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "logging" -version = "0.1.0" -dependencies = [ - "arc-swap", - "lazy_static", - "serde_json", - "slog", - "slog-async", - "slog-journald", - "slog-json", - "slog-scope", - "slog-term", -] - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" -dependencies = [ - "adler2", - "simd-adler32", -] - -[[package]] -name = "mio" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" -dependencies = [ - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", -] - -[[package]] -name = "mockall" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39a6bfcc6c8c7eed5ee98b9c3e33adc726054389233e201c95dab2d41a3839d2" -dependencies = [ - "cfg-if", - "downcast", - "fragile", - "mockall_derive", - "predicates", - "predicates-tree", -] - -[[package]] -name = "mockall_derive" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25ca3004c2efe9011bd4e461bd8256445052b9615405b4f7ea43fc8ca5c20898" -dependencies = [ - "cfg-if", - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - -[[package]] -name = "nix" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" -dependencies = [ - "bitflags 1.3.2", - "cc", - "cfg-if", - "libc", - "memoffset 0.6.5", -] - -[[package]] -name = "nix" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "libc", -] - -[[package]] -name = "nix" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.7.1", - "pin-utils", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "ntapi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a3895c6391c39d7fe7ebc444a87eb2991b2a0bc718fdabd071eec617fc68e4" -dependencies = [ - "winapi", -] - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.9", - "libc", -] - -[[package]] -name = "objc2-core-foundation" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c10c2894a6fed806ade6027bcd50662746363a9589d3ec9d9bef30a4e4bc166" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "object" -version = "0.37.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" -dependencies = [ - "memchr", -] - -[[package]] -name = "oci-spec" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57e9beda9d92fac7bf4904c34c83340ef1024159faee67179a04e0277523da33" -dependencies = [ - "const_format", - "derive_builder 0.20.0", - "getset", - "regex", - "serde", - "serde_json", - "strum", - "strum_macros", - "thiserror 2.0.12", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "opaque-debug" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" - -[[package]] -name = "ordered-stream" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" -dependencies = [ - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "parking" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" - -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.5", -] - -[[package]] -name = "path-absolutize" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceeedc827d9a758b4641457683ced2f02d4252cc1bd8794c415ed20256114290" -dependencies = [ - "path-dedot", - "slash-formatter", -] - -[[package]] -name = "path-dedot" -version = "1.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c58ab1edb03f77d0bb3f08e4a179dd43ce9bc8eab9867ec53a78285ea3039b" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "pci-ids" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d88ae3281b415d856e9c2ddbcdd5961e71c1a3e90138512c04d720241853a6af" -dependencies = [ - "nom", - "phf", - "phf_codegen", - "proc-macro2", - "quote", -] - -[[package]] -name = "petgraph" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" -dependencies = [ - "fixedbitset", - "indexmap 1.9.3", -] - -[[package]] -name = "phf" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" -dependencies = [ - "phf_shared", -] - -[[package]] -name = "phf_codegen" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" -dependencies = [ - "phf_generator", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" -dependencies = [ - "phf_shared", - "rand", -] - -[[package]] -name = "phf_shared" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "piper" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" -dependencies = [ - "atomic-waker", - "fastrand 2.3.0", - "futures-io", -] - -[[package]] -name = "pkg-config" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" - -[[package]] -name = "polling" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "concurrent-queue", - "libc", - "log", - "pin-project-lite", - "windows-sys 0.48.0", -] - -[[package]] -name = "polling" -version = "3.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi 0.4.0", - "pin-project-lite", - "rustix 0.38.34", - "tracing", - "windows-sys 0.52.0", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "predicates" -version = "3.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" -dependencies = [ - "anstyle", - "predicates-core", -] - -[[package]] -name = "predicates-core" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa" - -[[package]] -name = "predicates-tree" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c" -dependencies = [ - "predicates-core", - "termtree", -] - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - -[[package]] -name = "proc-macro-crate" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" -dependencies = [ - "toml_edit 0.21.1", -] - -[[package]] -name = "proc-macro-error-attr2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "proc-macro-error2" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" -dependencies = [ - "proc-macro-error-attr2", - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "proc-macro2" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "procfs" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de8dacb0873f77e6aefc6d71e044761fcc68060290f5b1089fcdf84626bb69" -dependencies = [ - "bitflags 1.3.2", - "byteorder", - "chrono", - "flate2", - "hex", - "lazy_static", - "rustix 0.36.17", -] - -[[package]] -name = "prost" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020" -dependencies = [ - "bytes 1.6.0", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355f634b43cdd80724ee7848f95770e7e70eefa6dcf14fea676216573b8fd603" -dependencies = [ - "bytes 1.6.0", - "heck 0.3.3", - "itertools", - "log", - "multimap", - "petgraph", - "prost", - "prost-types", - "tempfile", - "which", -] - -[[package]] -name = "prost-derive" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "600d2f334aa05acb02a755e217ef1ab6dea4d51b58b7846588b747edec04efba" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "prost-types" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b" -dependencies = [ - "bytes 1.6.0", - "prost", -] - -[[package]] -name = "protobuf" -version = "3.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d65a1d4ddae7d8b5de68153b48f6aa3bba8cb002b243dbdbc55a5afbc98f99f4" -dependencies = [ - "once_cell", - "protobuf-support", - "thiserror 1.0.61", -] - -[[package]] -name = "protobuf-codegen" -version = "3.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3976825c0014bbd2f3b34f0001876604fe87e0c86cd8fa54251530f1544ace" -dependencies = [ - "anyhow", - "once_cell", - "protobuf", - "protobuf-parse", - "regex", - "tempfile", - "thiserror 1.0.61", -] - -[[package]] -name = "protobuf-parse" -version = "3.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4aeaa1f2460f1d348eeaeed86aea999ce98c1bded6f089ff8514c9d9dbdc973" -dependencies = [ - "anyhow", - "indexmap 2.2.6", - "log", - "protobuf", - "protobuf-support", - "tempfile", - "thiserror 1.0.61", - "which", -] - -[[package]] -name = "protobuf-support" -version = "3.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e36c2f31e0a47f9280fb347ef5e461ffcd2c52dd520d8e216b52f93b0b0d7d6" -dependencies = [ - "thiserror 1.0.61", -] - -[[package]] -name = "protocols" -version = "0.1.0" -dependencies = [ - "oci-spec", - "protobuf", - "serde", - "serde_json", - "ttrpc", - "ttrpc-codegen", -] - -[[package]] -name = "ptr_meta" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" -dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "r-efi" -version = "5.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.15", -] - -[[package]] -name = "redox_syscall" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "redox_users" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" -dependencies = [ - "getrandom 0.2.15", - "libredox", - "thiserror 1.0.61", -] - -[[package]] -name = "regex" -version = "1.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" - -[[package]] -name = "rend" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" -dependencies = [ - "bytecheck", -] - -[[package]] -name = "rkyv" -version = "0.7.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" -dependencies = [ - "bitvec", - "bytecheck", - "bytes 1.6.0", - "hashbrown 0.12.3", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", - "tinyvec", - "uuid 1.9.1", -] - -[[package]] -name = "rkyv_derive" -version = "0.7.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "rlimit" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a9ed03edbed449d6897c2092c71ab5f7b5fb80f6f0b1a3ed6d40a6f9fc0720" -dependencies = [ - "libc", -] - -[[package]] -name = "runk" -version = "0.0.1" -dependencies = [ - "anyhow", - "chrono", - "clap", - "libc", - "libcontainer", - "liboci-cli", - "logging", - "nix 0.23.2", - "oci-spec", - "runtime-spec", - "rustjail", - "serde", - "serde_json", - "slog", - "slog-async", - "tabwriter", - "tempfile", - "tokio", - "uzers", -] - -[[package]] -name = "runtime-spec" -version = "0.1.0" -dependencies = [ - "libc", - "serde", - "serde_derive", - "serde_json", -] - -[[package]] -name = "rust_decimal" -version = "1.37.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa7de2ba56ac291bd90c6b9bece784a52ae1411f9506544b3eae36dd2356d50" -dependencies = [ - "arrayvec", - "borsh", - "bytes 1.6.0", - "num-traits", - "rand", - "rkyv", - "serde", - "serde_json", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustix" -version = "0.36.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - -[[package]] -name = "rustix" -version = "0.37.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "519165d378b97752ca44bbe15047d5d3409e875f39327546b42ac81d7e18c1b6" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustix" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys 0.9.4", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustjail" -version = "0.1.0" -dependencies = [ - "anyhow", - "async-trait", - "awaitgroup", - "bit-vec", - "capctl", - "caps", - "cfg-if", - "cgroups-rs", - "futures", - "inotify", - "kata-sys-util", - "lazy_static", - "libc", - "libseccomp", - "nix 0.26.4", - "oci-spec", - "path-absolutize", - "protobuf", - "protocols", - "regex", - "rlimit", - "runtime-spec", - "safe-path", - "scan_fmt", - "scopeguard", - "serde", - "serde_json", - "slog", - "slog-scope", - "tokio", - "tokio-vsock", - "xattr", - "zbus", -] - -[[package]] -name = "rustversion" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "safe-path" -version = "0.1.0" -dependencies = [ - "libc", -] - -[[package]] -name = "scan_fmt" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b53b0a5db882a8e2fdaae0a43f7b39e7e9082389e978398bdf223a55b581248" -dependencies = [ - "regex", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - -[[package]] -name = "serde" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde-attributes" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eb8ec7724e4e524b2492b510e66957fe1a2c76c26a6975ec80823f2439da685" -dependencies = [ - "darling_core 0.14.4", - "serde-rename-rule", - "syn 1.0.109", -] - -[[package]] -name = "serde-enum-str" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26416dc95fcd46b0e4b12a3758043a229a6914050aaec2e8191949753ed4e9aa" -dependencies = [ - "darling 0.14.4", - "proc-macro2", - "quote", - "serde-attributes", - "syn 1.0.109", -] - -[[package]] -name = "serde-rename-rule" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794e44574226fc701e3be5c651feb7939038fc67fb73f6f4dd5c4ba90fd3be70" - -[[package]] -name = "serde_derive" -version = "1.0.203" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "serde_json" -version = "1.0.120" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_repr" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - -[[package]] -name = "sha2" -version = "0.10.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" -dependencies = [ - "libc", -] - -[[package]] -name = "simd-adler32" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "siphasher" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" - -[[package]] -name = "slab" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" - -[[package]] -name = "slash-formatter" -version = "2.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7fb98e76e2022054673f3ebc43a4e12890ec6272530629df6237cafbb70569" - -[[package]] -name = "slog" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" - -[[package]] -name = "slog-async" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c8038f898a2c79507940990f05386455b3a317d8f18d4caea7cbc3d5096b84" -dependencies = [ - "crossbeam-channel", - "slog", - "take_mut", - "thread_local", -] - -[[package]] -name = "slog-journald" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83e14eb8c2f5d0c8fc9fbac40e6391095e4dc5cb334f7dce99c75cb1919eb39c" -dependencies = [ - "libsystemd", - "slog", -] - -[[package]] -name = "slog-json" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e1e53f61af1e3c8b852eef0a9dee29008f55d6dd63794f3f12cef786cf0f219" -dependencies = [ - "serde", - "serde_json", - "slog", - "time", -] - -[[package]] -name = "slog-scope" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f95a4b4c3274cd2869549da82b57ccc930859bdbf5bcea0424bc5f140b3c786" -dependencies = [ - "arc-swap", - "lazy_static", - "slog", -] - -[[package]] -name = "slog-term" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6e022d0b998abfe5c3782c1f03551a596269450ccd677ea51c56f8b214610e8" -dependencies = [ - "is-terminal", - "slog", - "term", - "thread_local", - "time", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "strum" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" - -[[package]] -name = "strum_macros" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" -dependencies = [ - "heck 0.5.0", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.87", -] - -[[package]] -name = "subprocess" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2e86926081dda636c546d8c5e641661049d7562a68f5488be4a1f7f66f6086" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sysinfo" -version = "0.34.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b93974b3d3aeaa036504b8eefd4c039dced109171c1ae973f1dc63b2c7e4b2" -dependencies = [ - "libc", - "memchr", - "ntapi", - "objc2-core-foundation", - "windows", -] - -[[package]] -name = "tabwriter" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a327282c4f64f6dc37e3bba4c2b6842cc3a992f204fa58d917696a89f691e5f6" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "take_mut" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tempfile" -version = "3.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" -dependencies = [ - "fastrand 2.3.0", - "getrandom 0.3.2", - "once_cell", - "rustix 1.0.7", - "windows-sys 0.52.0", -] - -[[package]] -name = "term" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" -dependencies = [ - "dirs-next", - "rustversion", - "winapi", -] - -[[package]] -name = "termtree" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" - -[[package]] -name = "test-utils" -version = "0.1.0" -dependencies = [ - "nix 0.26.4", -] - -[[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" -dependencies = [ - "thiserror-impl 1.0.61", -] - -[[package]] -name = "thiserror" -version = "2.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" -dependencies = [ - "thiserror-impl 2.0.12", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tinyvec" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.46.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cc3a2344dafbe23a245241fe8b09735b521110d30fcefbbd5feb1797ca35d17" -dependencies = [ - "backtrace", - "bytes 1.6.0", - "io-uring", - "libc", - "mio", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "slab", - "socket2 0.5.7", - "tokio-macros", - "windows-sys 0.52.0", -] - -[[package]] -name = "tokio-macros" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "tokio-vsock" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b33556828911d16e24d8b5d336446b0bf6b4b9bfda52cbdc2fa35b7a2862ebc" -dependencies = [ - "bytes 0.4.12", - "futures", - "libc", - "tokio", - "vsock", -] - -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_datetime" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" - -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow", -] - -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow", -] - -[[package]] -name = "tracing" -version = "0.1.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "tracing-core" -version = "0.1.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" -dependencies = [ - "once_cell", -] - -[[package]] -name = "ttrpc" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c580c498a547b4c083ec758be543e11a0772e03013aef4cdb1fbe77c8b62cae" -dependencies = [ - "byteorder", - "crossbeam", - "home", - "libc", - "log", - "nix 0.26.4", - "protobuf", - "protobuf-codegen", - "thiserror 1.0.61", - "windows-sys 0.48.0", -] - -[[package]] -name = "ttrpc-codegen" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e5c657ef5cea6f6c6073c1be0787ba4482f42a569d4821e467daec795271f86" -dependencies = [ - "protobuf", - "protobuf-codegen", - "protobuf-support", - "ttrpc-compiler", -] - -[[package]] -name = "ttrpc-compiler" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3aa71f4a44711b3b9cc10ed0c7e239ff0fe4b8e6c900a142fb3bb26401385718" -dependencies = [ - "derive-new", - "prost", - "prost-build", - "prost-types", - "protobuf", - "protobuf-codegen", - "tempfile", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "uds_windows" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" -dependencies = [ - "memoffset 0.9.1", - "tempfile", - "winapi", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" - -[[package]] -name = "unicode-width" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[package]] -name = "utf8-width" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" - -[[package]] -name = "utf8parse" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" - -[[package]] -name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "serde", -] - -[[package]] -name = "uuid" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" - -[[package]] -name = "uzers" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df81ff504e7d82ad53e95ed1ad5b72103c11253f39238bcc0235b90768a97dd" -dependencies = [ - "libc", - "log", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "vsock" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e32675ee2b3ce5df274c0ab52d19b28789632406277ca26bffee79a8e27dc133" -dependencies = [ - "libc", - "nix 0.23.2", -] - -[[package]] -name = "waker-fn" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasi" -version = "0.14.2+wasi-0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" -dependencies = [ - "wit-bindgen-rt", -] - -[[package]] -name = "wasm-bindgen" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.87", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" - -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix 0.38.34", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" -dependencies = [ - "windows-core 0.57.0", - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-core" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-result", - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-implement" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "windows-interface" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "windows-link" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" - -[[package]] -name = "windows-result" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" -dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" - -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - -[[package]] -name = "wit-bindgen-rt" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "xattr" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" -dependencies = [ - "libc", -] - -[[package]] -name = "xdg-home" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca91dcf8f93db085f3a0a29358cd0b9d670915468f4290e8b85d118a34211ab8" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "zbus" -version = "3.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6" -dependencies = [ - "async-broadcast", - "async-executor", - "async-fs", - "async-io 1.13.0", - "async-lock 2.8.0", - "async-process", - "async-recursion", - "async-task", - "async-trait", - "blocking", - "byteorder", - "derivative", - "enumflags2", - "event-listener 2.5.3", - "futures-core", - "futures-sink", - "futures-util", - "hex", - "nix 0.26.4", - "once_cell", - "ordered-stream", - "rand", - "serde", - "serde_repr", - "sha1", - "static_assertions", - "tracing", - "uds_windows", - "winapi", - "xdg-home", - "zbus_macros", - "zbus_names", - "zvariant", -] - -[[package]] -name = "zbus_macros" -version = "3.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7131497b0f887e8061b430c530240063d33bf9455fa34438f388a245da69e0a5" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "regex", - "syn 1.0.109", - "zvariant_utils", -] - -[[package]] -name = "zbus_names" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "437d738d3750bed6ca9b8d423ccc7a8eb284f6b1d6d4e225a0e4e6258d864c8d" -dependencies = [ - "serde", - "static_assertions", - "zvariant", -] - -[[package]] -name = "zvariant" -version = "3.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eef2be88ba09b358d3b58aca6e41cd853631d44787f319a1383ca83424fb2db" -dependencies = [ - "byteorder", - "enumflags2", - "libc", - "serde", - "static_assertions", - "zvariant_derive", -] - -[[package]] -name = "zvariant_derive" -version = "3.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c24dc0bed72f5f90d1f8bb5b07228cbf63b3c6e9f82d82559d4bae666e7ed9" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", - "zvariant_utils", -] - -[[package]] -name = "zvariant_utils" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] diff --git a/src/tools/runk/Cargo.toml b/src/tools/runk/Cargo.toml deleted file mode 100644 index 63af83da68..0000000000 --- a/src/tools/runk/Cargo.toml +++ /dev/null @@ -1,38 +0,0 @@ -[package] -name = "runk" -version = "0.0.1" -authors = ["The Kata Containers community "] -description = "runk: Kata OCI container runtime based on Kata agent" -license = "Apache-2.0" -edition = "2018" - -[dependencies] -libcontainer = { path = "./libcontainer" } -rustjail = { path = "../../agent/rustjail", features = [ - "standard-oci-runtime", -] } -runtime-spec = { path = "../../libs/runtime-spec" } -oci-spec = { version = "0.8.1", features = ["runtime"] } -logging = { path = "../../libs/logging" } -liboci-cli = "0.5.3" -clap = { version = "4.5.40", features = ["derive", "cargo"] } -libc = "0.2.108" -nix = "0.23.0" -anyhow = "1.0.52" -slog = "2.7.0" -chrono = { version = "0.4.19", features = ["serde"] } -slog-async = "2.7.0" -tokio = { version = "1.44.2", features = ["full"] } -serde = { version = "1.0.133", features = ["derive"] } -serde_json = "1.0.74" -uzers = "0.12.1" -tabwriter = "1.2.1" - -[features] -seccomp = ["rustjail/seccomp"] - -[dev-dependencies] -tempfile = "3.19.1" - -[workspace] -members = ["libcontainer"] diff --git a/src/tools/runk/Makefile b/src/tools/runk/Makefile deleted file mode 100644 index d025b6a893..0000000000 --- a/src/tools/runk/Makefile +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2021-2022 Sony Group Corporation -# -# SPDX-License-Identifier: Apache-2.0 -# - -# LIBC=musl|gnu (default: gnu) -LIBC ?= gnu - -include ../../../utils.mk - -TARGET = runk -TARGET_PATH = target/$(TRIPLE)/$(BUILD_TYPE)/$(TARGET) -AGENT_SOURCE_PATH = ../../agent - -EXTRA_RUSTFEATURES := - -# Define if runk enables seccomp support (default: yes) -SECCOMP := yes - -# BINDIR is a directory for installing executable programs -BINDIR := /usr/local/bin - -ifeq ($(SECCOMP),yes) - override EXTRA_RUSTFEATURES += seccomp -endif - -ifneq ($(EXTRA_RUSTFEATURES),) - override EXTRA_RUSTFEATURES := --features "$(EXTRA_RUSTFEATURES)" -endif - -.DEFAULT_GOAL := default -default: build - -build: - @RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) --$(BUILD_TYPE) $(EXTRA_RUSTFEATURES) - -static-checks-build: - @echo "INFO: static-checks-build do nothing.." - -install: - install -D $(TARGET_PATH) $(BINDIR)/$(TARGET) - -clean: - cargo clean - -vendor: - cargo vendor - -test: test-runk test-agent - -test-runk: - cargo test --all --target $(TRIPLE) $(EXTRA_RUSTFEATURES) -- --nocapture - -test-agent: - make test -C $(AGENT_SOURCE_PATH) STANDARD_OCI_RUNTIME=yes - -check: standard_rust_check - -.PHONY: \ - build \ - install \ - clean \ - clippy \ - format \ - vendor \ - test \ - check \ diff --git a/src/tools/runk/README.md b/src/tools/runk/README.md deleted file mode 100644 index eddfc73fc6..0000000000 --- a/src/tools/runk/README.md +++ /dev/null @@ -1,352 +0,0 @@ -# runk - -## Overview - -> **Warnings:** -> `runk` is currently an experimental tool. -> Only continue if you are using a non-critical system. - -`runk` is a standard OCI container runtime written in Rust based on a modified version of -the [Kata Container agent](https://github.com/kata-containers/kata-containers/tree/main/src/agent), `kata-agent`. - -`runk` conforms to the [OCI Container Runtime specifications](https://github.com/opencontainers/runtime-spec). - -Unlike the [Kata Container runtime](https://github.com/kata-containers/kata-containers/tree/main/src/agent#features), -`kata-runtime`, `runk` spawns and runs containers on the host machine directly. -The user can run `runk` in the same way as the existing container runtimes such as `runc`, -the most used implementation of the OCI runtime specs. - -## Why does `runk` exist? - -The `kata-agent` is a process running inside a virtual machine (VM) as a supervisor for managing containers -and processes running within those containers. -In other words, the `kata-agent` is a kind of "low-level" container runtime inside VM because the agent -spawns and runs containers according to the OCI runtime specs. -However, the `kata-agent` does not have the OCI Command-Line Interface (CLI) that is defined in the -[runtime spec](https://github.com/opencontainers/runtime-spec/blob/main/runtime.md). -The `kata-runtime` provides the CLI part of the Kata Containers runtime component, -but the `kata-runtime` is a container runtime for creating hardware-virtualized containers running on the host. - -`runk` is a Rust-based standard OCI container runtime that manages normal containers, -not hardware-virtualized containers. -`runk` aims to become one of the alternatives to existing OCI compliant container runtimes. -The `kata-agent` has most of the [features](https://github.com/kata-containers/kata-containers/tree/main/src/agent#features) -needed for the container runtime and delivers high performance with a low memory footprint owing to the -implementation by Rust language. -Therefore, `runk` leverages the mechanism of the `kata-agent` to avoid reinventing the wheel. - -## Performance - -`runk` is faster than `runc` and has a lower memory footprint. - -This table shows the average of the elapsed time and the memory footprint (maximum resident set size) -for running sequentially 100 containers, the containers run `/bin/true` using `run` command with -[detached mode](https://github.com/opencontainers/runc/blob/main/docs/terminals.md#detached) -on 12 CPU cores (`3.8 GHz AMD Ryzen 9 3900X`) and 32 GiB of RAM. -`runk` always runs containers with detached mode currently. - -Evaluation Results: - -| | `runk` (v0.0.1) | `runc` (v1.0.3) | `crun` (v1.4.2) | -|-----------------------|---------------|---------------|---------------| -| time [ms] | 39.83 | 50.39 | 38.41 | -| memory footprint [MB] | 4.013 | 10.78 | 1.738 | - -## Status of `runk` - -We drafted the initial code here, and any contributions to `runk` and [`kata-agent`](https://github.com/kata-containers/kata-containers/tree/main/src/agent) -are welcome. - -Regarding features compared to `runc`, see the `Status of runk` section in the [issue](https://github.com/kata-containers/kata-containers/issues/2784). - -## Building - -In order to enable seccomp support, you need to install the `libseccomp` library on -your platform. - -> e.g. `libseccomp-dev` for Ubuntu, or `libseccomp-devel` for CentOS - -You can build `runk`: - -```bash -$ cd runk -$ make -``` - -If you want to build a statically linked binary of `runk`, set the environment -variables for the [`libseccomp` crate](https://github.com/libseccomp-rs/libseccomp-rs) and -set the `LIBC` to `musl`: - -```bash -$ export LIBSECCOMP_LINK_TYPE=static -$ export LIBSECCOMP_LIB_PATH="the path of the directory containing libseccomp.a" -$ export LIBC=musl -$ make -``` - -> **Note**: -> -> - If the compilation fails when `runk` tries to link the `libseccomp` library statically -> against `musl`, you will need to build the `libseccomp` manually with `-U_FORTIFY_SOURCE`. -> For the details, see [our script](https://github.com/kata-containers/kata-containers/blob/main/ci/install_libseccomp.sh) -> to install the `libseccomp` for the agent. -> - On `ppc64le` and `s390x`, `glibc` should be used even if `LIBC=musl` is specified. -> - If you do not want to enable seccomp support, run `make SECCOMP=no`. - -To install `runk` into default directory for executable program (`/usr/local/bin`): - -```bash -$ sudo -E make install -``` - -## Using `runk` directly - -Please note that `runk` is a low level tool not developed with an end user in mind. -It is mostly employed by other higher-level container software like `containerd`. - -If you still want to use `runk` directly, here's how. - -### Prerequisites - -It is necessary to create an OCI bundle to use the tool. The simplest method is: - -``` bash -$ bundle_dir="bundle" -$ rootfs_dir="$bundle_dir/rootfs" -$ image="busybox" -$ mkdir -p "$rootfs_dir" && (cd "$bundle_dir" && runk spec) -$ sudo docker export $(sudo docker create "$image") | tar -C "$rootfs_dir" -xf - -``` - -> **Note:** -> If you use the unmodified `runk spec` template, this should give a `sh` session inside the container. -> However, if you use `runk` directly and run a container with the unmodified template, -> `runk` cannot launch the `sh` session because `runk` does not support terminal handling yet. -> You need to edit the process field in the `config.json` should look like this below -> with `"terminal": false` and `"args": ["sleep", "10"]`. - -```json -"process": { - "terminal": false, - "user": { - "uid": 0, - "gid": 0 - }, - "args": [ - "sleep", - "10" - ], - "env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - "TERM=xterm" - ], - "cwd": "/", - [...] -} -``` - -If you want to launch the `sh` session inside the container, you need to run `runk` from `containerd`. - -Please refer to the [Using `runk` from containerd](#using-runk-from-containerd) section - -### Running a container - -Now you can go through the [lifecycle operations](https://github.com/opencontainers/runtime-spec/blob/main/runtime.md) -in your shell. -You need to run `runk` as `root` because `runk` does not have the rootless feature which is the ability -to run containers without root privileges. - -```bash -$ cd $bundle_dir - -# Create a container -$ sudo runk create test - -# View the container is created and in the "created" state -$ sudo runk state test - -# Start the process inside the container -$ sudo runk start test - -# After 10 seconds view that the container has exited and is now in the "stopped" state -$ sudo runk state test - -# Now delete the container -$ sudo runk delete test -``` - -## Using `runk` from `Docker` - -`runk` can run containers using [`Docker`](https://github.com/docker). - -First, install `Docker` from package by following the -[`Docker` installation instructions](https://docs.docker.com/engine/install/). - -### Running a container with `Docker` command line - -Start the docker daemon: - -```bash -$ sudo dockerd --experimental --add-runtime="runk=/usr/local/bin/runk" -``` - -> **Note:** -> Before starting the `dockerd`, you need to stop the normal docker daemon -> running on your environment (i.e., `systemctl stop docker`). - -Launch a container in a different terminal: - -```bash -$ sudo docker run -it --rm --runtime runk busybox sh -/ # -``` - -## Using `runk` from `Podman` - -`runk` can run containers using [`Podman`](https://github.com/containers/podman). - -First, install `Podman` from source code or package by following the -[`Podman` installation instructions](https://podman.io/getting-started/installation). - -### Running a container with `Podman` command line - -```bash -$ sudo podman --runtime /usr/local/bin/runk run -it --rm busybox sh -/ # -``` - -> **Note:** -> `runk` does not support some commands except -> [OCI standard operations](https://github.com/opencontainers/runtime-spec/blob/main/runtime.md#operations) -> yet, so those commands do not work in `Docker/Podman`. Regarding commands currently -> implemented in `runk`, see the [Status of `runk`](#status-of-runk) section. - -## Using `runk` from `containerd` - -`runk` can run containers with the containerd runtime handler support on `containerd`. - -### Prerequisites for `runk` with containerd - -* `containerd` v1.2.4 or above -* `cri-tools` - -> **Note:** -> [`cri-tools`](https://github.com/kubernetes-sigs/cri-tools) is a set of tools for CRI -> used for development and testing. - -Install `cri-tools` from source code: - -```bash -$ go get github.com/kubernetes-sigs/cri-tools -$ pushd $GOPATH/src/github.com/kubernetes-sigs/cri-tools -$ make -$ sudo -E make install -$ popd -``` - -Write the `crictl` configuration file: - -``` bash -$ cat <"] -description = "Library for runk container" -license = "Apache-2.0" -edition = "2018" - -[dependencies] -rustjail = { path = "../../../agent/rustjail", features = [ - "standard-oci-runtime", -] } -runtime-spec = { path = "../../../libs/runtime-spec" } -oci-spec = { version = "0.8.1", features = ["runtime"] } -kata-sys-util = { path = "../../../libs/kata-sys-util" } -logging = { path = "../../../libs/logging" } -derive_builder = "0.10.2" -libc = "0.2.108" -nix = "0.23.0" -anyhow = "1.0.52" -slog = "2.7.0" -chrono = { version = "0.4.19", features = ["serde"] } -serde = { version = "1.0.133", features = ["derive"] } -serde_json = "1.0.74" -scopeguard = "1.1.0" -cgroups = { package = "cgroups-rs", git = "https://github.com/kata-containers/cgroups-rs", rev = "v0.3.5" } -procfs = "0.14.0" - -[dev-dependencies] -tempfile = "3.19.1" -test-utils = { path = "../../../libs/test-utils" } -protocols = { path = "../../../libs/protocols" } diff --git a/src/tools/runk/libcontainer/src/activated_builder.rs b/src/tools/runk/libcontainer/src/activated_builder.rs deleted file mode 100644 index fc2ebd7a76..0000000000 --- a/src/tools/runk/libcontainer/src/activated_builder.rs +++ /dev/null @@ -1,336 +0,0 @@ -// Copyright 2021-2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -use crate::container::{load_linux_container, Container, ContainerLauncher}; -use crate::status::Status; -use crate::utils::validate_spec; -use anyhow::{anyhow, Result}; -use derive_builder::Builder; -use oci::{Process as OCIProcess, Spec}; -use oci_spec::runtime as oci; -use runtime_spec::ContainerState; -use rustjail::container::update_namespaces; -use slog::{debug, Logger}; -use std::fs::File; -use std::path::{Path, PathBuf}; - -/// Used for exec command. It will prepare the options for joining an existing container. -#[derive(Default, Builder, Debug, Clone)] -#[builder(build_fn(validate = "Self::validate"))] -pub struct ActivatedContainer { - pub id: String, - pub root: PathBuf, - pub console_socket: Option, - pub pid_file: Option, - pub tty: bool, - pub cwd: Option, - pub env: Vec<(String, String)>, - pub no_new_privs: bool, - pub args: Vec, - pub process: Option, -} - -impl ActivatedContainerBuilder { - /// pre-validate before building ActivatedContainer - fn validate(&self) -> Result<(), String> { - // ensure container exists - let id = self.id.as_ref().unwrap(); - let root = self.root.as_ref().unwrap(); - let status_path = Status::get_dir_path(root, id); - if !status_path.exists() { - return Err(format!( - "container {} does not exist at path {:?}", - id, root - )); - } - - // ensure argv will not be empty in process exec phase later - let process = self.process.as_ref().unwrap(); - let args = self.args.as_ref().unwrap(); - if process.is_none() && args.is_empty() { - return Err("process and args cannot be all empty".to_string()); - } - Ok(()) - } -} - -impl ActivatedContainer { - /// Create ContainerLauncher that can be used to spawn a process in an existing container. - /// This reads the spec from status file of an existing container and adapts it with given process file - /// or other options like args, env, etc. It also changes the namespace in spec to join the container. - pub fn create_launcher(self, logger: &Logger) -> Result { - debug!( - logger, - "enter ActivatedContainer::create_launcher {:?}", self - ); - let mut container = Container::load(&self.root, &self.id)?; - - // If state is Created or Running, we can execute the process. - if container.state != ContainerState::Created && container.state != ContainerState::Running - { - return Err(anyhow!( - "cannot exec in a stopped or paused container, state: {:?}", - container.state - )); - } - - let spec = container - .status - .config - .spec - .as_mut() - .ok_or_else(|| anyhow!("spec config was not present"))?; - self.adapt_exec_spec(spec, container.status.pid, logger)?; - debug!(logger, "adapted spec: {:?}", spec); - validate_spec(spec, &self.console_socket)?; - - debug!( - logger, - "load LinuxContainer with config: {:?}", &container.status.config - ); - let runner = load_linux_container(&container.status, self.console_socket, logger)?; - - Ok(ContainerLauncher::new( - &self.id, - &container.status.bundle, - &self.root, - false, - runner, - self.pid_file, - )) - } - - /// Adapt spec to execute a new process which will join the container. - fn adapt_exec_spec(&self, spec: &mut Spec, pid: i32, logger: &Logger) -> Result<()> { - // If with --process, load process from file. - // Otherwise, update process with args and other options. - if let Some(process_path) = self.process.as_ref() { - spec.set_process(Some(Self::get_process(process_path)?)); - } else if let Some(process) = spec.process_mut().as_mut() { - self.update_process(process)?; - } else { - return Err(anyhow!("process is empty in spec")); - }; - // Exec process will join the container's namespaces - update_namespaces(logger, spec, pid)?; - Ok(()) - } - - /// Update process with args and other options. - fn update_process(&self, process: &mut OCIProcess) -> Result<()> { - process.set_args(Some(self.args.clone())); - process.set_no_new_privileges(Some(self.no_new_privs)); - process.set_terminal(Some(self.tty)); - if let Some(cwd) = self.cwd.as_ref() { - process.set_cwd(cwd.as_path().to_path_buf()); - } - if let Some(process_env) = process.env_mut() { - process_env.extend(self.env.iter().map(|kv| format!("{}={}", kv.0, kv.1))); - } - Ok(()) - } - - /// Read and parse OCI Process from path - fn get_process(process_path: &Path) -> Result { - let f = File::open(process_path)?; - Ok(serde_json::from_reader(f)?) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::status::Status; - use crate::utils::test_utils::*; - use nix::unistd::getpid; - use oci_spec::runtime::{LinuxBuilder, LinuxNamespaceBuilder, ProcessBuilder, User}; - use rustjail::container::TYPETONAME; - use scopeguard::defer; - use slog::o; - use std::{ - fs::{create_dir_all, File}, - path::PathBuf, - }; - use tempfile::tempdir; - use test_utils::skip_if_not_root; - - fn create_activated_dirs(root: &Path, id: &str, bundle: &Path) { - Status::create_dir(root, id).unwrap(); - create_dir_all(bundle.join(TEST_ROOTFS_PATH)).unwrap(); - } - - #[test] - fn test_activated_container_validate() { - let root = tempdir().unwrap(); - let id = TEST_CONTAINER_ID.to_string(); - Status::create_dir(root.path(), &id).unwrap(); - let result = ActivatedContainerBuilder::default() - .id(id) - .root(root.into_path()) - .console_socket(None) - .pid_file(None) - .tty(false) - .cwd(None) - .env(Vec::new()) - .no_new_privs(false) - .process(None) - .args(vec!["sleep".to_string(), "10".to_string()]) - .build(); - assert!(result.is_ok()); - } - - #[test] - fn test_activated_container_create() { - // create cgroup directory needs root permission - skip_if_not_root!(); - let logger = slog::Logger::root(slog::Discard, o!()); - let bundle_dir = tempdir().unwrap(); - let root = tempdir().unwrap(); - // Since tests are executed concurrently, container_id must be unique in tests with cgroup. - // Or the cgroup directory may be removed by other tests in advance. - let id = "test_activated_container_create".to_string(); - create_activated_dirs(root.path(), &id, bundle_dir.path()); - let pid = getpid().as_raw(); - - let mut spec = create_dummy_spec(); - spec.root_mut() - .as_mut() - .unwrap() - .set_path(bundle_dir.path().join(TEST_ROOTFS_PATH)); - - let status = create_custom_dummy_status(&id, pid, root.path(), &spec); - status.save().unwrap(); - - // create empty cgroup directory to avoid is_pause failing - let cgroup = create_dummy_cgroup(Path::new(id.as_str())); - defer!(cgroup.delete().unwrap()); - - let result = ActivatedContainerBuilder::default() - .id(id) - .root(root.into_path()) - .console_socket(Some(PathBuf::from(TEST_CONSOLE_SOCKET_PATH))) - .pid_file(Some(PathBuf::from(TEST_PID_FILE_PATH))) - .tty(true) - .cwd(Some(PathBuf::from(TEST_BUNDLE_PATH))) - .env(vec![ - ("K1".to_string(), "V1".to_string()), - ("K2".to_string(), "V2".to_string()), - ]) - .no_new_privs(true) - .process(None) - .args(vec!["sleep".to_string(), "10".to_string()]) - .build() - .unwrap(); - - let linux = LinuxBuilder::default() - .namespaces( - TYPETONAME - .iter() - .filter(|&(_, &name)| name != "user") - .map(|ns| { - LinuxNamespaceBuilder::default() - .typ(ns.0.clone()) - .path(PathBuf::from(&format!("/proc/{}/ns/{}", pid, ns.1))) - .build() - .unwrap() - }) - .collect::>(), - ) - .build() - .unwrap(); - - spec.set_linux(Some(linux)); - let process = ProcessBuilder::default() - .terminal(result.tty) - .user(User::default()) - .args(result.args.clone()) - .cwd(result.cwd.clone().unwrap().to_string_lossy().to_string()) - .env(vec![ - "PATH=/bin:/usr/bin".to_string(), - "K1=V1".to_string(), - "K2=V2".to_string(), - ]) - .no_new_privileges(result.no_new_privs) - .build() - .unwrap(); - - spec.set_process(Some(process)); - let launcher = result.clone().create_launcher(&logger).unwrap(); - assert!(!launcher.init); - assert_eq!(launcher.runner.config.spec.unwrap(), spec); - assert_eq!( - launcher.runner.console_socket, - result.console_socket.unwrap() - ); - assert_eq!(launcher.pid_file, result.pid_file); - } - - #[test] - fn test_activated_container_create_with_process() { - // create cgroup directory needs root permission - skip_if_not_root!(); - let bundle_dir = tempdir().unwrap(); - let process_file = bundle_dir.path().join(TEST_PROCESS_FILE_NAME); - - let mut process_template = OCIProcess::default(); - process_template.set_args(Some(vec!["sleep".to_string(), "10".to_string()])); - process_template.set_cwd(PathBuf::from("/")); - - let file = File::create(process_file.clone()).unwrap(); - serde_json::to_writer(&file, &process_template).unwrap(); - - let logger = slog::Logger::root(slog::Discard, o!()); - let root = tempdir().unwrap(); - // Since tests are executed concurrently, container_id must be unique in tests with cgroup. - // Or the cgroup directory may be removed by other tests in advance. - let id = "test_activated_container_create_with_process".to_string(); - let pid = getpid().as_raw(); - let mut spec = create_dummy_spec(); - spec.root_mut() - .as_mut() - .unwrap() - .set_path(bundle_dir.path().join(TEST_ROOTFS_PATH)); - create_activated_dirs(root.path(), &id, bundle_dir.path()); - - let status = create_custom_dummy_status(&id, pid, root.path(), &spec); - status.save().unwrap(); - // create empty cgroup directory to avoid is_pause failing - let cgroup = create_dummy_cgroup(Path::new(id.as_str())); - defer!(cgroup.delete().unwrap()); - - let launcher = ActivatedContainerBuilder::default() - .id(id) - .root(root.into_path()) - .console_socket(Some(PathBuf::from(TEST_CONSOLE_SOCKET_PATH))) - .pid_file(None) - .tty(true) - .cwd(Some(PathBuf::from(TEST_BUNDLE_PATH))) - .env(vec![ - ("K1".to_string(), "V1".to_string()), - ("K2".to_string(), "V2".to_string()), - ]) - .no_new_privs(true) - .process(Some(process_file)) - .args(vec!["sleep".to_string(), "10".to_string()]) - .build() - .unwrap() - .create_launcher(&logger) - .unwrap(); - - assert!(!launcher.init); - - assert_eq!( - launcher - .runner - .config - .spec - .unwrap() - .process() - .clone() - .unwrap(), - process_template - ); - } -} diff --git a/src/tools/runk/libcontainer/src/cgroup.rs b/src/tools/runk/libcontainer/src/cgroup.rs deleted file mode 100644 index 0f4673da15..0000000000 --- a/src/tools/runk/libcontainer/src/cgroup.rs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2021-2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -use anyhow::anyhow; -use anyhow::Result; -use cgroups; -use cgroups::freezer::{FreezerController, FreezerState}; -use std::{thread, time}; - -// Try to remove the provided cgroups path five times with increasing delay between tries. -// If after all there are not removed cgroups, an appropriate error will be returned. -pub fn remove_cgroup_dir(cgroup: &cgroups::Cgroup) -> Result<()> { - let mut retries = 5; - let mut delay = time::Duration::from_millis(10); - while retries != 0 { - if retries != 5 { - delay *= 2; - thread::sleep(delay); - } - - if cgroup.delete().is_ok() { - return Ok(()); - } - - retries -= 1; - } - - Err(anyhow!("failed to remove cgroups paths")) -} - -// Make sure we get a stable freezer state, so retry if the cgroup is still undergoing freezing. -pub fn get_freezer_state(freezer: &FreezerController) -> Result { - let mut retries = 10; - while retries != 0 { - let state = freezer.state()?; - match state { - FreezerState::Thawed => return Ok(FreezerState::Thawed), - FreezerState::Frozen => return Ok(FreezerState::Frozen), - FreezerState::Freezing => { - // sleep for 10 ms, wait for the cgroup to finish freezing - thread::sleep(time::Duration::from_millis(10)); - retries -= 1; - } - } - } - Ok(FreezerState::Freezing) -} - -// check whether freezer state is frozen -pub fn is_paused(cgroup: &cgroups::Cgroup) -> Result { - let freezer_controller: &FreezerController = cgroup - .controller_of() - .ok_or_else(|| anyhow!("failed to get freezer controller"))?; - let freezer_state = get_freezer_state(freezer_controller)?; - match freezer_state { - FreezerState::Frozen => Ok(true), - _ => Ok(false), - } -} - -pub fn freeze(cgroup: &cgroups::Cgroup, state: FreezerState) -> Result<()> { - let freezer_controller: &FreezerController = cgroup - .controller_of() - .ok_or_else(|| anyhow!("failed to get freezer controller"))?; - match state { - FreezerState::Frozen => { - freezer_controller.freeze()?; - } - FreezerState::Thawed => { - freezer_controller.thaw()?; - } - _ => return Err(anyhow!("invalid freezer state")), - } - Ok(()) -} diff --git a/src/tools/runk/libcontainer/src/container.rs b/src/tools/runk/libcontainer/src/container.rs deleted file mode 100644 index b4158fced6..0000000000 --- a/src/tools/runk/libcontainer/src/container.rs +++ /dev/null @@ -1,437 +0,0 @@ -// Copyright 2021-2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -use crate::cgroup::{freeze, remove_cgroup_dir}; -use crate::status::{self, get_current_container_state, Status}; -use anyhow::{anyhow, Result}; -use cgroups; -use cgroups::freezer::FreezerState; -use cgroups::hierarchies::is_cgroup2_unified_mode; -use nix::sys::signal::kill; -use nix::{ - sys::signal::Signal, - sys::signal::SIGKILL, - unistd::{chdir, unlink, Pid}, -}; -use procfs; -use runtime_spec::{ContainerState, State as OCIState}; -use rustjail::cgroups::fs::Manager as CgroupManager; -use rustjail::{ - container::{BaseContainer, LinuxContainer, EXEC_FIFO_FILENAME}, - process::{Process, ProcessOperations}, - specconv::CreateOpts, -}; -use scopeguard::defer; -use slog::{debug, info, Logger}; -use std::{ - env::current_dir, - fs, - path::{Path, PathBuf}, -}; - -use kata_sys_util::hooks::HookStates; - -pub const CONFIG_FILE_NAME: &str = "config.json"; - -#[derive(Debug, Copy, Clone, PartialEq)] -pub enum ContainerAction { - Create, - Start, - Run, -} - -#[derive(Debug)] -pub struct Container { - pub status: Status, - pub state: ContainerState, - pub cgroup: cgroups::Cgroup, -} - -// Container represents a container that is created by the container runtime. -impl Container { - pub fn load(state_root: &Path, id: &str) -> Result { - let status = Status::load(state_root, id)?; - let spec = status - .config - .spec - .as_ref() - .ok_or_else(|| anyhow!("spec config was not present"))?; - let linux = spec - .linux() - .as_ref() - .ok_or_else(|| anyhow!("linux config was not present"))?; - let cpath = if linux.cgroups_path().is_none() { - id.to_string() - } else { - linux - .cgroups_path() - .clone() - .unwrap_or_default() - .display() - .to_string() - .trim_start_matches('/') - .to_string() - }; - let cgroup = cgroups::Cgroup::load(cgroups::hierarchies::auto(), cpath); - let state = get_current_container_state(&status, &cgroup)?; - Ok(Self { - status, - state, - cgroup, - }) - } - - pub fn processes(&self) -> Result> { - let pids = self.cgroup.tasks(); - let result = pids.iter().map(|x| Pid::from_raw(x.pid as i32)).collect(); - Ok(result) - } - - pub fn kill(&self, signal: Signal, all: bool) -> Result<()> { - if all { - let pids = self.processes()?; - for pid in pids { - if !status::is_process_running(pid)? { - continue; - } - kill(pid, signal)?; - } - } else { - // If --all option is not specified and the container is stopped, - // kill operation generates an error in accordance with the OCI runtime spec. - if self.state == ContainerState::Stopped { - return Err(anyhow!( - "container {} can't be killed because it is {:?}", - self.status.id, - self.state - ) - // This error message mustn't be chagned because the containerd integration tests - // expect that OCI container runtimes return the message. - // Ref. https://github.com/containerd/containerd/blob/release/1.7/pkg/process/utils.go#L135 - .context("container not running")); - } - - let pid = Pid::from_raw(self.status.pid); - if status::is_process_running(pid)? { - kill(pid, signal)?; - } - } - // For cgroup v1, killing a process in a frozen cgroup does nothing until it's thawed. - // Only thaw the cgroup for SIGKILL. - // Ref: https://github.com/opencontainers/runc/pull/3217 - if !is_cgroup2_unified_mode() && self.state == ContainerState::Paused && signal == SIGKILL { - freeze(&self.cgroup, FreezerState::Thawed)?; - } - Ok(()) - } - - pub async fn delete(&self, force: bool, logger: &Logger) -> Result<()> { - let status = &self.status; - let spec = status - .config - .spec - .as_ref() - .ok_or_else(|| anyhow!("spec config was not present in the status"))?; - - let oci_state = OCIState { - version: status.oci_version.clone(), - id: status.id.clone(), - status: self.state, - pid: status.pid, - bundle: status - .bundle - .to_str() - .ok_or_else(|| anyhow!("invalid bundle path"))? - .to_string(), - annotations: spec.annotations().clone().unwrap_or_default(), - }; - - if let Some(hooks) = spec.hooks().as_ref() { - info!(&logger, "Poststop Hooks"); - let mut poststop_hookstates = HookStates::new(); - poststop_hookstates.execute_hooks( - &hooks.poststop().clone().unwrap_or_default(), - Some(oci_state.clone()), - )?; - } - - match oci_state.status { - ContainerState::Stopped => { - self.destroy()?; - } - ContainerState::Created => { - // Kill an init process - self.kill(SIGKILL, false)?; - self.destroy()?; - } - _ => { - if force { - self.kill(SIGKILL, true)?; - self.destroy()?; - } else { - return Err(anyhow!( - "cannot delete container {} that is not stopped", - &status.id - )); - } - } - } - - Ok(()) - } - - pub fn pause(&self) -> Result<()> { - if self.state != ContainerState::Running && self.state != ContainerState::Created { - return Err(anyhow!( - "failed to pause container: current status is: {:?}", - self.state - )); - } - freeze(&self.cgroup, FreezerState::Frozen)?; - Ok(()) - } - - pub fn resume(&self) -> Result<()> { - if self.state != ContainerState::Paused { - return Err(anyhow!( - "failed to resume container: current status is: {:?}", - self.state - )); - } - freeze(&self.cgroup, FreezerState::Thawed)?; - Ok(()) - } - - pub fn destroy(&self) -> Result<()> { - remove_cgroup_dir(&self.cgroup)?; - self.status.remove_dir() - } -} - -/// Used to run a process. If init is set, it will create a container and run the process in it. -/// If init is not set, it will run the process in an existing container. -#[derive(Debug)] -pub struct ContainerLauncher { - pub id: String, - pub bundle: PathBuf, - pub state_root: PathBuf, - pub init: bool, - pub runner: LinuxContainer, - pub pid_file: Option, -} - -impl ContainerLauncher { - pub fn new( - id: &str, - bundle: &Path, - state_root: &Path, - init: bool, - runner: LinuxContainer, - pid_file: Option, - ) -> Self { - ContainerLauncher { - id: id.to_string(), - bundle: bundle.to_path_buf(), - state_root: state_root.to_path_buf(), - init, - runner, - pid_file, - } - } - - /// Launch a process. For init containers, we will create a container. For non-init, it will join an existing container. - pub async fn launch(&mut self, action: ContainerAction, logger: &Logger) -> Result<()> { - if self.init { - self.spawn_container(action, logger).await?; - } else { - if action == ContainerAction::Create { - return Err(anyhow!( - "ContainerAction::Create is used for init-container only" - )); - } - self.spawn_process(action, logger).await?; - } - if let Some(pid_file) = self.pid_file.as_ref() { - fs::write( - pid_file, - format!("{}", self.runner.get_process(self.id.as_str())?.pid()), - )?; - } - Ok(()) - } - - /// Create the container by invoking runner to spawn the first process and save status. - async fn spawn_container(&mut self, action: ContainerAction, logger: &Logger) -> Result<()> { - // State root path root/id has been created in LinuxContainer::new(), - // so we don't have to create it again. - - // Spawn a new process in the container by using the agent's codes. - self.spawn_process(action, logger).await?; - - let status = self.get_status()?; - status.save()?; - debug!(logger, "saved status is {:?}", status); - - // Clean up the fifo file created by LinuxContainer, which is used for block the created process. - if action == ContainerAction::Run || action == ContainerAction::Start { - let fifo_path = get_fifo_path(&status); - if fifo_path.exists() { - unlink(&fifo_path)?; - } - } - Ok(()) - } - - /// Generate rustjail::Process from OCI::Process - fn get_process(&self, logger: &Logger) -> Result { - let spec = self.runner.config.spec.as_ref().unwrap(); - if spec.process().is_some() { - Ok(Process::new( - logger, - spec.process().as_ref().unwrap(), - // rustjail::LinuxContainer use the exec_id to identify processes in a container, - // so we can get the spawned process by ctr.get_process(exec_id) later. - // Since LinuxContainer is temporarily created to spawn one process in each runk invocation, - // we can use arbitrary string as the exec_id. Here we choose the container id. - &self.id, - self.init, - 0, - None, - )?) - } else { - Err(anyhow!("no process configuration")) - } - } - - /// Spawn a new process in the container by invoking runner. - async fn spawn_process(&mut self, action: ContainerAction, logger: &Logger) -> Result<()> { - // Agent will chdir to bundle_path before creating LinuxContainer. Just do the same as agent. - let current_dir = current_dir()?; - chdir(&self.bundle)?; - defer! { - chdir(¤t_dir).unwrap(); - } - - let process = self.get_process(logger)?; - match action { - ContainerAction::Create => { - self.runner.start(process).await?; - } - ContainerAction::Start => { - self.runner.exec().await?; - } - ContainerAction::Run => { - self.runner.run(process).await?; - } - } - Ok(()) - } - - /// Generate runk specified Status - fn get_status(&self) -> Result { - let oci_state = self.runner.oci_state()?; - // read start time from /proc//stat - let proc = procfs::process::Process::new(self.runner.init_process_pid)?; - let process_start_time = proc.stat()?.starttime; - Status::new( - &self.state_root, - &self.bundle, - oci_state, - process_start_time, - self.runner.created, - self.runner - .cgroup_manager - .as_ref() - .as_any()? - .downcast_ref::() - .unwrap() - .clone(), - self.runner.config.clone(), - ) - } -} - -pub fn create_linux_container( - id: &str, - root: &Path, - config: CreateOpts, - console_socket: Option, - logger: &Logger, -) -> Result { - let mut container = LinuxContainer::new( - id, - root.to_str() - .map(|s| s.to_string()) - .ok_or_else(|| anyhow!("failed to convert bundle path"))? - .as_str(), - None, - config, - logger, - )?; - if let Some(socket_path) = console_socket.as_ref() { - container.set_console_socket(socket_path)?; - } - Ok(container) -} - -// Load rustjail's Linux container. -// "uid_map_path" and "gid_map_path" are always empty, so they are not set. -pub fn load_linux_container( - status: &Status, - console_socket: Option, - logger: &Logger, -) -> Result { - let mut container = LinuxContainer::new( - &status.id, - &status - .root - .to_str() - .map(|s| s.to_string()) - .ok_or_else(|| anyhow!("failed to convert a root path"))?, - None, - status.config.clone(), - logger, - )?; - if let Some(socket_path) = console_socket.as_ref() { - container.set_console_socket(socket_path)?; - } - - container.init_process_pid = status.pid; - container.init_process_start_time = status.process_start_time; - container.created = status.created.into(); - Ok(container) -} - -pub fn get_config_path>(bundle: P) -> PathBuf { - bundle.as_ref().join(CONFIG_FILE_NAME) -} - -pub fn get_fifo_path(status: &Status) -> PathBuf { - status.root.join(&status.id).join(EXEC_FIFO_FILENAME) -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::utils::test_utils::*; - use rustjail::container::EXEC_FIFO_FILENAME; - use std::path::PathBuf; - - #[test] - fn test_get_config_path() { - let test_data = PathBuf::from(TEST_BUNDLE_PATH).join(CONFIG_FILE_NAME); - assert_eq!(get_config_path(TEST_BUNDLE_PATH), test_data); - } - - #[test] - fn test_get_fifo_path() { - let test_data = PathBuf::from(TEST_STATE_ROOT_PATH) - .join(TEST_CONTAINER_ID) - .join(EXEC_FIFO_FILENAME); - let status = create_dummy_status(); - - assert_eq!(get_fifo_path(&status), test_data); - } -} diff --git a/src/tools/runk/libcontainer/src/created_builder.rs b/src/tools/runk/libcontainer/src/created_builder.rs deleted file mode 100644 index 79967d1bf6..0000000000 --- a/src/tools/runk/libcontainer/src/created_builder.rs +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright 2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -use crate::container::{load_linux_container, Container, ContainerLauncher}; -use anyhow::{anyhow, Result}; -use derive_builder::Builder; -use runtime_spec::ContainerState; -use slog::{debug, Logger}; -use std::path::PathBuf; - -/// Used for start command. It will prepare the options used for starting a new container. -#[derive(Default, Builder, Debug, Clone)] -#[builder(build_fn(validate = "Self::validate"))] -pub struct CreatedContainer { - id: String, - root: PathBuf, -} - -impl CreatedContainerBuilder { - /// pre-validate before building CreatedContainer - fn validate(&self) -> Result<(), String> { - // ensure container exists - let id = self.id.as_ref().unwrap(); - let root = self.root.as_ref().unwrap(); - let path = root.join(id); - if !path.as_path().exists() { - return Err(format!("container {} does not exist", id)); - } - - Ok(()) - } -} - -impl CreatedContainer { - /// Create ContainerLauncher that can be used to start a process from an existing init container. - /// It reads the spec from status file of the init container. - pub fn create_launcher(self, logger: &Logger) -> Result { - debug!(logger, "enter CreatedContainer::create_launcher {:?}", self); - let container = Container::load(&self.root, &self.id)?; - - if container.state != ContainerState::Created { - return Err(anyhow!( - "cannot start a container in the {:?} state", - container.state - )); - } - - let config = container.status.config.clone(); - - debug!( - logger, - "Prepare LinuxContainer for starting with config: {:?}", config - ); - let runner = load_linux_container(&container.status, None, logger)?; - - Ok(ContainerLauncher::new( - &self.id, - &container.status.bundle, - &self.root, - true, - runner, - None, - )) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::status::Status; - use crate::utils::test_utils::*; - use nix::sys::stat::Mode; - use nix::unistd::{self, getpid}; - use rustjail::container::EXEC_FIFO_FILENAME; - use scopeguard::defer; - use slog::o; - use std::fs::create_dir_all; - use std::path::Path; - use tempfile::tempdir; - use test_utils::skip_if_not_root; - - fn create_created_container_dirs(root: &Path, id: &str, bundle: &Path) { - Status::create_dir(root, id).unwrap(); - let fifo = root.join(id).join(EXEC_FIFO_FILENAME); - unistd::mkfifo(&fifo, Mode::from_bits(0o644).unwrap()).unwrap(); - create_dir_all(bundle.join(TEST_ROOTFS_PATH)).unwrap(); - } - - #[test] - fn test_created_container_validate() { - let root = tempdir().unwrap(); - let id = TEST_CONTAINER_ID.to_string(); - let result = CreatedContainerBuilder::default() - .id(id) - .root(root.path().to_path_buf()) - .build(); - assert!(result.is_err()); - } - - #[test] - fn test_created_container_create_launcher() { - // create cgroup directory needs root permission - skip_if_not_root!(); - let logger = slog::Logger::root(slog::Discard, o!()); - let bundle_dir = tempdir().unwrap(); - let root = tempdir().unwrap(); - // Since tests are executed concurrently, container_id must be unique in tests with cgroup. - // Or the cgroup directory may be removed by other tests in advance. - let id = "test_created_container_create".to_string(); - create_created_container_dirs(root.path(), &id, bundle_dir.path()); - let pid = getpid().as_raw(); - - let mut spec = create_dummy_spec(); - spec.root_mut() - .as_mut() - .unwrap() - .set_path(bundle_dir.path().join(TEST_ROOTFS_PATH)); - - let status = create_custom_dummy_status(&id, pid, root.path(), &spec); - status.save().unwrap(); - - // create empty cgroup directory to avoid is_pause failing - let cgroup = create_dummy_cgroup(Path::new(id.as_str())); - defer!(cgroup.delete().unwrap()); - - let launcher = CreatedContainerBuilder::default() - .id(id.clone()) - .root(root.into_path()) - .build() - .unwrap() - .create_launcher(&logger) - .unwrap(); - - assert!(launcher.init); - assert_eq!(launcher.runner.config.spec.unwrap(), spec); - assert_eq!(launcher.runner.id, id); - } -} diff --git a/src/tools/runk/libcontainer/src/init_builder.rs b/src/tools/runk/libcontainer/src/init_builder.rs deleted file mode 100644 index 3a6a1d40e2..0000000000 --- a/src/tools/runk/libcontainer/src/init_builder.rs +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright 2021-2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -use crate::container::{create_linux_container, get_config_path, ContainerLauncher}; -use crate::status::Status; -use crate::utils::{canonicalize_spec_root, validate_spec}; -use anyhow::{anyhow, Result}; -use derive_builder::Builder; -use oci_spec::runtime::Spec; -use rustjail::specconv::CreateOpts; -use slog::{debug, Logger}; -use std::path::PathBuf; - -/// Used for create and run commands. It will prepare the options used for creating a new container. -#[derive(Default, Builder, Debug, Clone)] -#[builder(build_fn(validate = "Self::validate"))] -pub struct InitContainer { - id: String, - bundle: PathBuf, - root: PathBuf, - console_socket: Option, - pid_file: Option, -} - -impl InitContainerBuilder { - /// pre-validate before building InitContainer - fn validate(&self) -> Result<(), String> { - // ensure container hasn't already been created - let id = self.id.as_ref().unwrap(); - let root = self.root.as_ref().unwrap(); - let status_path = Status::get_dir_path(root, id); - if status_path.exists() { - return Err(format!( - "container {} already exists at path {:?}", - id, root - )); - } - Ok(()) - } -} - -impl InitContainer { - /// Create ContainerLauncher that can be used to launch a new container. - /// It will read the spec under bundle path. - pub fn create_launcher(self, logger: &Logger) -> Result { - debug!(logger, "enter InitContainer::create_launcher {:?}", self); - let bundle_canon = self.bundle.canonicalize()?; - let config_path = get_config_path(&bundle_canon); - let mut spec = Spec::load( - config_path - .to_str() - .ok_or_else(|| anyhow!("invalid config path"))?, - )?; - // Only absolute rootfs path is valid when creating LinuxContainer later. - canonicalize_spec_root(&mut spec, &bundle_canon)?; - debug!(logger, "load spec from config file: {:?}", spec); - validate_spec(&spec, &self.console_socket)?; - - let config = CreateOpts { - cgroup_name: "".to_string(), - use_systemd_cgroup: false, - // TODO: liboci-cli does not support --no-pivot option for create and run command. - // After liboci-cli supports the option, we will change the following code. - // no_pivot_root: self.no_pivot, - no_pivot_root: false, - no_new_keyring: false, - spec: Some(spec), - rootless_euid: false, - rootless_cgroup: false, - container_name: "".to_string(), - }; - debug!(logger, "create LinuxContainer with config: {:?}", config); - let container = - create_linux_container(&self.id, &self.root, config, self.console_socket, logger)?; - - Ok(ContainerLauncher::new( - &self.id, - &bundle_canon, - &self.root, - true, - container, - self.pid_file, - )) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::container::CONFIG_FILE_NAME; - use crate::utils::test_utils::*; - use oci_spec::runtime::Process; - use slog::o; - use std::fs::{create_dir, File}; - use std::path::Path; - use tempfile::tempdir; - - #[test] - fn test_init_container_validate() { - let root = tempdir().unwrap(); - let id = TEST_CONTAINER_ID.to_string(); - Status::create_dir(root.path(), id.as_str()).unwrap(); - let result = InitContainerBuilder::default() - .id(id) - .root(root.path().to_path_buf()) - .bundle(PathBuf::from(TEST_BUNDLE_PATH)) - .pid_file(None) - .console_socket(None) - .build(); - assert!(result.is_err()); - } - - #[test] - fn test_init_container_create_launcher() { - #[cfg(all(target_arch = "powerpc64", target_endian = "little"))] - skip_if_not_root!(); - let logger = slog::Logger::root(slog::Discard, o!()); - let root_dir = tempdir().unwrap(); - let bundle_dir = tempdir().unwrap(); - // create dummy rootfs - create_dir(bundle_dir.path().join(TEST_ROOTFS_PATH)).unwrap(); - let config_file = bundle_dir.path().join(CONFIG_FILE_NAME); - let mut spec = create_dummy_spec(); - let file = File::create(config_file).unwrap(); - serde_json::to_writer(&file, &spec).unwrap(); - - spec.root_mut() - .as_mut() - .unwrap() - .set_path(bundle_dir.path().join(TEST_ROOTFS_PATH)); - let test_data = TestContainerData { - // Since tests are executed concurrently, container_id must be unique in tests with cgroup. - // Or the cgroup directory may be removed by other tests in advance. - id: String::from("test_init_container_create_launcher"), - bundle: bundle_dir.path().to_path_buf(), - root: root_dir.into_path(), - console_socket: Some(PathBuf::from(TEST_CONSOLE_SOCKET_PATH)), - config: CreateOpts { - spec: Some(spec), - ..Default::default() - }, - pid_file: Some(PathBuf::from(TEST_PID_FILE_PATH)), - }; - - let launcher = InitContainerBuilder::default() - .id(test_data.id.clone()) - .bundle(test_data.bundle.clone()) - .root(test_data.root.clone()) - .console_socket(test_data.console_socket.clone()) - .pid_file(test_data.pid_file.clone()) - .build() - .unwrap() - .create_launcher(&logger) - .unwrap(); - - // LinuxContainer doesn't impl PartialEq, so we need to compare the fields manually. - assert!(launcher.init); - assert_eq!(launcher.bundle, test_data.bundle); - assert_eq!(launcher.state_root, test_data.root); - assert_eq!(launcher.pid_file, test_data.pid_file); - assert_eq!(launcher.runner.id, test_data.id); - assert_eq!(launcher.runner.config.spec, test_data.config.spec); - assert_eq!( - Some(launcher.runner.console_socket), - test_data.console_socket - ); - // If it is run by root, create_launcher will create cgroup dirs successfully. So we need to do some cleanup stuff. - if nix::unistd::Uid::effective().is_root() { - clean_up_cgroup(Path::new(&test_data.id)); - } - } - - #[test] - fn test_init_container_tty_err() { - let logger = slog::Logger::root(slog::Discard, o!()); - let bundle_dir = tempdir().unwrap(); - let config_file = bundle_dir.path().join(CONFIG_FILE_NAME); - - let mut spec = Spec::default(); - spec.set_process(Some(Process::default())); - spec.process_mut() - .as_mut() - .unwrap() - .set_terminal(Some(true)); - - let file = File::create(config_file).unwrap(); - serde_json::to_writer(&file, &spec).unwrap(); - - let test_data = TestContainerData { - id: String::from(TEST_CONTAINER_ID), - bundle: bundle_dir.into_path(), - root: tempdir().unwrap().into_path(), - console_socket: None, - config: CreateOpts { - spec: Some(spec), - ..Default::default() - }, - pid_file: None, - }; - - let result = InitContainerBuilder::default() - .id(test_data.id.clone()) - .bundle(test_data.bundle.clone()) - .root(test_data.root.clone()) - .console_socket(test_data.console_socket.clone()) - .pid_file(test_data.pid_file) - .build() - .unwrap() - .create_launcher(&logger); - - assert!(result.is_err()); - } -} diff --git a/src/tools/runk/libcontainer/src/lib.rs b/src/tools/runk/libcontainer/src/lib.rs deleted file mode 100644 index 1d31a6608d..0000000000 --- a/src/tools/runk/libcontainer/src/lib.rs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2021-2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -pub mod activated_builder; -pub mod cgroup; -pub mod container; -pub mod created_builder; -pub mod init_builder; -pub mod status; -pub mod utils; diff --git a/src/tools/runk/libcontainer/src/status.rs b/src/tools/runk/libcontainer/src/status.rs deleted file mode 100644 index f5c0af1801..0000000000 --- a/src/tools/runk/libcontainer/src/status.rs +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright 2021-2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -use crate::cgroup::is_paused; -use crate::container::get_fifo_path; -use crate::utils::*; -use anyhow::{anyhow, Result}; -use chrono::{DateTime, Utc}; -use libc::pid_t; -use nix::{ - errno::Errno, - sys::{signal::kill, stat::Mode}, - unistd::Pid, -}; -use procfs::process::ProcState; -use runtime_spec::{ContainerState, State as OCIState}; -use rustjail::{cgroups::fs::Manager as CgroupManager, specconv::CreateOpts}; -use serde::{Deserialize, Serialize}; -use std::{ - fs::{self, File, OpenOptions}, - path::{Path, PathBuf}, - time::SystemTime, -}; - -const STATUS_FILE: &str = "status.json"; - -#[derive(Serialize, Deserialize, Debug, Clone)] -#[serde(rename_all = "camelCase")] -pub struct Status { - pub oci_version: String, - pub id: String, - pub pid: pid_t, - pub root: PathBuf, - pub bundle: PathBuf, - pub rootfs: String, - pub process_start_time: u64, - pub created: DateTime, - // Methods of Manager traits in rustjail are invisible, and CgroupManager.cgroup can't be serialized. - // So it is cumbersome to manage cgroups by this field. Instead, we use cgroups-rs::cgroup directly in Container to manager cgroups. - // Another solution is making some methods public outside rustjail and adding getter/setter for CgroupManager.cgroup. - // Temporarily keep this field for compatibility. - pub cgroup_manager: CgroupManager, - pub config: CreateOpts, -} - -impl Status { - pub fn new( - root: &Path, - bundle: &Path, - oci_state: OCIState, - process_start_time: u64, - created_time: SystemTime, - cgroup_mg: CgroupManager, - config: CreateOpts, - ) -> Result { - let created = DateTime::from(created_time); - let rootfs = config - .clone() - .spec - .ok_or_else(|| anyhow!("spec config was not present"))? - .root() - .as_ref() - .ok_or_else(|| anyhow!("root config was not present in the spec"))? - .path() - .clone(); - - Ok(Self { - oci_version: oci_state.version, - id: oci_state.id, - pid: oci_state.pid, - root: root.to_path_buf(), - bundle: bundle.to_path_buf(), - rootfs: rootfs.display().to_string(), - process_start_time, - created, - cgroup_manager: cgroup_mg, - config, - }) - } - - pub fn save(&self) -> Result<()> { - let state_file_path = Self::get_file_path(&self.root, &self.id); - - if !&self.root.exists() { - create_dir_with_mode(&self.root, Mode::S_IRWXU, true)?; - } - - let file = OpenOptions::new() - .write(true) - .create(true) - .truncate(true) - .open(state_file_path)?; - - serde_json::to_writer(&file, self)?; - - Ok(()) - } - - pub fn load(state_root: &Path, id: &str) -> Result { - let state_file_path = Self::get_file_path(state_root, id); - if !state_file_path.exists() { - return Err(anyhow!("container \"{}\" does not exist", id)); - } - - let file = File::open(&state_file_path)?; - let state: Self = serde_json::from_reader(&file)?; - - Ok(state) - } - - pub fn create_dir(state_root: &Path, id: &str) -> Result<()> { - let state_dir_path = Self::get_dir_path(state_root, id); - if !state_dir_path.exists() { - create_dir_with_mode(state_dir_path, Mode::S_IRWXU, true)?; - } else { - return Err(anyhow!("container with id exists: \"{}\"", id)); - } - - Ok(()) - } - - pub fn remove_dir(&self) -> Result<()> { - let state_dir_path = Self::get_dir_path(&self.root, &self.id); - fs::remove_dir_all(state_dir_path)?; - - Ok(()) - } - - pub fn get_dir_path(state_root: &Path, id: &str) -> PathBuf { - state_root.join(id) - } - - pub fn get_file_path(state_root: &Path, id: &str) -> PathBuf { - state_root.join(id).join(STATUS_FILE) - } -} - -pub fn is_process_running(pid: Pid) -> Result { - match kill(pid, None) { - Err(errno) => { - if errno != Errno::ESRCH { - return Err(anyhow!("failed to kill process {}: {:?}", pid, errno)); - } - Ok(false) - } - Ok(()) => Ok(true), - } -} - -// Returns the current state of a container. It will read cgroupfs and procfs to determine the state. -// https://github.com/opencontainers/runc/blob/86d6898f3052acba1ebcf83aa2eae3f6cc5fb471/libcontainer/container_linux.go#L1953 -pub fn get_current_container_state( - status: &Status, - cgroup: &cgroups::Cgroup, -) -> Result { - if is_paused(cgroup)? { - return Ok(ContainerState::Paused); - } - let proc = procfs::process::Process::new(status.pid); - // if reading /proc/ occurs error, then the process is not running - if proc.is_err() { - return Ok(ContainerState::Stopped); - } - let proc_stat = proc.unwrap().stat()?; - // if start time is not equal, then the pid is reused, and the process is not running - if proc_stat.starttime != status.process_start_time { - return Ok(ContainerState::Stopped); - } - match proc_stat.state()? { - ProcState::Zombie | ProcState::Dead => Ok(ContainerState::Stopped), - _ => { - let fifo = get_fifo_path(status); - if fifo.exists() { - return Ok(ContainerState::Created); - } - Ok(ContainerState::Running) - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - use crate::utils::test_utils::*; - use ::test_utils::skip_if_not_root; - use chrono::{DateTime, Utc}; - use nix::unistd::getpid; - use runtime_spec::ContainerState; - use rustjail::cgroups::fs::Manager as CgroupManager; - use scopeguard::defer; - use std::path::Path; - use std::time::SystemTime; - - #[test] - fn test_status() { - let cgm: CgroupManager = serde_json::from_str(TEST_CGM_DATA).unwrap(); - let oci_state = create_dummy_oci_state(); - let created = SystemTime::now(); - let status = Status::new( - Path::new(TEST_STATE_ROOT_PATH), - Path::new(TEST_BUNDLE_PATH), - oci_state.clone(), - 1, - created, - cgm, - create_dummy_opts(), - ) - .unwrap(); - - assert_eq!(status.id, oci_state.id); - assert_eq!(status.pid, oci_state.pid); - assert_eq!(status.process_start_time, 1); - assert_eq!(status.created, DateTime::::from(created)); - } - - #[test] - fn test_is_process_running() { - let pid = getpid(); - let ret = is_process_running(pid).unwrap(); - assert!(ret); - } - - #[test] - fn test_get_current_container_state() { - skip_if_not_root!(); - let mut status = create_dummy_status(); - status.id = "test_get_current_container_state".to_string(); - // crete a dummy cgroup to make sure is_pause doesn't return error - let cgroup = create_dummy_cgroup(Path::new(&status.id)); - defer!(cgroup.delete().unwrap()); - let state = get_current_container_state(&status, &cgroup).unwrap(); - assert_eq!(state, ContainerState::Running); - } -} diff --git a/src/tools/runk/libcontainer/src/utils.rs b/src/tools/runk/libcontainer/src/utils.rs deleted file mode 100644 index 612af26b90..0000000000 --- a/src/tools/runk/libcontainer/src/utils.rs +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright 2021-2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -use anyhow::{anyhow, Result}; -use nix::sys::stat::Mode; -use oci_spec::runtime::{Process, Spec}; -use std::{ - fs::{DirBuilder, File}, - io::{prelude::*, BufReader}, - os::unix::fs::DirBuilderExt, - path::{Path, PathBuf}, -}; - -pub fn lines_from_file>(path: P) -> Result> { - let file = File::open(&path)?; - let buf = BufReader::new(file); - Ok(buf - .lines() - .map(|v| v.expect("could not parse line")) - .collect()) -} - -pub fn create_dir_with_mode>(path: P, mode: Mode, recursive: bool) -> Result<()> { - let path = path.as_ref(); - if path.exists() { - return Err(anyhow!("{} already exists", path.display())); - } - - Ok(DirBuilder::new() - .recursive(recursive) - .mode(mode.bits()) - .create(path)?) -} - -/// If root in spec is a relative path, make it absolute. -pub fn canonicalize_spec_root(spec: &mut Spec, bundle_canon: &Path) -> Result<()> { - let spec_root = spec - .root_mut() - .as_mut() - .ok_or_else(|| anyhow!("root config was not present in the spec file"))?; - let rootfs_path = &spec_root.path(); - if !rootfs_path.is_absolute() { - let bundle_canon_path = bundle_canon.join(rootfs_path).canonicalize()?; - spec_root.set_path(bundle_canon_path); - } - Ok(()) -} - -/// Check whether spec is valid. Now runk only support detach mode. -pub fn validate_spec(spec: &Spec, console_socket: &Option) -> Result<()> { - validate_process_spec(spec.process())?; - if let Some(process) = spec.process().as_ref() { - // runk always launches containers with detached mode, so users have to - // use a console socket with run or create operation when a terminal is used. - if process.terminal().is_some() && console_socket.is_none() { - return Err(anyhow!( - "cannot allocate a pseudo-TTY without setting a console socket" - )); - } - } - Ok(()) -} - -// Validate process just like runc, https://github.com/opencontainers/runc/pull/623 -pub fn validate_process_spec(process: &Option) -> Result<()> { - let process = process - .as_ref() - .ok_or_else(|| anyhow!("process property must not be empty"))?; - if process.cwd().as_os_str().is_empty() { - return Err(anyhow!("cwd property must not be empty")); - } - let cwd = process.cwd(); - if !cwd.is_absolute() { - return Err(anyhow!("cwd must be an absolute path")); - } - if process.args().is_none() { - return Err(anyhow!("args must not be empty")); - } - Ok(()) -} - -#[cfg(test)] -pub(crate) mod test_utils { - use super::*; - use crate::status::Status; - use chrono::DateTime; - use nix::unistd::getpid; - use oci::{LinuxBuilder, LinuxNamespaceBuilder, Process, Root, Spec}; - use oci_spec::runtime as oci; - use runtime_spec::{ContainerState, State as OCIState}; - use rustjail::{ - cgroups::fs::Manager as CgroupManager, container::TYPETONAME, specconv::CreateOpts, - }; - use std::{fs::create_dir_all, path::Path, time::SystemTime}; - use tempfile::tempdir; - - pub const TEST_CONTAINER_ID: &str = "test"; - pub const TEST_STATE_ROOT_PATH: &str = "/state"; - pub const TEST_BUNDLE_PATH: &str = "/bundle"; - pub const TEST_ROOTFS_PATH: &str = "rootfs"; - pub const TEST_ANNOTATION: &str = "test-annotation"; - pub const TEST_CONSOLE_SOCKET_PATH: &str = "/test-console-sock"; - pub const TEST_PROCESS_FILE_NAME: &str = "process.json"; - pub const TEST_PID_FILE_PATH: &str = "/test-pid"; - pub const TEST_HOST_NAME: &str = "test-host"; - pub const TEST_OCI_SPEC_VERSION: &str = "1.0.2"; - pub const TEST_CGM_DATA: &str = r#"{ - "paths": { - "devices": "/sys/fs/cgroup/devices" - }, - "mounts": { - "devices": "/sys/fs/cgroup/devices" - }, - "cpath": "test" - }"#; - - #[derive(Debug)] - pub struct TestContainerData { - pub id: String, - pub bundle: PathBuf, - pub root: PathBuf, - pub console_socket: Option, - pub pid_file: Option, - pub config: CreateOpts, - } - - pub fn create_dummy_spec() -> Spec { - let linux = LinuxBuilder::default() - .namespaces( - TYPETONAME - .iter() - .filter(|&(_, &name)| name != "user") - .map(|ns| { - LinuxNamespaceBuilder::default() - .typ(ns.0.clone()) - .path(PathBuf::from("")) - .build() - .unwrap() - }) - .collect::>(), - ) - .build() - .unwrap(); - - let mut process = Process::default(); - process.set_args(Some(vec!["sleep".to_string(), "10".to_string()])); - process.set_env(Some(vec!["PATH=/bin:/usr/bin".to_string()])); - process.set_cwd(PathBuf::from("/")); - - let mut root = Root::default(); - root.set_path(PathBuf::from(TEST_ROOTFS_PATH)); - root.set_readonly(Some(false)); - - let mut spec = Spec::default(); - spec.set_version(TEST_OCI_SPEC_VERSION.to_string()); - spec.set_process(Some(process)); - spec.set_hostname(Some(TEST_HOST_NAME.to_string())); - spec.set_root(Some(root)); - spec.set_linux(Some(linux)); - - spec - } - - pub fn create_dummy_opts() -> CreateOpts { - let mut spec = Spec::default(); - spec.set_root(Some(Root::default())); - - CreateOpts { - cgroup_name: "".to_string(), - use_systemd_cgroup: false, - no_pivot_root: false, - no_new_keyring: false, - spec: Some(spec), - rootless_euid: false, - rootless_cgroup: false, - container_name: "".to_string(), - } - } - - pub fn create_dummy_oci_state() -> OCIState { - OCIState { - version: TEST_OCI_SPEC_VERSION.to_string(), - id: TEST_CONTAINER_ID.to_string(), - status: ContainerState::Running, - pid: getpid().as_raw(), - bundle: TEST_BUNDLE_PATH.to_string(), - annotations: [(TEST_ANNOTATION.to_string(), TEST_ANNOTATION.to_string())] - .iter() - .cloned() - .collect(), - } - } - - pub fn create_dummy_status() -> Status { - let cgm: CgroupManager = serde_json::from_str(TEST_CGM_DATA).unwrap(); - let oci_state = create_dummy_oci_state(); - let created = SystemTime::now(); - let start_time = procfs::process::Process::new(oci_state.pid) - .unwrap() - .stat() - .unwrap() - .starttime; - let status = Status::new( - Path::new(TEST_STATE_ROOT_PATH), - Path::new(TEST_BUNDLE_PATH), - oci_state, - start_time, - created, - cgm, - create_dummy_opts(), - ) - .unwrap(); - - status - } - - pub fn create_custom_dummy_status(id: &str, pid: i32, root: &Path, spec: &Spec) -> Status { - let start_time = procfs::process::Process::new(pid) - .unwrap() - .stat() - .unwrap() - .starttime; - Status { - oci_version: spec.version().clone(), - id: id.to_string(), - pid, - root: root.to_path_buf(), - bundle: PathBuf::from(TEST_BUNDLE_PATH), - rootfs: TEST_ROOTFS_PATH.to_string(), - process_start_time: start_time, - created: DateTime::from(SystemTime::now()), - cgroup_manager: serde_json::from_str(TEST_CGM_DATA).unwrap(), - config: CreateOpts { - spec: Some(spec.clone()), - ..Default::default() - }, - } - } - - pub fn create_dummy_cgroup(cpath: &Path) -> cgroups::Cgroup { - cgroups::Cgroup::new(cgroups::hierarchies::auto(), cpath).unwrap() - } - - pub fn clean_up_cgroup(cpath: &Path) { - let cgroup = cgroups::Cgroup::load(cgroups::hierarchies::auto(), cpath); - cgroup.delete().unwrap(); - } - - #[test] - fn test_canonicalize_spec_root() { - let gen_spec = |p: &str| -> Spec { - let mut root = Root::default(); - root.set_path(PathBuf::from(p)); - root.set_readonly(Some(false)); - - let mut spec = Spec::default(); - spec.set_root(Some(root)); - spec - }; - - let rootfs_name = TEST_ROOTFS_PATH; - let temp_dir = tempdir().unwrap(); - let bundle_dir = temp_dir.path(); - let abs_root = bundle_dir.join(rootfs_name); - create_dir_all(abs_root.clone()).unwrap(); - let mut spec = gen_spec(abs_root.to_str().unwrap()); - assert!(canonicalize_spec_root(&mut spec, bundle_dir).is_ok()); - assert_eq!(spec.root_mut().clone().unwrap().path(), &abs_root); - let mut spec = gen_spec(rootfs_name); - assert!(canonicalize_spec_root(&mut spec, bundle_dir).is_ok()); - assert_eq!(spec.root().clone().unwrap().path(), &abs_root); - } - - #[test] - pub fn test_validate_process_spec() { - let mut valid_process = Process::default(); - valid_process.set_args(Some(vec!["test".to_string()])); - valid_process.set_cwd(PathBuf::from("/")); - - assert!(validate_process_spec(&None).is_err()); - assert!(validate_process_spec(&Some(valid_process.clone())).is_ok()); - let mut invalid_process = valid_process.clone(); - invalid_process.set_args(None); - assert!(validate_process_spec(&Some(invalid_process)).is_err()); - let mut invalid_process = valid_process.clone(); - invalid_process.set_cwd(PathBuf::from("")); - assert!(validate_process_spec(&Some(invalid_process)).is_err()); - let mut invalid_process = valid_process; - invalid_process.set_cwd(PathBuf::from("test/")); - assert!(validate_process_spec(&Some(invalid_process)).is_err()); - } -} diff --git a/src/tools/runk/src/commands/create.rs b/src/tools/runk/src/commands/create.rs deleted file mode 100644 index 696bc205ae..0000000000 --- a/src/tools/runk/src/commands/create.rs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2021-2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -use anyhow::Result; -use libcontainer::{container::ContainerAction, init_builder::InitContainerBuilder}; - -use liboci_cli::Create; -use slog::{info, Logger}; -use std::path::Path; - -pub async fn run(opts: Create, root: &Path, logger: &Logger) -> Result<()> { - let mut launcher = InitContainerBuilder::default() - .id(opts.container_id) - .bundle(opts.bundle) - .root(root.to_path_buf()) - .console_socket(opts.console_socket) - .pid_file(opts.pid_file) - .build()? - .create_launcher(logger)?; - - launcher.launch(ContainerAction::Create, logger).await?; - - info!(&logger, "create command finished successfully"); - - Ok(()) -} diff --git a/src/tools/runk/src/commands/delete.rs b/src/tools/runk/src/commands/delete.rs deleted file mode 100644 index 1eb6dfd5f0..0000000000 --- a/src/tools/runk/src/commands/delete.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2021-2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -use anyhow::{anyhow, Result}; -use libcontainer::{container::Container, status::Status}; -use liboci_cli::Delete; -use slog::{info, Logger}; -use std::{fs, path::Path}; - -pub async fn run(opts: Delete, root: &Path, logger: &Logger) -> Result<()> { - let container_id = &opts.container_id; - let status_dir = Status::get_dir_path(root, container_id); - if !status_dir.exists() { - return Err(anyhow!("container {} does not exist", container_id)); - } - - let container = if let Ok(value) = Container::load(root, container_id) { - value - } else { - fs::remove_dir_all(status_dir)?; - return Ok(()); - }; - container.delete(opts.force, logger).await?; - - info!(&logger, "delete command finished successfully"); - - Ok(()) -} diff --git a/src/tools/runk/src/commands/exec.rs b/src/tools/runk/src/commands/exec.rs deleted file mode 100644 index 44a7cfc027..0000000000 --- a/src/tools/runk/src/commands/exec.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2021-2022 Kata Contributors -// -// SPDX-License-Identifier: Apache-2.0 -// - -use anyhow::Result; -use libcontainer::activated_builder::ActivatedContainerBuilder; -use libcontainer::container::ContainerAction; -use liboci_cli::Exec; -use slog::{info, Logger}; -use std::path::Path; - -pub async fn run(opts: Exec, root: &Path, logger: &Logger) -> Result<()> { - let mut launcher = ActivatedContainerBuilder::default() - .id(opts.container_id) - .root(root.to_path_buf()) - .console_socket(opts.console_socket) - .pid_file(opts.pid_file) - .tty(opts.tty) - .cwd(opts.cwd) - .env(opts.env) - .no_new_privs(opts.no_new_privs) - .process(opts.process) - .args(opts.command) - .build()? - .create_launcher(logger)?; - - launcher.launch(ContainerAction::Run, logger).await?; - - info!(&logger, "exec command finished successfully"); - Ok(()) -} diff --git a/src/tools/runk/src/commands/kill.rs b/src/tools/runk/src/commands/kill.rs deleted file mode 100644 index 4526749da5..0000000000 --- a/src/tools/runk/src/commands/kill.rs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2021-2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -use anyhow::Result; -use libcontainer::container::Container; -use liboci_cli::Kill; -use nix::sys::signal::Signal; -use slog::{info, Logger}; -use std::{convert::TryFrom, path::Path, str::FromStr}; - -pub fn run(opts: Kill, state_root: &Path, logger: &Logger) -> Result<()> { - let container_id = &opts.container_id; - let container = Container::load(state_root, container_id)?; - let sig = parse_signal(&opts.signal)?; - - let all = opts.all; - container.kill(sig, all)?; - - info!(&logger, "kill command finished successfully"); - - Ok(()) -} - -fn parse_signal(signal: &str) -> Result { - if let Ok(num) = signal.parse::() { - return Ok(Signal::try_from(num)?); - } - - let mut signal_upper = signal.to_uppercase(); - if !signal_upper.starts_with("SIG") { - signal_upper = "SIG".to_string() + &signal_upper; - } - - Ok(Signal::from_str(&signal_upper)?) -} - -#[cfg(test)] -mod tests { - use super::*; - use nix::sys::signal::Signal; - - #[test] - fn test_parse_signal() { - assert_eq!(Signal::SIGHUP, parse_signal("1").unwrap()); - assert_eq!(Signal::SIGHUP, parse_signal("sighup").unwrap()); - assert_eq!(Signal::SIGHUP, parse_signal("hup").unwrap()); - assert_eq!(Signal::SIGHUP, parse_signal("SIGHUP").unwrap()); - assert_eq!(Signal::SIGHUP, parse_signal("HUP").unwrap()); - - assert_eq!(Signal::SIGKILL, parse_signal("9").unwrap()); - assert_eq!(Signal::SIGKILL, parse_signal("sigkill").unwrap()); - assert_eq!(Signal::SIGKILL, parse_signal("kill").unwrap()); - assert_eq!(Signal::SIGKILL, parse_signal("SIGKILL").unwrap()); - assert_eq!(Signal::SIGKILL, parse_signal("KILL").unwrap()); - } -} diff --git a/src/tools/runk/src/commands/list.rs b/src/tools/runk/src/commands/list.rs deleted file mode 100644 index 0506ccae17..0000000000 --- a/src/tools/runk/src/commands/list.rs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2021-2022 Kata Contributors -// -// SPDX-License-Identifier: Apache-2.0 -// - -use super::state::get_container_state_name; -use anyhow::Result; -use libcontainer::container::Container; -use liboci_cli::List; -use runtime_spec::ContainerState; -use slog::{info, Logger}; -use std::fmt::Write as _; -use std::{fs, os::unix::prelude::MetadataExt, path::Path}; -use std::{io, io::Write}; -use tabwriter::TabWriter; -use uzers::get_user_by_uid; - -pub fn run(_: List, root: &Path, logger: &Logger) -> Result<()> { - let mut content = String::new(); - for entry in fs::read_dir(root)? { - let entry = entry?; - // Possibly race with other command of runk, so continue loop when any error occurs below - let metadata = match entry.metadata() { - Ok(metadata) => metadata, - Err(_) => continue, - }; - if !metadata.is_dir() { - continue; - } - let container_id = match entry.file_name().into_string() { - Ok(id) => id, - Err(_) => continue, - }; - let container = match Container::load(root, &container_id) { - Ok(container) => container, - Err(_) => continue, - }; - let state = container.state; - // Just like runc, pid of stopped container is 0 - let pid = match state { - ContainerState::Stopped => 0, - _ => container.status.pid, - }; - // May replace get_user_by_uid with getpwuid(3) - let owner = match get_user_by_uid(metadata.uid()) { - Some(user) => String::from(user.name().to_string_lossy()), - None => format!("#{}", metadata.uid()), - }; - let _ = writeln!( - content, - "{}\t{}\t{}\t{}\t{}\t{}", - container_id, - pid, - get_container_state_name(state), - container.status.bundle.display(), - container.status.created, - owner - ); - } - - let mut tab_writer = TabWriter::new(io::stdout()); - writeln!(&mut tab_writer, "ID\tPID\tSTATUS\tBUNDLE\tCREATED\tOWNER")?; - write!(&mut tab_writer, "{}", content)?; - tab_writer.flush()?; - - info!(&logger, "list command finished successfully"); - Ok(()) -} diff --git a/src/tools/runk/src/commands/mod.rs b/src/tools/runk/src/commands/mod.rs deleted file mode 100644 index 249b1440ab..0000000000 --- a/src/tools/runk/src/commands/mod.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2021-2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -pub mod create; -pub mod delete; -pub mod exec; -pub mod kill; -pub mod list; -pub mod pause; -pub mod ps; -pub mod resume; -pub mod run; -pub mod spec; -pub mod start; -pub mod state; diff --git a/src/tools/runk/src/commands/pause.rs b/src/tools/runk/src/commands/pause.rs deleted file mode 100644 index fee9498a02..0000000000 --- a/src/tools/runk/src/commands/pause.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2021-2022 Kata Contributors -// -// SPDX-License-Identifier: Apache-2.0 -// - -use anyhow::Result; -use libcontainer::container::Container; -use liboci_cli::Pause; -use slog::{info, Logger}; -use std::path::Path; - -pub fn run(opts: Pause, root: &Path, logger: &Logger) -> Result<()> { - let container = Container::load(root, &opts.container_id)?; - container.pause()?; - - info!(&logger, "pause command finished successfully"); - Ok(()) -} diff --git a/src/tools/runk/src/commands/ps.rs b/src/tools/runk/src/commands/ps.rs deleted file mode 100644 index 84bbc5ef2d..0000000000 --- a/src/tools/runk/src/commands/ps.rs +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2021-2022 Kata Contributors -// -// SPDX-License-Identifier: Apache-2.0 -// - -use anyhow::anyhow; -use anyhow::Result; -use libcontainer::container::Container; -use liboci_cli::Ps; -use slog::{info, Logger}; -use std::path::Path; -use std::process::Command; -use std::str; - -pub fn run(opts: Ps, root: &Path, logger: &Logger) -> Result<()> { - let container = Container::load(root, opts.container_id.as_str())?; - let pids = container - .processes()? - .iter() - .map(|pid| pid.as_raw()) - .collect::>(); - - match opts.format.as_str() { - "json" => println!("{}", serde_json::to_string(&pids)?), - "table" => { - let ps_options = if opts.ps_options.is_empty() { - vec!["-ef".to_string()] - } else { - opts.ps_options - }; - let output = Command::new("ps").args(ps_options).output()?; - if !output.status.success() { - return Err(anyhow!("{}", std::str::from_utf8(&output.stderr)?)); - } - let lines = str::from_utf8(&output.stdout)?.lines().collect::>(); - if lines.is_empty() { - return Err(anyhow!("no processes found")); - } - let pid_index = lines[0] - .split_whitespace() - .position(|field| field == "PID") - .ok_or_else(|| anyhow!("could't find PID field in ps output"))?; - println!("{}", lines[0]); - for &line in &lines[1..] { - if line.is_empty() { - continue; - } - let fields = line.split_whitespace().collect::>(); - if pid_index >= fields.len() { - continue; - } - let pid: i32 = fields[pid_index].parse()?; - if pids.contains(&pid) { - println!("{}", line); - } - } - } - _ => return Err(anyhow!("unknown format: {}", opts.format)), - } - - info!(&logger, "ps command finished successfully"); - Ok(()) -} diff --git a/src/tools/runk/src/commands/resume.rs b/src/tools/runk/src/commands/resume.rs deleted file mode 100644 index 7d8b9d39d9..0000000000 --- a/src/tools/runk/src/commands/resume.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2021-2022 Kata Contributors -// -// SPDX-License-Identifier: Apache-2.0 -// - -use anyhow::Result; -use libcontainer::container::Container; -use liboci_cli::Resume; -use slog::{info, Logger}; -use std::path::Path; - -pub fn run(opts: Resume, root: &Path, logger: &Logger) -> Result<()> { - let container = Container::load(root, &opts.container_id)?; - container.resume()?; - - info!(&logger, "pause command finished successfully"); - Ok(()) -} diff --git a/src/tools/runk/src/commands/run.rs b/src/tools/runk/src/commands/run.rs deleted file mode 100644 index 2c5b69fc0e..0000000000 --- a/src/tools/runk/src/commands/run.rs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2021-2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -use anyhow::Result; -use libcontainer::{container::ContainerAction, init_builder::InitContainerBuilder}; -use liboci_cli::Run; -use slog::{info, Logger}; -use std::path::Path; - -pub async fn run(opts: Run, root: &Path, logger: &Logger) -> Result<()> { - let mut launcher = InitContainerBuilder::default() - .id(opts.container_id) - .bundle(opts.bundle) - .root(root.to_path_buf()) - .console_socket(opts.console_socket) - .pid_file(opts.pid_file) - .build()? - .create_launcher(logger)?; - - launcher.launch(ContainerAction::Run, logger).await?; - - info!(&logger, "run command finished successfully"); - - Ok(()) -} diff --git a/src/tools/runk/src/commands/spec.rs b/src/tools/runk/src/commands/spec.rs deleted file mode 100644 index 4dcf4d9ebf..0000000000 --- a/src/tools/runk/src/commands/spec.rs +++ /dev/null @@ -1,207 +0,0 @@ -// Copyright 2021-2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -//use crate::container::get_config_path; -use anyhow::Result; -use libcontainer::container::CONFIG_FILE_NAME; -use liboci_cli::Spec; -use slog::{info, Logger}; -use std::{fs::File, io::Write, path::Path}; - -pub const DEFAULT_SPEC: &str = r#"{ - "ociVersion": "1.0.2-dev", - "process": { - "terminal": true, - "user": { - "uid": 0, - "gid": 0 - }, - "args": [ - "sh" - ], - "env": [ - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - "TERM=xterm" - ], - "cwd": "/", - "capabilities": { - "bounding": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "effective": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "inheritable": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "permitted": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ], - "ambient": [ - "CAP_AUDIT_WRITE", - "CAP_KILL", - "CAP_NET_BIND_SERVICE" - ] - }, - "rlimits": [ - { - "type": "RLIMIT_NOFILE", - "hard": 1024, - "soft": 1024 - } - ], - "noNewPrivileges": true - }, - "root": { - "path": "rootfs", - "readonly": true - }, - "hostname": "runk", - "mounts": [ - { - "destination": "/proc", - "type": "proc", - "source": "proc" - }, - { - "destination": "/dev", - "type": "tmpfs", - "source": "tmpfs", - "options": [ - "nosuid", - "strictatime", - "mode=755", - "size=65536k" - ] - }, - { - "destination": "/dev/pts", - "type": "devpts", - "source": "devpts", - "options": [ - "nosuid", - "noexec", - "newinstance", - "ptmxmode=0666", - "mode=0620", - "gid=5" - ] - }, - { - "destination": "/dev/shm", - "type": "tmpfs", - "source": "shm", - "options": [ - "nosuid", - "noexec", - "nodev", - "mode=1777", - "size=65536k" - ] - }, - { - "destination": "/dev/mqueue", - "type": "mqueue", - "source": "mqueue", - "options": [ - "nosuid", - "noexec", - "nodev" - ] - }, - { - "destination": "/sys", - "type": "sysfs", - "source": "sysfs", - "options": [ - "nosuid", - "noexec", - "nodev", - "ro" - ] - }, - { - "destination": "/sys/fs/cgroup", - "type": "cgroup", - "source": "cgroup", - "options": [ - "nosuid", - "noexec", - "nodev", - "relatime", - "ro" - ] - } - ], - "linux": { - "resources": { - "devices": [ - { - "allow": false, - "access": "rwm" - } - ] - }, - "namespaces": [ - { - "type": "pid" - }, - { - "type": "network" - }, - { - "type": "ipc" - }, - { - "type": "uts" - }, - { - "type": "mount" - } - ], - "maskedPaths": [ - "/proc/acpi", - "/proc/asound", - "/proc/kcore", - "/proc/keys", - "/proc/latency_stats", - "/proc/timer_list", - "/proc/timer_stats", - "/proc/sched_debug", - "/sys/firmware", - "/proc/scsi" - ], - "readonlyPaths": [ - "/proc/bus", - "/proc/fs", - "/proc/irq", - "/proc/sys", - "/proc/sysrq-trigger" - ] - } -}"#; - -pub fn run(_opts: Spec, logger: &Logger) -> Result<()> { - // TODO: liboci-cli does not support --bundle option for spec command. - // After liboci-cli supports the option, we will change the following code. - // let config_path = get_config_path(&opts.bundle); - let config_path = Path::new(".").join(CONFIG_FILE_NAME); - let config_data = DEFAULT_SPEC; - - let mut file = File::create(config_path)?; - file.write_all(config_data.as_bytes())?; - - info!(&logger, "spec command finished successfully"); - - Ok(()) -} diff --git a/src/tools/runk/src/commands/start.rs b/src/tools/runk/src/commands/start.rs deleted file mode 100644 index 9d9f7f14ff..0000000000 --- a/src/tools/runk/src/commands/start.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2021-2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -use anyhow::Result; -use libcontainer::{container::ContainerAction, created_builder::CreatedContainerBuilder}; -use liboci_cli::Start; -use slog::{info, Logger}; -use std::path::Path; - -pub async fn run(opts: Start, root: &Path, logger: &Logger) -> Result<()> { - let mut launcher = CreatedContainerBuilder::default() - .id(opts.container_id) - .root(root.to_path_buf()) - .build()? - .create_launcher(logger)?; - - launcher.launch(ContainerAction::Start, logger).await?; - - info!(&logger, "start command finished successfully"); - - Ok(()) -} diff --git a/src/tools/runk/src/commands/state.rs b/src/tools/runk/src/commands/state.rs deleted file mode 100644 index 17509a3203..0000000000 --- a/src/tools/runk/src/commands/state.rs +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2021-2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -use anyhow::Result; -use chrono::{DateTime, Utc}; -use libcontainer::{container::Container, status::Status}; -use liboci_cli::State; -use runtime_spec::ContainerState; -use serde::{Deserialize, Serialize}; -use slog::{info, Logger}; -use std::path::{Path, PathBuf}; - -#[derive(Serialize, Deserialize, Debug)] -#[serde(rename_all = "camelCase")] -pub struct RuntimeState { - pub oci_version: String, - pub id: String, - pub pid: i32, - pub status: String, - pub bundle: PathBuf, - pub created: DateTime, -} - -impl RuntimeState { - pub fn new(status: Status, state: ContainerState) -> Self { - Self { - oci_version: status.oci_version, - id: status.id, - pid: status.pid, - status: get_container_state_name(state), - bundle: status.bundle, - created: status.created, - } - } -} - -pub fn run(opts: State, state_root: &Path, logger: &Logger) -> Result<()> { - let container = Container::load(state_root, &opts.container_id)?; - let oci_state = RuntimeState::new(container.status, container.state); - let json_state = &serde_json::to_string_pretty(&oci_state)?; - - println!("{}", json_state); - - info!(&logger, "state command finished successfully"); - - Ok(()) -} - -pub fn get_container_state_name(state: ContainerState) -> String { - match state { - ContainerState::Creating => "creating", - ContainerState::Created => "created", - ContainerState::Running => "running", - ContainerState::Stopped => "stopped", - ContainerState::Paused => "paused", - } - .into() -} - -#[cfg(test)] -mod tests { - use super::*; - use runtime_spec::ContainerState; - - #[test] - fn test_get_container_state_name() { - assert_eq!( - "creating", - get_container_state_name(ContainerState::Creating) - ); - assert_eq!("created", get_container_state_name(ContainerState::Created)); - assert_eq!("running", get_container_state_name(ContainerState::Running)); - assert_eq!("stopped", get_container_state_name(ContainerState::Stopped)); - assert_eq!("paused", get_container_state_name(ContainerState::Paused)); - } -} diff --git a/src/tools/runk/src/main.rs b/src/tools/runk/src/main.rs deleted file mode 100644 index 2e6e5220e4..0000000000 --- a/src/tools/runk/src/main.rs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright 2021-2022 Sony Group Corporation -// -// SPDX-License-Identifier: Apache-2.0 -// - -use anyhow::{anyhow, Result}; -use clap::{crate_description, crate_name, Parser}; -use liboci_cli::{CommonCmd, GlobalOpts}; -use liboci_cli::{Create, Delete, Kill, Start, State}; -use slog::{o, Logger}; -use slog_async::AsyncGuard; -use std::{ - fs::OpenOptions, - path::{Path, PathBuf}, - process::exit, -}; - -const DEFAULT_ROOT_DIR: &str = "/run/runk"; -const DEFAULT_LOG_LEVEL: slog::Level = slog::Level::Info; - -mod commands; - -#[derive(Parser, Debug)] -enum SubCommand { - #[clap(flatten)] - Standard(StandardCmd), - #[clap(flatten)] - Common(CommonCmd), - /// Launch an init process (do not call it outside of runk) - Init {}, -} - -// Copy from https://github.com/containers/youki/blob/v0.0.3/crates/liboci-cli/src/lib.rs#L38-L44 -#[derive(Parser, Debug)] -pub enum StandardCmd { - Create(Create), - Start(Start), - State(State), - Delete(Delete), - Kill(Kill), -} - -#[derive(Parser, Debug)] -#[clap(version, author, about = crate_description!())] -struct Cli { - #[clap(flatten)] - global: GlobalOpts, - #[clap(subcommand)] - subcmd: SubCommand, -} - -async fn cmd_run(subcmd: SubCommand, root_path: &Path, logger: &Logger) -> Result<()> { - match subcmd { - SubCommand::Standard(cmd) => match cmd { - StandardCmd::Create(create) => commands::create::run(create, root_path, logger).await, - StandardCmd::Start(start) => commands::start::run(start, root_path, logger).await, - StandardCmd::Delete(delete) => commands::delete::run(delete, root_path, logger).await, - StandardCmd::State(state) => commands::state::run(state, root_path, logger), - StandardCmd::Kill(kill) => commands::kill::run(kill, root_path, logger), - }, - SubCommand::Common(cmd) => match cmd { - CommonCmd::Run(run) => commands::run::run(run, root_path, logger).await, - CommonCmd::Spec(spec) => commands::spec::run(spec, logger), - CommonCmd::List(list) => commands::list::run(list, root_path, logger), - CommonCmd::Exec(exec) => commands::exec::run(exec, root_path, logger).await, - CommonCmd::Ps(ps) => commands::ps::run(ps, root_path, logger), - CommonCmd::Pause(pause) => commands::pause::run(pause, root_path, logger), - CommonCmd::Resume(resume) => commands::resume::run(resume, root_path, logger), - _ => Err(anyhow!("command is not implemented yet")), - }, - _ => unreachable!(), - } -} - -fn setup_logger( - log_file: Option, - log_level: slog::Level, -) -> Result<(Logger, Option)> { - if let Some(ref file) = log_file { - let log_writer = OpenOptions::new() - .write(true) - .read(true) - .create(true) - .truncate(true) - .open(file)?; - - // TODO: Support 'text' log format. - let (logger_local, logger_async_guard_local) = - logging::create_logger(crate_name!(), crate_name!(), log_level, log_writer); - - Ok((logger_local, Some(logger_async_guard_local))) - } else { - let logger = slog::Logger::root(slog::Discard, o!()); - Ok((logger, None)) - } -} - -async fn real_main() -> Result<()> { - let cli = Cli::parse(); - - if let SubCommand::Init {} = cli.subcmd { - rustjail::container::init_child(); - exit(0); - } - - let root_path = if let Some(path) = cli.global.root { - path - } else { - PathBuf::from(DEFAULT_ROOT_DIR) - }; - - let log_level = if cli.global.debug { - slog::Level::Debug - } else { - DEFAULT_LOG_LEVEL - }; - - let (logger, _async_guard) = setup_logger(cli.global.log, log_level)?; - - cmd_run(cli.subcmd, &root_path, &logger).await?; - - Ok(()) -} - -#[tokio::main] -async fn main() { - if let Err(e) = real_main().await { - eprintln!("ERROR: {}", e); - exit(1); - } - - exit(0); -} diff --git a/tests/README.md b/tests/README.md index 0d2f1b760f..f5379f14e3 100644 --- a/tests/README.md +++ b/tests/README.md @@ -14,7 +14,6 @@ and with different container managers. - [Docker](https://github.com/kata-containers/kata-containers/tree/main/tests/integration/docker) - [`Nerdctl`](https://github.com/kata-containers/kata-containers/tree/main/tests/integration/nerdctl) - [`Nydus`](https://github.com/kata-containers/kata-containers/tree/main/tests/integration/nydus) - - [`Runk`](https://github.com/kata-containers/kata-containers/tree/main/tests/integration/runk) 2. [Stability tests](https://github.com/kata-containers/kata-containers/tree/main/tests/stability) 3. [Metrics](https://github.com/kata-containers/kata-containers/tree/main/tests/metrics) 4. [Functional](https://github.com/kata-containers/kata-containers/tree/main/tests/functional) diff --git a/tests/integration/runk/gha-run.sh b/tests/integration/runk/gha-run.sh deleted file mode 100755 index 54f9780873..0000000000 --- a/tests/integration/runk/gha-run.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2023 Intel Corporation -# -# SPDX-License-Identifier: Apache-2.0 -# - -set -o errexit -set -o nounset -set -o pipefail - -kata_tarball_dir="${2:-kata-artifacts}" -runk_dir="$(dirname "$(readlink -f "$0")")" -source "${runk_dir}/../../common.bash" -source "${runk_dir}/../../gha-run-k8s-common.sh" - -function install_dependencies() { - info "Installing the dependencies needed for running the runk tests" - - # Dependency list of projects that we can rely on the system packages - # - jq - declare -a system_deps=( - jq - ) - - sudo apt-get update - sudo apt-get -y install "${system_deps[@]}" - - ensure_yq - - # Dependency list of projects that we can install them - # directly from their releases on GitHub: - # - containerd - # - cri-container-cni release tarball already includes CNI plugins - declare -a github_deps - github_deps[0]="cri_containerd:$(get_from_kata_deps ".externals.containerd.${CONTAINERD_VERSION}")" - github_deps[1]="runc:$(get_from_kata_deps ".externals.runc.latest")" - github_deps[2]="cni_plugins:$(get_from_kata_deps ".externals.cni-plugins.version")" - - for github_dep in "${github_deps[@]}"; do - IFS=":" read -r -a dep <<< "${github_dep}" - install_${dep[0]} "${dep[1]}" - done - - # Requires bats to run the tests - install_bats -} - -function run() { - info "Running runk tests using" - - bats "${runk_dir}/runk-tests.bats" -} - -function main() { - action="${1:-}" - case "${action}" in - install-dependencies) install_dependencies ;; - install-kata) install_kata ;; - run) run ;; - *) >&2 die "Invalid argument" ;; - esac -} - -main "$@" diff --git a/tests/integration/runk/runk-tests.bats b/tests/integration/runk/runk-tests.bats deleted file mode 100644 index 0a1faa18cc..0000000000 --- a/tests/integration/runk/runk-tests.bats +++ /dev/null @@ -1,127 +0,0 @@ -#!/usr/bin/env bats -# -# Copyright (c) 2023,2024 Kata Contributors -# -# SPDX-License-Identifier: Apache-2.0 -# -# This test will validate runk with containerd - -load "${BATS_TEST_DIRNAME}/../../common.bash" -load "${BATS_TEST_DIRNAME}/../../metrics/lib/common.bash" - -setup_file() { - export RUNK_BIN_PATH="/usr/local/bin/runk" - export TEST_IMAGE="quay.io/prometheus/busybox:latest" - export CONTAINER_ID="id1" - export PID_FILE="${CONTAINER_ID}.pid" - export WORK_DIR="${BATS_FILE_TMPDIR}" - - echo "pull container image" - check_images ${TEST_IMAGE} -} - -setup() { - # Bind mount ${WORK_DIR}:/tmp. Tests below will store files in this dir and check them when container is frozon. - sudo ctr run --pid-file ${PID_FILE} -d \ - --mount type=bind,src=${WORK_DIR},dst=/tmp,options=rbind:rw \ - --runc-binary ${RUNK_BIN_PATH} \ - ${TEST_IMAGE} \ - ${CONTAINER_ID} - read CID PID STATUS <<< $(sudo ctr t ls | grep ${CONTAINER_ID}) - # Check the pid is consistent - [ "${PID}" == "$(cat "${PID_FILE}")" ] - # Check the container status is RUNNING - [ "${STATUS}" == "RUNNING" ] -} - -teardown() { - echo "delete the container" - if sudo ctr t list -q | grep -q "${CONTAINER_ID}"; then - stop_container - fi - sudo ctr c rm "${CONTAINER_ID}" - sudo rm -f "${PID_FILE}" -} - -stop_container() { - local cmd - sudo ctr t kill --signal SIGKILL --all "${CONTAINER_ID}" - # poll for a while until the task receives signal and exit - cmd='[ "STOPPED" == "$(sudo ctr t ls | grep ${CONTAINER_ID} | awk "{print \$3}")" ]' - waitForProcess 10 1 "${cmd}" - - echo "check the container is stopped" - # there is only title line of ps command - [ "1" == "$(sudo ctr t ps ${CONTAINER_ID} | wc -l)" ] -} - -@test "start container with runk" { -} - -@test "exec process in a container" { - sudo ctr t exec --exec-id id1 "${CONTAINER_ID}" sh -c "echo hello > /tmp/foo" - # Check exec succeeded - [ "hello" == "$(sudo ctr t exec --exec-id id1 "${CONTAINER_ID}" cat /tmp/foo)" ] -} - -@test "run ps command" { - sudo ctr t exec --detach --exec-id id1 "${CONTAINER_ID}" sh - - return_code=$? - echo "ctr t exec sh return: ${return_code}" - - # Give some time for the sh process to start within the container. - sleep 5 - ps_out="$(sudo ctr t ps ${CONTAINER_ID})" || die "ps command failed" - printf "ps output:\n%s\n" "${ps_out}" - lines_no="$(printf "%s\n" "${ps_out}" | wc -l)" - echo "ps output lines: ${lines_no}" - # one line is the titles, and the other 2 lines are process info - [ "3" == "${lines_no}" ] -} - -@test "pause and resume the container" { - # The process outputs lines into /tmp/{CONTAINER_ID}, which can be read in host when it's frozon. - sudo ctr t exec --detach --exec-id id2 ${CONTAINER_ID} \ - sh -c "while true; do echo hello >> /tmp/${CONTAINER_ID}; sleep 0.1; done" - # sleep for 1s to make sure the process outputs some lines - sleep 1 - sudo ctr t pause "${CONTAINER_ID}" - # Check the status is PAUSED - [ "PAUSED" == "$(sudo ctr t ls | grep ${CONTAINER_ID} | grep -o PAUSED)" ] - echo "container is paused" - local TMP_FILE="${WORK_DIR}/${CONTAINER_ID}" - local lines1=$(cat ${TMP_FILE} | wc -l) - # sleep for a while and check the lines are not changed. - sleep 1 - local lines2=$(cat ${TMP_FILE} | wc -l) - # Check the paused container is not running the process (paused indeed) - [ ${lines1} == ${lines2} ] - sudo ctr t resume ${CONTAINER_ID} - # Check the resumed container has status of RUNNING - [ "RUNNING" == "$(sudo ctr t ls | grep ${CONTAINER_ID} | grep -o RUNNING)" ] - echo "container is resumed" - # sleep for a while and check the lines are changed. - sleep 1 - local lines3=$(cat ${TMP_FILE} | wc -l) - # Check the process is running again - [ ${lines2} -lt ${lines3} ] -} - -@test "kill the container and poll until it is stopped" { - stop_container -} - -@test "kill --all is allowed regardless of the container state" { - # High-level container runtimes such as containerd call the kill command with - # --all option in order to terminate all processes inside the container - # even if the container already is stopped. Hence, a low-level runtime - # should allow kill --all regardless of the container state like runc. - echo "test kill --all is allowed regardless of the container state" - # Check kill should fail because the container is paused - stop_container - run sudo ctr t kill --signal SIGKILL ${CONTAINER_ID} - [ $status -eq 1 ] - # Check kill --all should not fail - sudo ctr t kill --signal SIGKILL --all "${CONTAINER_ID}" -} diff --git a/tools/packaging/kata-deploy/local-build/Makefile b/tools/packaging/kata-deploy/local-build/Makefile index 79bb4b6656..35fdde389d 100644 --- a/tools/packaging/kata-deploy/local-build/Makefile +++ b/tools/packaging/kata-deploy/local-build/Makefile @@ -199,8 +199,6 @@ rootfs-initrd-confidential-tarball: agent-tarball pause-image-tarball coco-guest rootfs-initrd-tarball: agent-tarball ${MAKE} $@-build -runk-tarball: copy-scripts-for-the-tools-build - ${MAKE} $@-build rootfs-image-nvidia-gpu-tarball: agent-tarball busybox-tarball kernel-nvidia-gpu-tarball ${MAKE} $@-build diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh index 23549ea646..189c0922a7 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh @@ -135,7 +135,6 @@ options: rootfs-image-mariner rootfs-initrd rootfs-initrd-confidential - runk shim-v2 trace-forwarder virtiofsd @@ -1277,10 +1276,6 @@ install_kata_manager() { install_script_helper "kata-manager.sh" } -install_runk() { - install_tools_helper "runk" -} - install_trace_forwarder() { install_tools_helper "trace-forwarder" } @@ -1329,7 +1324,6 @@ handle_build() { install_qemu_snp_experimental install_qemu_tdx_experimental install_stratovirt - install_runk install_shimv2 install_trace_forwarder install_virtiofsd @@ -1417,8 +1411,6 @@ handle_build() { rootfs-cca-confidential-initrd) install_initrd_confidential ;; - runk) install_runk ;; - shim-v2) install_shimv2 ;; trace-forwarder) install_trace_forwarder ;; @@ -1582,7 +1574,6 @@ main() { rootfs-initrd rootfs-initrd-confidential rootfs-initrd-mariner - runk shim-v2 trace-forwarder virtiofsd