diff --git a/Cargo.lock b/Cargo.lock index c0524dca10..0d43fc11c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7122,8 +7122,8 @@ dependencies = [ "spin-key-value-redis", "spin-key-value-spin", "spin-locked-app", + "spin-resource-table", "spin-world", - "table", "tempfile", "tokio", "toml 0.8.19", @@ -7186,8 +7186,8 @@ dependencies = [ "spin-factor-variables", "spin-factors", "spin-factors-test", + "spin-resource-table", "spin-world", - "table", "tokio", "tracing", ] @@ -7207,8 +7207,8 @@ dependencies = [ "spin-factor-variables", "spin-factors", "spin-factors-test", + "spin-resource-table", "spin-world", - "table", "tokio", "tracing", "url", @@ -7257,8 +7257,8 @@ dependencies = [ "spin-factor-variables", "spin-factors", "spin-factors-test", + "spin-resource-table", "spin-world", - "table", "tokio", "tokio-postgres", "tracing", @@ -7275,8 +7275,8 @@ dependencies = [ "spin-factor-variables", "spin-factors", "spin-factors-test", + "spin-resource-table", "spin-world", - "table", "tokio", "tracing", ] @@ -7290,8 +7290,8 @@ dependencies = [ "spin-factors", "spin-factors-test", "spin-locked-app", + "spin-resource-table", "spin-world", - "table", "tokio", "toml 0.8.19", "tracing", @@ -7605,6 +7605,10 @@ dependencies = [ "url", ] +[[package]] +name = "spin-resource-table" +version = "2.8.0-pre0" + [[package]] name = "spin-runtime-config" version = "2.8.0-pre0" @@ -7682,10 +7686,10 @@ dependencies = [ "spin-factor-sqlite", "spin-factors", "spin-locked-app", + "spin-resource-table", "spin-sqlite-inproc", "spin-sqlite-libsql", "spin-world", - "table", "tokio", "toml 0.8.19", ] @@ -8124,10 +8128,6 @@ dependencies = [ "winx", ] -[[package]] -name = "table" -version = "2.8.0-pre0" - [[package]] name = "tar" version = "0.4.41" diff --git a/crates/factor-key-value/Cargo.toml b/crates/factor-key-value/Cargo.toml index 5f12662f84..1d103ec294 100644 --- a/crates/factor-key-value/Cargo.toml +++ b/crates/factor-key-value/Cargo.toml @@ -11,8 +11,8 @@ serde = { workspace = true } spin-core = { path = "../core" } spin-factors = { path = "../factors" } spin-locked-app = { path = "../locked-app" } +spin-resource-table = { path = "../table" } spin-world = { path = "../world" } -table = { path = "../table" } tokio = { workspace = true, features = ["macros", "sync", "rt"] } toml = { workspace = true } tracing = { workspace = true } diff --git a/crates/factor-key-value/src/host.rs b/crates/factor-key-value/src/host.rs index 7cc76a04b3..0ec58886ef 100644 --- a/crates/factor-key-value/src/host.rs +++ b/crates/factor-key-value/src/host.rs @@ -1,8 +1,8 @@ use anyhow::{Context, Result}; use spin_core::{async_trait, wasmtime::component::Resource}; +use spin_resource_table::Table; use spin_world::v2::key_value; use std::{collections::HashSet, sync::Arc}; -use table::Table; use tracing::{instrument, Level}; const DEFAULT_STORE_TABLE_CAPACITY: u32 = 256; diff --git a/crates/factor-outbound-mqtt/Cargo.toml b/crates/factor-outbound-mqtt/Cargo.toml index 6f8700c1ee..bd5222881c 100644 --- a/crates/factor-outbound-mqtt/Cargo.toml +++ b/crates/factor-outbound-mqtt/Cargo.toml @@ -10,8 +10,8 @@ rumqttc = { version = "0.24", features = ["url"] } spin-core = { path = "../core" } spin-factor-outbound-networking = { path = "../factor-outbound-networking" } spin-factors = { path = "../factors" } +spin-resource-table = { path = "../table" } spin-world = { path = "../world" } -table = { path = "../table" } tokio = { workspace = true, features = ["sync"] } tracing = { workspace = true } diff --git a/crates/factor-outbound-mqtt/src/host.rs b/crates/factor-outbound-mqtt/src/host.rs index ae3ca11181..688f3f7d4e 100644 --- a/crates/factor-outbound-mqtt/src/host.rs +++ b/crates/factor-outbound-mqtt/src/host.rs @@ -10,7 +10,7 @@ use crate::ClientCreator; pub struct InstanceState { allowed_hosts: OutboundAllowedHosts, - connections: table::Table>, + connections: spin_resource_table::Table>, create_client: Arc, } @@ -19,7 +19,7 @@ impl InstanceState { Self { allowed_hosts, create_client, - connections: table::Table::new(1024), + connections: spin_resource_table::Table::new(1024), } } } diff --git a/crates/factor-outbound-mysql/Cargo.toml b/crates/factor-outbound-mysql/Cargo.toml index 6281abeec5..5acd07d976 100644 --- a/crates/factor-outbound-mysql/Cargo.toml +++ b/crates/factor-outbound-mysql/Cargo.toml @@ -21,8 +21,8 @@ spin-core = { path = "../core" } spin-expressions = { path = "../expressions" } spin-factor-outbound-networking = { path = "../factor-outbound-networking" } spin-factors = { path = "../factors" } +spin-resource-table = { path = "../table" } spin-world = { path = "../world" } -table = { path = "../table" } tokio = { workspace = true, features = ["rt-multi-thread"] } tracing = { workspace = true } url = { workspace = true } diff --git a/crates/factor-outbound-mysql/src/lib.rs b/crates/factor-outbound-mysql/src/lib.rs index c955a78402..e666fff56c 100644 --- a/crates/factor-outbound-mysql/src/lib.rs +++ b/crates/factor-outbound-mysql/src/lib.rs @@ -60,7 +60,7 @@ impl OutboundMysqlFactor { pub struct InstanceState { allowed_hosts: OutboundAllowedHosts, - connections: table::Table, + connections: spin_resource_table::Table, } impl SelfInstanceBuilder for InstanceState {} diff --git a/crates/factor-outbound-pg/Cargo.toml b/crates/factor-outbound-pg/Cargo.toml index 7aef4cd817..5a621b436a 100644 --- a/crates/factor-outbound-pg/Cargo.toml +++ b/crates/factor-outbound-pg/Cargo.toml @@ -11,8 +11,8 @@ postgres-native-tls = "0.5" spin-core = { path = "../core" } spin-factor-outbound-networking = { path = "../factor-outbound-networking" } spin-factors = { path = "../factors" } +spin-resource-table = { path = "../table" } spin-world = { path = "../world" } -table = { path = "../table" } tokio = { workspace = true, features = ["rt-multi-thread"] } tokio-postgres = "0.7" tracing = { workspace = true } diff --git a/crates/factor-outbound-pg/src/lib.rs b/crates/factor-outbound-pg/src/lib.rs index 9f044c1c0c..4061f4b7f5 100644 --- a/crates/factor-outbound-pg/src/lib.rs +++ b/crates/factor-outbound-pg/src/lib.rs @@ -63,7 +63,7 @@ impl OutboundPgFactor { pub struct InstanceState { allowed_hosts: OutboundAllowedHosts, - connections: table::Table, + connections: spin_resource_table::Table, } impl SelfInstanceBuilder for InstanceState {} diff --git a/crates/factor-outbound-redis/Cargo.toml b/crates/factor-outbound-redis/Cargo.toml index fd901e312b..092363069d 100644 --- a/crates/factor-outbound-redis/Cargo.toml +++ b/crates/factor-outbound-redis/Cargo.toml @@ -10,8 +10,8 @@ redis = { version = "0.25", features = ["tokio-comp", "tokio-native-tls-comp", " spin-core = { path = "../core" } spin-factor-outbound-networking = { path = "../factor-outbound-networking" } spin-factors = { path = "../factors" } +spin-resource-table = { path = "../table" } spin-world = { path = "../world" } -table = { path = "../table" } tracing = { workspace = true } [dev-dependencies] diff --git a/crates/factor-outbound-redis/src/host.rs b/crates/factor-outbound-redis/src/host.rs index d31525d60e..441607d6c4 100644 --- a/crates/factor-outbound-redis/src/host.rs +++ b/crates/factor-outbound-redis/src/host.rs @@ -10,7 +10,7 @@ use tracing::{instrument, Level}; pub struct InstanceState { pub allowed_hosts: OutboundAllowedHosts, - pub connections: table::Table, + pub connections: spin_resource_table::Table, } impl InstanceState { diff --git a/crates/factor-outbound-redis/src/lib.rs b/crates/factor-outbound-redis/src/lib.rs index 625978b9a1..a818713334 100644 --- a/crates/factor-outbound-redis/src/lib.rs +++ b/crates/factor-outbound-redis/src/lib.rs @@ -48,7 +48,7 @@ impl Factor for OutboundRedisFactor { .allowed_hosts(); Ok(InstanceState { allowed_hosts, - connections: table::Table::new(1024), + connections: spin_resource_table::Table::new(1024), }) } } diff --git a/crates/factor-sqlite/Cargo.toml b/crates/factor-sqlite/Cargo.toml index 0a88ef616f..bc2dc84380 100644 --- a/crates/factor-sqlite/Cargo.toml +++ b/crates/factor-sqlite/Cargo.toml @@ -13,8 +13,8 @@ async-trait = { workspace = true } serde = { workspace = true } spin-factors = { path = "../factors" } spin-locked-app = { path = "../locked-app" } +spin-resource-table = { path = "../table" } spin-world = { path = "../world" } -table = { path = "../table" } tokio = { workspace = true } toml = { workspace = true } tracing = { workspace = true } diff --git a/crates/factor-sqlite/src/host.rs b/crates/factor-sqlite/src/host.rs index ff4d087f03..f26566f70e 100644 --- a/crates/factor-sqlite/src/host.rs +++ b/crates/factor-sqlite/src/host.rs @@ -15,7 +15,7 @@ use crate::{Connection, ConnectionCreator}; pub struct InstanceState { allowed_databases: Arc>, /// A resource table of connections. - connections: table::Table>, + connections: spin_resource_table::Table>, /// A map from database label to connection creators. connection_creators: HashMap>, } @@ -30,7 +30,7 @@ impl InstanceState { ) -> Self { Self { allowed_databases, - connections: table::Table::new(256), + connections: spin_resource_table::Table::new(256), connection_creators, } } diff --git a/crates/llm-local/src/bert.rs b/crates/llm-local/src/bert.rs index 55f9912506..43cf5f7627 100644 --- a/crates/llm-local/src/bert.rs +++ b/crates/llm-local/src/bert.rs @@ -485,7 +485,7 @@ struct BertEncoder { impl BertEncoder { fn load(vb: VarBuilder, config: &Config) -> Result { let layers = (0..config.num_hidden_layers) - .map(|index| BertLayer::load(vb.pp(&format!("layer.{index}")), config)) + .map(|index| BertLayer::load(vb.pp(format!("layer.{index}")), config)) .collect::>>()?; let span = tracing::span!(tracing::Level::TRACE, "encoder"); Ok(BertEncoder { layers, span }) @@ -519,8 +519,8 @@ impl BertModel { (Err(err), _) | (_, Err(err)) => { if let Some(model_type) = &config.model_type { if let (Ok(embeddings), Ok(encoder)) = ( - BertEmbeddings::load(vb.pp(&format!("{model_type}.embeddings")), config), - BertEncoder::load(vb.pp(&format!("{model_type}.encoder")), config), + BertEmbeddings::load(vb.pp(format!("{model_type}.embeddings")), config), + BertEncoder::load(vb.pp(format!("{model_type}.encoder")), config), ) { (embeddings, encoder) } else { diff --git a/crates/sqlite/Cargo.toml b/crates/sqlite/Cargo.toml index aeb2edf124..51437faf13 100644 --- a/crates/sqlite/Cargo.toml +++ b/crates/sqlite/Cargo.toml @@ -10,9 +10,9 @@ serde = { workspace = true } spin-factor-sqlite = { path = "../factor-sqlite" } spin-factors = { path = "../factors" } spin-locked-app = { path = "../locked-app" } +spin-resource-table = { path = "../table" } spin-sqlite-inproc = { path = "../sqlite-inproc" } spin-sqlite-libsql = { path = "../sqlite-libsql" } spin-world = { path = "../world" } -table = { path = "../table" } tokio = { workspace = true } toml = { workspace = true } diff --git a/crates/table/Cargo.toml b/crates/table/Cargo.toml index 083501e678..bd04031540 100644 --- a/crates/table/Cargo.toml +++ b/crates/table/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "table" +name = "spin-resource-table" version.workspace = true authors.workspace = true edition.workspace = true