Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(logging): disable logging in shim to improve performance #19

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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),
);
}
Loading