Skip to content

Commit

Permalink
Merge pull request #19 from kate-goldenring/disable-logging
Browse files Browse the repository at this point in the history
fix(logging): disable logging in shim to improve performance
  • Loading branch information
Mossaka committed Feb 26, 2024
2 parents 1db14d4 + 518dc6b commit 6d1afaa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions containerd-shim-spin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
16 changes: 15 additions & 1 deletion containerd-shim-spin/src/main.rs
Original file line number Diff line number Diff line change
@@ -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::<Instance<engine::SpinEngine>>("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::<Instance<engine::SpinEngine>>(
"spin",
version!(),
revision!(),
"v2",
Some(shim_config),
);
}

0 comments on commit 6d1afaa

Please sign in to comment.