Skip to content

Commit

Permalink
Componentize Spin wasm component if needed before precompilation
Browse files Browse the repository at this point in the history
Signed-off-by: Radu Matei <[email protected]>
  • Loading branch information
radu-matei committed Feb 21, 2024
1 parent 330d522 commit 329dd4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions containerd-shim-spin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ containerd-shim-wasm = { path = "../../../containerd/runwasi/crates/containerd-s
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" }
spin-componentize = { git = "https://github.com/fermyon/spin", tag = "v2.2.0" }
spin-componentize = { git = "https://github.com/fermyon/spin-componentize", rev = "191789170abde10cd55590466c0660dd6c7d472a" }
spin-trigger = { git = "https://github.com/fermyon/spin", tag = "v2.2.0" }
spin-trigger-http = { git = "https://github.com/fermyon/spin", tag = "v2.2.0" }
spin-redis-engine = { git = "https://github.com/fermyon/spin", tag = "v2.2.0" }
Expand Down
3 changes: 2 additions & 1 deletion containerd-shim-spin/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,8 @@ impl Engine for SpinEngine {
match layer.config.media_type() {
MediaType::Other(name) => {
if name == "application/vnd.wasm.content.layer.v1+wasm" {
Some(self.wasmtime_engine.precompile_module(&layer.layer))
let component = spin_componentize::componentize_if_necessary(&layer.layer)?;
Some(self.wasmtime_engine.precompile_module(&component))
} else {
None
}
Expand Down

0 comments on commit 329dd4b

Please sign in to comment.