Skip to content

Commit

Permalink
Add an auto-detect plugins mechanism for the Wasmedge shim
Browse files Browse the repository at this point in the history
Signed-off-by: vincent <[email protected]>
  • Loading branch information
CaptainVincent committed Sep 20, 2023
1 parent df35a38 commit 8efdf4d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions crates/containerd-shim-wasmedge/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,8 @@ pub struct WasmEdgeEngine {

impl Default for WasmEdgeEngine {
fn default() -> Self {
PluginManager::load(None).unwrap();

let host_options = HostRegistrationConfigOptions::default();
let host_options = host_options.wasi(true);
#[cfg(all(target_os = "linux", feature = "wasi_nn", target_arch = "x86_64"))]
let host_options = host_options.wasi_nn(true);

let config = ConfigBuilder::default()
.with_host_registration_config(host_options)
.build()
Expand Down Expand Up @@ -59,6 +54,8 @@ impl Engine for WasmEdgeEngine {
None => "main".to_string(),
};

PluginManager::load(None)?;
let vm = vm.auto_detect_plugins()?;
let vm = vm
.register_module_from_file(&mod_name, &path)
.context("registering module")?;
Expand Down

0 comments on commit 8efdf4d

Please sign in to comment.