Skip to content

Commit

Permalink
Merge pull request #2855 from fermyon/more-updates
Browse files Browse the repository at this point in the history
More dependency updates
  • Loading branch information
rylev authored Sep 23, 2024
2 parents cedb9b0 + 0fbb84c commit 1250749
Show file tree
Hide file tree
Showing 17 changed files with 230 additions and 370 deletions.
444 changes: 148 additions & 296 deletions Cargo.lock

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@ clearscreen = "3"
comfy-table = "7"
command-group = "2"
ctrlc = { version = "3.4", features = ["termination"] }
dialoguer = "0.10"
dialoguer = "0.11"
dirs = { workspace = true }
futures = { workspace = true }
glob = { workspace = true }
indicatif = "0.17"
is-terminal = "0.4"
itertools = { workspace = true }
lazy_static = "1.4.0"
levenshtein = "1.0.5"
lazy_static = "1.5"
levenshtein = "1"
nix = { version = "0.29", features = ["signal"] }
path-absolutize = "3.0.11"
path-absolutize = "3"
rand = { workspace = true }
regex = { workspace = true }
reqwest = { workspace = true }
rpassword = "7.0"
semver = "1.0"
serde = { version = "1.0", features = ["derive"] }
rpassword = "7"
semver = "1"
serde = { version = "1", features = ["derive"] }
serde_json = { workspace = true }
sha2 = { workspace = true }
subprocess = "0.2"
Expand Down
12 changes: 6 additions & 6 deletions crates/componentize/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ rust-version.workspace = true
[dependencies]
anyhow = { workspace = true }
tracing = { workspace = true }
wasm-encoder = "0.200.0"
wasm-metadata = "0.200.0"
wasmparser = "0.200.0"
wit-component = "0.200.0"
wit-parser = "0.200.0"
wasm-encoder = "0.217"
wasm-metadata = "0.217"
wasmparser = "0.217"
wit-component = "0.217"
wit-parser = "0.217"

[dev-dependencies]
async-trait = { workspace = true }
cap-std = "2.0"
cap-std = "3"
rand = { workspace = true }
rand_chacha = "0.3"
rand_core = "0.6"
Expand Down
65 changes: 36 additions & 29 deletions crates/componentize/src/convert.rs
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
#![allow(clippy::from_over_into)]

use {
wasm_encoder::{
EntityType, ExportKind, GlobalType, HeapType, MemoryType, RefType, TableType, TagKind,
TagType, ValType,
},
wasmparser::{ExternalKind, TypeRef},
use wasm_encoder::{
AbstractHeapType, EntityType, ExportKind, GlobalType, HeapType, MemoryType, RefType, TableType,
TagKind, TagType, ValType,
};

struct IntoHeapType(wasmparser::HeapType);

impl Into<HeapType> for IntoHeapType {
fn into(self) -> HeapType {
match self.0 {
wasmparser::HeapType::Func => HeapType::Func,
wasmparser::HeapType::Extern => HeapType::Extern,
wasmparser::HeapType::Concrete(_) => {
panic!("user-defined heap types not yet supported")
}
wasmparser::HeapType::Any => HeapType::Any,
wasmparser::HeapType::None => HeapType::None,
wasmparser::HeapType::NoExtern => HeapType::NoExtern,
wasmparser::HeapType::NoFunc => HeapType::NoFunc,
wasmparser::HeapType::Eq => HeapType::Eq,
wasmparser::HeapType::Struct => HeapType::Struct,
wasmparser::HeapType::Array => HeapType::Array,
wasmparser::HeapType::I31 => HeapType::I31,
wasmparser::HeapType::Exn => HeapType::Exn,
wasmparser::HeapType::Abstract { ty, shared } => {
let ty = match ty {
wasmparser::AbstractHeapType::Func => AbstractHeapType::Func,
wasmparser::AbstractHeapType::Extern => AbstractHeapType::Extern,
wasmparser::AbstractHeapType::Any => AbstractHeapType::Any,
wasmparser::AbstractHeapType::None => AbstractHeapType::None,
wasmparser::AbstractHeapType::NoExtern => AbstractHeapType::NoExtern,
wasmparser::AbstractHeapType::NoFunc => AbstractHeapType::NoFunc,
wasmparser::AbstractHeapType::Eq => AbstractHeapType::Eq,
wasmparser::AbstractHeapType::Struct => AbstractHeapType::Struct,
wasmparser::AbstractHeapType::Array => AbstractHeapType::Array,
wasmparser::AbstractHeapType::I31 => AbstractHeapType::I31,
wasmparser::AbstractHeapType::Exn => AbstractHeapType::Exn,
wasmparser::AbstractHeapType::NoExn => AbstractHeapType::NoExn,
};
HeapType::Abstract { shared, ty }
}
}
}
}
Expand Down Expand Up @@ -67,45 +70,49 @@ impl Into<TagKind> for IntoTagKind {
}
}

