diff --git a/Makefile b/Makefile index 8afdee2f7c..5e3695dd7e 100644 --- a/Makefile +++ b/Makefile @@ -8,12 +8,12 @@ COMPONENTS = COMPONENTS += agent COMPONENTS += runtime -COMPONENTS += trace-forwarder # List of available tools TOOLS = TOOLS += agent-ctl +TOOLS += trace-forwarder STANDARD_TARGETS = build check clean install test vendor @@ -22,7 +22,7 @@ default: all all: logging-crate-tests build logging-crate-tests: - make -C pkg/logging + make -C src/libs/logging include utils.mk include ./tools/packaging/kata-deploy/local-build/Makefile diff --git a/README.md b/README.md index 7f57462608..e93c5f7400 100644 --- a/README.md +++ b/README.md @@ -70,8 +70,8 @@ The table below lists the remaining parts of the project: | [packaging](tools/packaging) | infrastructure | Scripts and metadata for producing packaged binaries<br/>(components, hypervisors, kernel and rootfs). | | [kernel](https://www.kernel.org) | kernel | Linux kernel used by the hypervisor to boot the guest image. Patches are stored [here](tools/packaging/kernel). | | [osbuilder](tools/osbuilder) | infrastructure | Tool to create "mini O/S" rootfs and initrd images and kernel for the hypervisor. | -| [`agent-ctl`](tools/agent-ctl) | utility | Tool that provides low-level access for testing the agent. | -| [`trace-forwarder`](src/trace-forwarder) | utility | Agent tracing helper. | +| [`agent-ctl`](src/tools/agent-ctl) | utility | Tool that provides low-level access for testing the agent. | +| [`trace-forwarder`](src/tools/trace-forwarder) | utility | Agent tracing helper. | | [`ci`](https://github.com/kata-containers/ci) | CI | Continuous Integration configuration files and scripts. | | [`katacontainers.io`](https://github.com/kata-containers/www.katacontainers.io) | Source for the [`katacontainers.io`](https://www.katacontainers.io) site. | diff --git a/docs/design/proposals/tracing-proposals.md b/docs/design/proposals/tracing-proposals.md index 0853ffa21a..78acee8166 100644 --- a/docs/design/proposals/tracing-proposals.md +++ b/docs/design/proposals/tracing-proposals.md @@ -209,5 +209,5 @@ network accessible to the collector. - The trace collection proposals are still being considered. [kata-1x-tracing]: https://github.com/kata-containers/agent/blob/master/TRACING.md -[trace-forwarder]: /src/trace-forwarder +[trace-forwarder]: /src/tools/trace-forwarder [tracing-doc-pr]: https://github.com/kata-containers/kata-containers/pull/1937 diff --git a/docs/tracing.md b/docs/tracing.md index 184bedfb4d..5ddbf0fcb1 100644 --- a/docs/tracing.md +++ b/docs/tracing.md @@ -203,12 +203,11 @@ is highly recommended. For working with the agent, you may also wish to [enable a debug console][setup-debug-console] to allow you to access the VM environment. -[agent-ctl]: https://github.com/kata-containers/kata-containers/blob/main/tools/agent-ctl [enable-full-debug]: https://github.com/kata-containers/kata-containers/blob/main/docs/Developer-Guide.md#enable-full-debug [jaeger-all-in-one]: https://www.jaegertracing.io/docs/getting-started/ [jaeger-tracing]: https://www.jaegertracing.io [opentelemetry]: https://opentelemetry.io [osbuilder]: https://github.com/kata-containers/kata-containers/blob/main/tools/osbuilder [setup-debug-console]: https://github.com/kata-containers/kata-containers/blob/main/docs/Developer-Guide.md#set-up-a-debug-console -[trace-forwarder]: https://github.com/kata-containers/kata-containers/blob/main/src/trace-forwarder +[trace-forwarder]: /src/tools/trace-forwarder [vsock]: https://wiki.qemu.org/Features/VirtioVsock diff --git a/src/agent/Cargo.toml b/src/agent/Cargo.toml index d0492012ec..9957945f2a 100644 --- a/src/agent/Cargo.toml +++ b/src/agent/Cargo.toml @@ -37,7 +37,7 @@ ipnetwork = "0.17.0" # Note: this crate sets the slog 'max_*' features which allows the log level # to be modified at runtime. -logging = { path = "../../pkg/logging" } +logging = { path = "../libs/logging" } slog = "2.5.2" slog-scope = "4.1.2" diff --git a/src/agent/Makefile b/src/agent/Makefile index bd647d448e..d6e7047bca 100644 --- a/src/agent/Makefile +++ b/src/agent/Makefile @@ -104,7 +104,7 @@ default: $(TARGET) show-header $(TARGET): $(GENERATED_CODE) logging-crate-tests $(TARGET_PATH) logging-crate-tests: - make -C $(CWD)/../../pkg/logging + make -C $(CWD)/../libs/logging $(TARGET_PATH): $(SOURCES) | show-summary @RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) --$(BUILD_TYPE) $(EXTRA_RUSTFEATURES) diff --git a/src/agent/README.md b/src/agent/README.md index 8f839370d9..98ec59bbdf 100644 --- a/src/agent/README.md +++ b/src/agent/README.md @@ -97,7 +97,7 @@ these custom assets to allow you to test your changes. ## Tracing For details of tracing the operation of the agent, see the -[tracing documentation](../../docs/tracing.md). +[tracing documentation](/docs/tracing.md). ## Run the agent stand alone @@ -108,4 +108,4 @@ When run in this way, the agent can be controlled using the low-level Kata agent control tool, rather than the Kata runtime. For further details, see the -[agent control tool documentation](../../tools/agent-ctl/README.md#run-the-tool-and-the-agent-in-the-same-environment). +[agent control tool documentation](../tools/agent-ctl/README.md#run-the-tool-and-the-agent-in-the-same-environment). diff --git a/src/libs/logging/Cargo.lock b/src/libs/logging/Cargo.lock new file mode 100644 index 0000000000..4c7d677943 --- /dev/null +++ b/src/libs/logging/Cargo.lock @@ -0,0 +1,319 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "arc-swap" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5d78ce20460b82d3fa150275ed9d55e21064fc7951177baacf86a145c4a4b1f" + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits", + "time", + "winapi", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" +dependencies = [ + "cfg-if", + "lazy_static", +] + +[[package]] +name = "getrandom" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98a04dce437184842841303488f70d0188c5f51437d2a834dc097eafa909a01" + +[[package]] +name = "logging" +version = "0.1.0" +dependencies = [ + "serde_json", + "slog", + "slog-async", + "slog-json", + "slog-scope", + "tempfile", +] + +[[package]] +name = "num-integer" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" + +[[package]] +name = "ppv-lite86" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" + +[[package]] +name = "rand" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", + "rand_hc", +] + +[[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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_hc" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +dependencies = [ + "rand_core", +] + +[[package]] +name = "redox_syscall" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +dependencies = [ + "bitflags", +] + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "ryu" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c9613b5a66ab9ba26415184cfc41156594925a9cf3a2057e57f31ff145f6568" + +[[package]] +name = "serde" +version = "1.0.131" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ad69dfbd3e45369132cc64e6748c2d65cdfb001a2b1c232d128b4ad60561c1" + +[[package]] +name = "serde_json" +version = "1.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0ffa0837f2dfa6fb90868c2b5468cad482e175f7dad97e7421951e663f2b527" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[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.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "766c59b252e62a34651412870ff55d8c4e6d04df19b43eecb2703e417b097ffe" +dependencies = [ + "crossbeam-channel", + "slog", + "take_mut", + "thread_local", +] + +[[package]] +name = "slog-json" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e9b96fb6b5e80e371423b4aca6656eb537661ce8f82c2697e619f8ca85d043" +dependencies = [ + "chrono", + "serde", + "serde_json", + "slog", +] + +[[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 = "take_mut" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" + +[[package]] +name = "tempfile" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +dependencies = [ + "cfg-if", + "libc", + "rand", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "thread_local" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" +dependencies = [ + "once_cell", +] + +[[package]] +name = "time" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + +[[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" diff --git a/pkg/logging/Cargo.toml b/src/libs/logging/Cargo.toml similarity index 100% rename from pkg/logging/Cargo.toml rename to src/libs/logging/Cargo.toml diff --git a/pkg/logging/Makefile b/src/libs/logging/Makefile similarity index 100% rename from pkg/logging/Makefile rename to src/libs/logging/Makefile diff --git a/pkg/logging/src/lib.rs b/src/libs/logging/src/lib.rs similarity index 100% rename from pkg/logging/src/lib.rs rename to src/libs/logging/src/lib.rs diff --git a/src/tools/agent-ctl/.gitignore b/src/tools/agent-ctl/.gitignore new file mode 100644 index 0000000000..57872d0f1e --- /dev/null +++ b/src/tools/agent-ctl/.gitignore @@ -0,0 +1 @@ +/vendor/ diff --git a/tools/agent-ctl/Cargo.lock b/src/tools/agent-ctl/Cargo.lock similarity index 94% rename from tools/agent-ctl/Cargo.lock rename to src/tools/agent-ctl/Cargo.lock index 0872669aa5..1c39cd18b5 100644 --- a/tools/agent-ctl/Cargo.lock +++ b/src/tools/agent-ctl/Cargo.lock @@ -83,7 +83,7 @@ checksum = "321629d8ba6513061f26707241fa9bc89524ff1cd7a915a97ef0c62c666ce1b6" dependencies = [ "addr2line", "cc", - "cfg-if", + "cfg-if 1.0.0", "libc", "miniz_oxide", "object", @@ -92,9 +92,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "byteorder" @@ -145,6 +145,12 @@ version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + [[package]] name = "cfg-if" version = "1.0.0" @@ -153,13 +159,13 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cgroups-rs" -version = "0.2.7" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31dc7b58f8b80f0e02202df9fe45fd7432572d8868bab0abcb888656833aeaba" +checksum = "5c5c9f6e5c72958dc962baa5f8bb37fb611017854b0d774b8adab4d7416ab445" dependencies = [ "libc", "log", - "nix 0.20.2", + "nix 0.20.0", "regex", ] @@ -197,7 +203,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "crossbeam-utils", ] @@ -207,7 +213,7 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "lazy_static", ] @@ -359,7 +365,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -370,7 +376,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "wasi 0.10.2+wasi-snapshot-preview1", ] @@ -469,7 +475,7 @@ dependencies = [ "lazy_static", "libc", "logging", - "nix 0.21.2", + "nix 0.21.0", "oci", "protobuf", "protocols", @@ -500,7 +506,7 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -569,39 +575,63 @@ checksum = "2eb04b9f127583ed176e163fb9ec6f3e793b87e21deedd5734a69386a18a0151" [[package]] name = "nix" -version = "0.20.2" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5e06129fb611568ef4e868c14b326274959aa70ff7776e9d55323531c374945" +checksum = "dd0eaf8df8bab402257e0a5c17a254e4cc1f72a93588a1ddfb5d356c801aa7cb" dependencies = [ "bitflags", "cc", - "cfg-if", + "cfg-if 0.1.10", + "libc", + "void", +] + +[[package]] +name = "nix" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ccba0cfe4fdf15982d1674c69b1fd80bad427d293849982668dfe454bd61f2" +dependencies = [ + "bitflags", + "cc", + "cfg-if 1.0.0", + "libc", +] + +[[package]] +name = "nix" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a" +dependencies = [ + "bitflags", + "cc", + "cfg-if 1.0.0", + "libc", +] + +[[package]] +name = "nix" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3728fec49d363a50a8828a190b379a446cc5cf085c06259bbbeb34447e4ec7" +dependencies = [ + "bitflags", + "cc", + "cfg-if 1.0.0", "libc", "memoffset", ] [[package]] name = "nix" -version = "0.21.2" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77d9f3521ea8e0641a153b3cddaf008dcbf26acd4ed739a2517295e0760d12c7" +checksum = "f305c2c2e4c39a82f7bf0bf65fb557f9070ce06781d4f2454295cc34b1c43188" dependencies = [ "bitflags", "cc", - "cfg-if", - "libc", - "memoffset", -] - -[[package]] -name = "nix" -version = "0.22.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3bb9a13fa32bc5aeb64150cd3f32d6cf4c748f8f8a417cce5d2eb976a8370ba" -dependencies = [ - "bitflags", - "cc", - "cfg-if", + "cfg-if 1.0.0", "libc", "memoffset", ] @@ -978,7 +1008,7 @@ dependencies = [ "inotify", "lazy_static", "libc", - "nix 0.21.2", + "nix 0.23.0", "oci", "path-absolutize", "protobuf", @@ -1149,7 +1179,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "rand 0.8.4", "redox_syscall", @@ -1249,16 +1279,16 @@ dependencies = [ [[package]] name = "ttrpc" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66a973ce6d5eaa20c173635b29ffb660dafbc7ef109172c0015ba44e47a23711" +checksum = "004604e91de38bc16cb9c7898187343075388ea414ad24896a21fc4e91a7c861" dependencies = [ "async-trait", "byteorder", "futures", "libc", "log", - "nix 0.20.2", + "nix 0.16.1", "protobuf", "protobuf-codegen-pure", "thiserror", @@ -1324,13 +1354,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] -name = "vsock" -version = "0.2.5" +name = "void" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a10cd0a332ca79e7bbde3299ca161ef2860dc72ba0c443b20356c23d48687c99" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "vsock" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c932be691560e8f3f7b2be5a47df1b8f45387e1d1df40d45b2e62284b9e9150e" dependencies = [ "libc", - "nix 0.22.2", + "nix 0.19.1", ] [[package]] diff --git a/tools/agent-ctl/Cargo.toml b/src/tools/agent-ctl/Cargo.toml similarity index 79% rename from tools/agent-ctl/Cargo.toml rename to src/tools/agent-ctl/Cargo.toml index e6bd1727ae..a6fdb2b1de 100644 --- a/tools/agent-ctl/Cargo.toml +++ b/src/tools/agent-ctl/Cargo.toml @@ -10,9 +10,9 @@ authors = ["The Kata Containers community <kata-dev@lists.katacontainers.io>"] edition = "2018" [dependencies] -protocols = { path = "../../src/agent/protocols", features = ["with-serde"] } -rustjail = { path = "../../src/agent/rustjail" } -oci = { path = "../../src/agent/oci" } +protocols = { path = "../../agent/protocols", features = ["with-serde"] } +rustjail = { path = "../../agent/rustjail" } +oci = { path = "../../agent/oci" } clap = "2.33.0" lazy_static = "1.4.0" @@ -22,7 +22,7 @@ byteorder = "1.3.4" # Note: this crate sets the slog 'max_*' features which allows the log level # to be modified at runtime. -logging = { path = "../../pkg/logging" } +logging = { path = "../../libs/logging" } slog = "2.5.2" slog-scope = "4.3.0" rand = "0.7.3" diff --git a/tools/agent-ctl/Makefile b/src/tools/agent-ctl/Makefile similarity index 88% rename from tools/agent-ctl/Makefile rename to src/tools/agent-ctl/Makefile index ff115a305e..1cb20e1d7a 100644 --- a/tools/agent-ctl/Makefile +++ b/src/tools/agent-ctl/Makefile @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # -include ../../utils.mk +include ../../../utils.mk default: build @@ -11,7 +11,7 @@ build: logging-crate-tests @RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) --$(BUILD_TYPE) logging-crate-tests: - make -C $(CWD)/../../pkg/logging + make -C $(CWD)/../../libs/logging clean: cargo clean diff --git a/tools/agent-ctl/README.md b/src/tools/agent-ctl/README.md similarity index 96% rename from tools/agent-ctl/README.md rename to src/tools/agent-ctl/README.md index fa2caf99dc..a351255cfa 100644 --- a/tools/agent-ctl/README.md +++ b/src/tools/agent-ctl/README.md @@ -41,9 +41,9 @@ the agent protocol and the client and server implementations. | Description | File | Example RPC or function | Example summary | |-|-|-|-| -| Protocol buffers definition of the Kata Containers Agent API protocol | [`agent.proto`](../../src/agent/protocols/protos/agent.proto) | `CreateContainer` | API to create a Kata container. | +| Protocol buffers definition of the Kata Containers Agent API protocol | [`agent.proto`](../../agent/protocols/protos/agent.proto) | `CreateContainer` | API to create a Kata container. | | Agent Control (client) API calls | [`src/client.rs`](src/client.rs) | `agent_cmd_container_create()` | Agent Control tool function that calls the `CreateContainer` API. | -| Agent (server) API implementations | [`rpc.rs`](../../src/agent/src/rpc.rs) | `create_container()` | Server function that implements the `CreateContainers` API. | +| Agent (server) API implementations | [`rpc.rs`](../../agent/src/rpc.rs) | `create_container()` | Server function that implements the `CreateContainers` API. | ## Run the tool diff --git a/tools/agent-ctl/src/client.rs b/src/tools/agent-ctl/src/client.rs similarity index 100% rename from tools/agent-ctl/src/client.rs rename to src/tools/agent-ctl/src/client.rs diff --git a/tools/agent-ctl/src/main.rs b/src/tools/agent-ctl/src/main.rs similarity index 100% rename from tools/agent-ctl/src/main.rs rename to src/tools/agent-ctl/src/main.rs diff --git a/tools/agent-ctl/src/rpc.rs b/src/tools/agent-ctl/src/rpc.rs similarity index 100% rename from tools/agent-ctl/src/rpc.rs rename to src/tools/agent-ctl/src/rpc.rs diff --git a/tools/agent-ctl/src/types.rs b/src/tools/agent-ctl/src/types.rs similarity index 100% rename from tools/agent-ctl/src/types.rs rename to src/tools/agent-ctl/src/types.rs diff --git a/tools/agent-ctl/src/utils.rs b/src/tools/agent-ctl/src/utils.rs similarity index 100% rename from tools/agent-ctl/src/utils.rs rename to src/tools/agent-ctl/src/utils.rs diff --git a/src/tools/trace-forwarder/.gitignore b/src/tools/trace-forwarder/.gitignore new file mode 100644 index 0000000000..57872d0f1e --- /dev/null +++ b/src/tools/trace-forwarder/.gitignore @@ -0,0 +1 @@ +/vendor/ diff --git a/src/trace-forwarder/Cargo.lock b/src/tools/trace-forwarder/Cargo.lock similarity index 100% rename from src/trace-forwarder/Cargo.lock rename to src/tools/trace-forwarder/Cargo.lock diff --git a/src/trace-forwarder/Cargo.toml b/src/tools/trace-forwarder/Cargo.toml similarity index 95% rename from src/trace-forwarder/Cargo.toml rename to src/tools/trace-forwarder/Cargo.toml index d2cfe8af74..846acfebd7 100644 --- a/src/trace-forwarder/Cargo.toml +++ b/src/tools/trace-forwarder/Cargo.toml @@ -29,7 +29,7 @@ tracing-subscriber = "0.2.18" # Note: this crate sets the slog 'max_*' features which allows the log level # to be modified at runtime. -logging = { path = "../../pkg/logging" } +logging = { path = "../../libs/logging" } slog = "2.5.2" privdrop = "0.5.1" diff --git a/src/trace-forwarder/Makefile b/src/tools/trace-forwarder/Makefile similarity index 87% rename from src/trace-forwarder/Makefile rename to src/tools/trace-forwarder/Makefile index b0e1e41f4f..06530faceb 100644 --- a/src/trace-forwarder/Makefile +++ b/src/tools/trace-forwarder/Makefile @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # -include ../../utils.mk +include ../../../utils.mk default: build @@ -11,7 +11,7 @@ build: logging-crate-tests @RUSTFLAGS="$(EXTRA_RUSTFLAGS) --deny warnings" cargo build --target $(TRIPLE) --$(BUILD_TYPE) logging-crate-tests: - make -C $(CWD)/../../pkg/logging + make -C $(CWD)/../../libs/logging clean: cargo clean diff --git a/src/trace-forwarder/README.md b/src/tools/trace-forwarder/README.md similarity index 99% rename from src/trace-forwarder/README.md rename to src/tools/trace-forwarder/README.md index 8099b7beab..e6efa28615 100644 --- a/src/trace-forwarder/README.md +++ b/src/tools/trace-forwarder/README.md @@ -152,7 +152,7 @@ For further information on how to run the trace forwarder, run: $ cargo run -- --help ``` -[agent-tracing]: ../../docs/tracing.md +[agent-tracing]: /docs/tracing.md [jaeger-tracing]: https://www.jaegertracing.io [opentelemetry]: https://opentelemetry.io [vsock]: https://wiki.qemu.org/Features/VirtioVsock diff --git a/src/trace-forwarder/src/handler.rs b/src/tools/trace-forwarder/src/handler.rs similarity index 100% rename from src/trace-forwarder/src/handler.rs rename to src/tools/trace-forwarder/src/handler.rs diff --git a/src/trace-forwarder/src/main.rs b/src/tools/trace-forwarder/src/main.rs similarity index 100% rename from src/trace-forwarder/src/main.rs rename to src/tools/trace-forwarder/src/main.rs diff --git a/src/trace-forwarder/src/server.rs b/src/tools/trace-forwarder/src/server.rs similarity index 100% rename from src/trace-forwarder/src/server.rs rename to src/tools/trace-forwarder/src/server.rs diff --git a/src/trace-forwarder/src/tracer.rs b/src/tools/trace-forwarder/src/tracer.rs similarity index 100% rename from src/trace-forwarder/src/tracer.rs rename to src/tools/trace-forwarder/src/tracer.rs diff --git a/src/trace-forwarder/src/utils.rs b/src/tools/trace-forwarder/src/utils.rs similarity index 100% rename from src/trace-forwarder/src/utils.rs rename to src/tools/trace-forwarder/src/utils.rs diff --git a/utils.mk b/utils.mk index 0b4af421b5..dbfefb5a21 100644 --- a/utils.mk +++ b/utils.mk @@ -64,7 +64,7 @@ endef # $1 - name of tool define make_tool_rules -$(eval $(call make_rules,tools,$(1))) +$(eval $(call make_rules,src/tools,$(1))) endef # Create a "${target}-all" alias which will cause each component/tool