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

Rename table crate to spin-resource-table #2866

Merged
merged 1 commit into from
Sep 25, 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
22 changes: 11 additions & 11 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/factor-key-value/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion crates/factor-key-value/src/host.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion crates/factor-outbound-mqtt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down
4 changes: 2 additions & 2 deletions crates/factor-outbound-mqtt/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::ClientCreator;

pub struct InstanceState {
allowed_hosts: OutboundAllowedHosts,
connections: table::Table<Arc<dyn MqttClient>>,
connections: spin_resource_table::Table<Arc<dyn MqttClient>>,
create_client: Arc<dyn ClientCreator>,
}

Expand All @@ -19,7 +19,7 @@ impl InstanceState {
Self {
allowed_hosts,
create_client,
connections: table::Table::new(1024),
connections: spin_resource_table::Table::new(1024),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/factor-outbound-mysql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion crates/factor-outbound-mysql/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl<C> OutboundMysqlFactor<C> {

pub struct InstanceState<C> {
allowed_hosts: OutboundAllowedHosts,
connections: table::Table<C>,
connections: spin_resource_table::Table<C>,
}

impl<C: Send + 'static> SelfInstanceBuilder for InstanceState<C> {}
2 changes: 1 addition & 1 deletion crates/factor-outbound-pg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
2 changes: 1 addition & 1 deletion crates/factor-outbound-pg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl<C> OutboundPgFactor<C> {

pub struct InstanceState<C> {
allowed_hosts: OutboundAllowedHosts,
connections: table::Table<C>,
connections: spin_resource_table::Table<C>,
}

impl<C: Send + 'static> SelfInstanceBuilder for InstanceState<C> {}
2 changes: 1 addition & 1 deletion crates/factor-outbound-redis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion crates/factor-outbound-redis/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use tracing::{instrument, Level};

pub struct InstanceState {
pub allowed_hosts: OutboundAllowedHosts,
pub connections: table::Table<MultiplexedConnection>,
pub connections: spin_resource_table::Table<MultiplexedConnection>,
}

impl InstanceState {
Expand Down
2 changes: 1 addition & 1 deletion crates/factor-outbound-redis/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/factor-sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
4 changes: 2 additions & 2 deletions crates/factor-sqlite/src/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::{Connection, ConnectionCreator};
pub struct InstanceState {
allowed_databases: Arc<HashSet<String>>,
/// A resource table of connections.
connections: table::Table<Box<dyn Connection>>,
connections: spin_resource_table::Table<Box<dyn Connection>>,
/// A map from database label to connection creators.
connection_creators: HashMap<String, Arc<dyn ConnectionCreator>>,
}
Expand All @@ -30,7 +30,7 @@ impl InstanceState {
) -> Self {
Self {
allowed_databases,
connections: table::Table::new(256),
connections: spin_resource_table::Table::new(256),
connection_creators,
}
}
Expand Down
6 changes: 3 additions & 3 deletions crates/llm-local/src/bert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ struct BertEncoder {
impl BertEncoder {
fn load(vb: VarBuilder, config: &Config) -> Result<Self> {
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::<Result<Vec<_>>>()?;
let span = tracing::span!(tracing::Level::TRACE, "encoder");
Ok(BertEncoder { layers, span })
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion crates/sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
2 changes: 1 addition & 1 deletion crates/table/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "table"
name = "spin-resource-table"
version.workspace = true
authors.workspace = true
edition.workspace = true
Expand Down
Loading