pub struct IntoEntityType(pub TypeRef);
pub struct IntoEntityType(pub wasmparser::TypeRef);

impl Into<EntityType> for IntoEntityType {
fn into(self) -> EntityType {
match self.0 {
TypeRef::Func(index) => EntityType::Function(index),
TypeRef::Table(ty) => EntityType::Table(TableType {
wasmparser::TypeRef::Func(index) => EntityType::Function(index),
wasmparser::TypeRef::Table(ty) => EntityType::Table(TableType {
element_type: IntoRefType(ty.element_type).into(),
minimum: ty.initial,
maximum: ty.maximum,
table64: ty.table64,
shared: ty.shared,
}),
TypeRef::Memory(ty) => EntityType::Memory(MemoryType {
wasmparser::TypeRef::Memory(ty) => EntityType::Memory(MemoryType {
minimum: ty.initial,
maximum: ty.maximum,
memory64: ty.memory64,
shared: ty.shared,
page_size_log2: ty.page_size_log2,
}),
TypeRef::Global(ty) => EntityType::Global(GlobalType {
wasmparser::TypeRef::Global(ty) => EntityType::Global(GlobalType {
val_type: IntoValType(ty.content_type).into(),
mutable: ty.mutable,
shared: ty.shared,
}),
TypeRef::Tag(ty) => EntityType::Tag(TagType {
wasmparser::TypeRef::Tag(ty) => EntityType::Tag(TagType {
kind: IntoTagKind(ty.kind).into(),
func_type_idx: ty.func_type_idx,
}),
}
}
}

pub struct IntoExportKind(pub ExternalKind);
pub struct IntoExportKind(pub wasmparser::ExternalKind);

impl Into<ExportKind> for IntoExportKind {
fn into(self) -> ExportKind {
match self.0 {
ExternalKind::Func => ExportKind::Func,
ExternalKind::Table => ExportKind::Table,
ExternalKind::Memory => ExportKind::Memory,
ExternalKind::Global => ExportKind::Global,
ExternalKind::Tag => ExportKind::Tag,
wasmparser::ExternalKind::Func => ExportKind::Func,
wasmparser::ExternalKind::Table => ExportKind::Table,
wasmparser::ExternalKind::Memory => ExportKind::Memory,
wasmparser::ExternalKind::Global => ExportKind::Global,
wasmparser::ExternalKind::Tag => ExportKind::Tag,
}
}
}
3 changes: 3 additions & 0 deletions crates/componentize/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ pub fn componentize_old_bindgen(module: &[u8]) -> Result<Vec<u8>> {
.collect::<HashSet<&str>>();

let (adapter, mut bindgen) = metadata::decode(SPIN_ADAPTER)?;
let adapter = adapter.expect(
"adapter module was malformed, and did not contain a 'component-type' custom section",
);

let world = bindgen
.resolve
Expand Down
4 changes: 2 additions & 2 deletions crates/factor-llm/src/spin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub fn default_engine_creator(
};
#[cfg(not(feature = "llm"))]
let engine = {
let _ = (state_dir);
let _ = state_dir;
noop::NoopLlmEngine
};
let engine = Arc::new(Mutex::new(engine)) as Arc<Mutex<dyn LlmEngine>>;
Expand Down Expand Up @@ -113,7 +113,7 @@ impl LlmCompute {
let engine: Arc<Mutex<dyn LlmEngine>> = match self {
#[cfg(not(feature = "llm"))]
LlmCompute::Spin => {
let _ = (state_dir);
let _ = state_dir;
Arc::new(Mutex::new(noop::NoopLlmEngine))
}
#[cfg(feature = "llm")]
Expand Down
4 changes: 2 additions & 2 deletions crates/factor-outbound-networking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ http = { workspace = true }
ipnet = "2"
rustls = { workspace = true }
rustls-pemfile = { version = "2", optional = true }
rustls-pki-types = "1.7.0"
rustls-pki-types = "1.8"
serde = { workspace = true }
spin-expressions = { path = "../expressions" }
spin-factor-variables = { path = "../factor-variables" }
Expand All @@ -23,7 +23,7 @@ spin-serde = { path = "../serde" }
terminal = { path = "../terminal" }
tracing = { workspace = true }
url = { workspace = true }
urlencoding = "2.1"
urlencoding = "2"
webpki-roots = "0.26"

[dev-dependencies]
Expand Down
6 changes: 3 additions & 3 deletions crates/factor-outbound-pg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ edition = { workspace = true }

[dependencies]
anyhow = { workspace = true }
native-tls = "0.2.11"
postgres-native-tls = "0.5.0"
native-tls = "0.2"
postgres-native-tls = "0.5"
spin-core = { path = "../core" }
spin-factor-outbound-networking = { path = "../factor-outbound-networking" }
spin-factors = { path = "../factors" }
spin-world = { path = "../world" }
table = { path = "../table" }
tokio = { version = "1", features = ["rt-multi-thread"] }
tokio-postgres = "0.7.7"
tokio-postgres = "0.7"
tracing = { workspace = true }

[dev-dependencies]
Expand Down
4 changes: 1 addition & 3 deletions crates/factor-outbound-redis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,18 @@ edition = { workspace = true }

[dependencies]
anyhow = { workspace = true }
redis = { version = "0.21", features = ["tokio-comp", "tokio-native-tls-comp", "aio"] }
redis = { version = "0.25", features = ["tokio-comp", "tokio-native-tls-comp", "aio"] }
spin-core = { path = "../core" }
spin-factor-outbound-networking = { path = "../factor-outbound-networking" }
spin-factors = { path = "../factors" }
spin-world = { path = "../world" }
table = { path = "../table" }
tracing = { workspace = true }


[dev-dependencies]
spin-factor-variables = { path = "../factor-variables" }
spin-factors-test = { path = "../factors-test" }
tokio = { version = "1", features = ["macros", "rt"] }

# wasmtime-wasi-http = { workspace = true }
[lints]
workspace = true
8 changes: 4 additions & 4 deletions crates/factor-outbound-redis/src/host.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use redis::{aio::Connection, AsyncCommands, FromRedisValue, Value};
use redis::{aio::MultiplexedConnection, AsyncCommands, FromRedisValue, Value};
use spin_core::{async_trait, wasmtime::component::Resource};
use spin_factor_outbound_networking::OutboundAllowedHosts;
use spin_world::v1::{redis as v1, redis_types};
Expand All @@ -10,7 +10,7 @@ use tracing::{instrument, Level};

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

impl InstanceState {
Expand All @@ -24,7 +24,7 @@ impl InstanceState {
) -> Result<Resource<RedisConnection>, Error> {
let conn = redis::Client::open(address.as_str())
.map_err(|_| Error::InvalidAddress)?
.get_async_connection()
.get_multiplexed_async_connection()
.await
.map_err(other_error)?;
self.connections
Expand All @@ -36,7 +36,7 @@ impl InstanceState {
async fn get_conn(
&mut self,
connection: Resource<RedisConnection>,
) -> Result<&mut Connection, Error> {
) -> Result<&mut MultiplexedConnection, Error> {
self.connections
.get_mut(connection.rep())
.ok_or(Error::Other(
Expand Down
2 changes: 1 addition & 1 deletion crates/factor-variables/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spin-world = { path = "../world" }
tokio = { version = "1", features = ["rt-multi-thread"] }
toml = { workspace = true }
tracing = { workspace = true }
vaultrs = "0.6.2"
vaultrs = "0.7"

[dev-dependencies]
spin-factors-test = { path = "../factors-test" }
Expand Down
2 changes: 1 addition & 1 deletion crates/key-value-redis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = { workspace = true }

[dependencies]
anyhow = { workspace = true }
redis = { version = "0.21", features = ["tokio-comp", "tokio-native-tls-comp"] }
redis = { version = "0.27", features = ["tokio-comp", "tokio-native-tls-comp"] }
serde = { workspace = true }
spin-core = { path = "../core" }
spin-factor-key-value = { path = "../factor-key-value" }
Expand Down
8 changes: 4 additions & 4 deletions crates/key-value-redis/src/store.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::{Context, Result};
use redis::{aio::Connection, parse_redis_url, AsyncCommands};
use redis::{aio::MultiplexedConnection, parse_redis_url, AsyncCommands};
use spin_core::async_trait;
use spin_factor_key_value::{log_error, Error, Store, StoreManager};
use std::sync::Arc;
Expand All @@ -8,7 +8,7 @@ use url::Url;

pub struct KeyValueRedis {
database_url: Url,
connection: OnceCell<Arc<Mutex<Connection>>>,
connection: OnceCell<Arc<Mutex<MultiplexedConnection>>>,
}

impl KeyValueRedis {
Expand All @@ -29,7 +29,7 @@ impl StoreManager for KeyValueRedis {
.connection
.get_or_try_init(|| async {
redis::Client::open(self.database_url.clone())?
.get_async_connection()
.get_multiplexed_async_connection()
.await
.map(Mutex::new)
.map(Arc::new)
Expand All @@ -53,7 +53,7 @@ impl StoreManager for KeyValueRedis {
}

struct RedisStore {
connection: Arc<Mutex<Connection>>,
connection: Arc<Mutex<MultiplexedConnection>>,
}

#[async_trait]
Expand Down
12 changes: 6 additions & 6 deletions crates/llm-local/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ anyhow = "1.0"
candle = { git = "https://github.com/huggingface/candle", rev = "e3261216b157a7305c18ccdd766b6e2a41afe483", package = "candle-core" }
candle-nn = { git = "https://github.com/huggingface/candle", rev = "e3261216b157a7305c18ccdd766b6e2a41afe483" }
candle-transformers = { git = "https://github.com/huggingface/candle", rev = "e3261216b157a7305c18ccdd766b6e2a41afe483" }
chrono = "0.4.26"
lru = "0.9.0"
chrono = "0.4"
lru = "0.12"
num_cpus = "1"
rand = { workspace = true }
safetensors = "0.3.3"
safetensors = "0.4"
serde = { workspace = true }
serde_json = "1.0.125"
serde_json = "1"
spin-common = { path = "../common" }
spin-core = { path = "../core" }
spin-world = { path = "../world" }
terminal = { path = "../terminal" }
tokenizers = "0.19.1"
tokio = { version = "1.32.0", features = ["macros", "sync"] }
tokenizers = "0.20"
tokio = { version = "1", features = ["macros", "sync", "fs"] }
tracing = { workspace = true }

[features]
Expand Down
2 changes: 1 addition & 1 deletion crates/telemetry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ anyhow = { workspace = true }
http0 = { version = "0.2.9", package = "http" }
http1 = { version = "1.0.0", package = "http" }
opentelemetry = { workspace = true }
opentelemetry-otlp = { version = "0.25", default-features = false, features = ["http-proto", "trace", "http", "reqwest-client", "metrics", "grpc-tonic", "logs"] }
opentelemetry-otlp = { version = "0.25", features = ["http-proto", "http", "reqwest-client"] }
opentelemetry-semantic-conventions = "0.25"
opentelemetry_sdk = { workspace = true }
terminal = { path = "../terminal" }
Expand Down
2 changes: 1 addition & 1 deletion crates/templates/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ anyhow = { workspace = true }
async-trait = { workspace = true }
bytes = { workspace = true }
console = "0.15"
dialoguer = "0.10"
dialoguer = "0.11"
dirs = { workspace = true }
fs_extra = "1"
heck = "0.5"
Expand Down
Loading

0 comments on commit 1250749

Please sign in to comment.