diff --git a/Cargo.lock b/Cargo.lock index 5084e9dd..359013e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1315,6 +1315,7 @@ name = "containerd-shim-spin-v2" version = "0.10.0" dependencies = [ "anyhow", + "containerd-shim", "containerd-shim-wasm", "log", "oci-spec", diff --git a/containerd-shim-spin/Cargo.toml b/containerd-shim-spin/Cargo.toml index 8e661282..7034aa29 100644 --- a/containerd-shim-spin/Cargo.toml +++ b/containerd-shim-spin/Cargo.toml @@ -12,6 +12,7 @@ Containerd shim for running Spin workloads. [dependencies] containerd-shim-wasm = { git = "https://github.com/containerd/runwasi", rev = "c768e5b0919ca02903a301bf82a390489437dabe" } +containerd-shim = "0.6.0" log = "0.4" spin-app = { git = "https://github.com/fermyon/spin", tag = "v2.2.0" } spin-core = { git = "https://github.com/fermyon/spin", tag = "v2.2.0" } diff --git a/containerd-shim-spin/src/main.rs b/containerd-shim-spin/src/main.rs index 6312c41f..b7b5e654 100644 --- a/containerd-shim-spin/src/main.rs +++ b/containerd-shim-spin/src/main.rs @@ -1,8 +1,22 @@ +use containerd_shim::Config; use containerd_shim_wasm::container::Instance; use containerd_shim_wasm::sandbox::cli::{revision, shim_main, version}; mod engine; fn main() { - shim_main::>("spin", version!(), revision!(), "v2", None); + // Configure the shim to disable all logging for performance improvements. + // TODO: consider supporting some logging once log level specification is + // supported in https://github.com/containerd/rust-extensions/pull/247 + let shim_config = Config { + no_setup_logger: true, + ..Default::default() + }; + shim_main::>( + "spin", + version!(), + revision!(), + "v2", + Some(shim_config), + ); }