From a30618dc56313528798d39267e98b697f8b87f75 Mon Sep 17 00:00:00 2001 From: David Justice Date: Sun, 21 Jul 2024 17:36:59 -0400 Subject: [PATCH 01/13] enable environmental authentication for Azure Key Vault var provider Signed-off-by: David Justice --- Cargo.lock | 63 ++-------- crates/trigger/src/lib.rs | 4 +- crates/trigger/src/runtime_config.rs | 26 +++-- .../src/runtime_config/variables_provider.rs | 59 +++++++--- crates/variables/Cargo.toml | 6 +- .../variables/src/provider/azure_key_vault.rs | 109 ++++++++++++++---- examples/spin-timer/Cargo.lock | 63 ++-------- 7 files changed, 157 insertions(+), 173 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f486b09f83..30fba88b1c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -568,33 +568,6 @@ dependencies = [ "tower-service", ] -[[package]] -name = "azure_core" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ce3de4b65b1ee2667c81d1fc692949049502a4cf9c38118d811d6d79a7eaef" -dependencies = [ - "async-trait", - "base64 0.22.0", - "bytes", - "dyn-clone", - "futures", - "getrandom 0.2.12", - "http-types", - "once_cell", - "paste", - "pin-project", - "rand 0.8.5", - "reqwest 0.12.4", - "rustc_version", - "serde 1.0.197", - "serde_json", - "time", - "tracing", - "url", - "uuid", -] - [[package]] name = "azure_core" version = "0.20.0" @@ -629,7 +602,7 @@ version = "0.20.0" source = "git+https://github.com/azure/azure-sdk-for-rust.git?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c#8c4caa251c3903d5eae848b41bb1d02a4d65231c" dependencies = [ "async-trait", - "azure_core 0.20.0 (git+https://github.com/azure/azure-sdk-for-rust.git?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c)", + "azure_core", "bytes", "futures", "serde 1.0.197", @@ -641,27 +614,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "azure_identity" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c97790480791ec1ee9b76f5c6499b1d0aac0d4cd1e62010bfc19bb545544c5" -dependencies = [ - "async-lock 3.3.0", - "async-process 2.2.2", - "async-trait", - "azure_core 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures", - "oauth2", - "pin-project", - "serde 1.0.197", - "time", - "tracing", - "tz-rs", - "url", - "uuid", -] - [[package]] name = "azure_identity" version = "0.20.0" @@ -670,7 +622,7 @@ dependencies = [ "async-lock 3.3.0", "async-process 2.2.2", "async-trait", - "azure_core 0.20.0 (git+https://github.com/azure/azure-sdk-for-rust.git?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c)", + "azure_core", "futures", "oauth2", "pin-project", @@ -685,11 +637,10 @@ dependencies = [ [[package]] name = "azure_security_keyvault" version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "338cac645bda0555f59189873be0cccaf420c26791f009b2207b62474cebbab8" +source = "git+https://github.com/azure/azure-sdk-for-rust.git?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c#8c4caa251c3903d5eae848b41bb1d02a4d65231c" dependencies = [ "async-trait", - "azure_core 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", + "azure_core", "futures", "serde 1.0.197", "serde_json", @@ -7556,7 +7507,7 @@ version = "2.7.0-pre0" dependencies = [ "anyhow", "azure_data_cosmos", - "azure_identity 0.20.0 (git+https://github.com/azure/azure-sdk-for-rust.git?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c)", + "azure_identity", "futures", "serde 1.0.197", "spin-core", @@ -8039,8 +7990,8 @@ version = "2.7.0-pre0" dependencies = [ "anyhow", "async-trait", - "azure_core 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", - "azure_identity 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", + "azure_core", + "azure_identity", "azure_security_keyvault", "dotenvy", "once_cell", diff --git a/crates/trigger/src/lib.rs b/crates/trigger/src/lib.rs index 033999fdcd..506221c588 100644 --- a/crates/trigger/src/lib.rs +++ b/crates/trigger/src/lib.rs @@ -204,7 +204,7 @@ impl TriggerExecutorBuilder { self.loader.add_dynamic_host_component( &mut builder, spin_variables::VariablesHostComponent::new( - runtime_config.variables_providers(), + runtime_config.variables_providers()?, ), )?; } @@ -225,7 +225,7 @@ impl TriggerExecutorBuilder { let app_name = app.borrowed().require_metadata(APP_NAME_KEY)?; let resolver = - spin_variables::make_resolver(app.borrowed(), runtime_config.variables_providers())?; + spin_variables::make_resolver(app.borrowed(), runtime_config.variables_providers()?)?; let prepared_resolver = std::sync::Arc::new(resolver.prepare().await?); resolver_cell .set(prepared_resolver.clone()) diff --git a/crates/trigger/src/runtime_config.rs b/crates/trigger/src/runtime_config.rs index 5399399028..59d92ae75d 100644 --- a/crates/trigger/src/runtime_config.rs +++ b/crates/trigger/src/runtime_config.rs @@ -60,15 +60,17 @@ impl RuntimeConfig { } /// Return a Vec of configured [`VariablesProvider`]s. - pub fn variables_providers(&self) -> Vec { - let default_provider = VariablesProviderOpts::default_provider_opts(self).build_provider(); + pub fn variables_providers(&self) -> Result> { + let default_provider = + VariablesProviderOpts::default_provider_opts(self).build_provider()?; let mut providers: Vec = vec![default_provider]; - providers.extend(self.opts_layers().flat_map(|opts| { - opts.variables_providers - .iter() - .map(|opts| opts.build_provider()) - })); - providers + for opts in self.opts_layers() { + for var_provider in &opts.variables_providers { + let provider = var_provider.build_provider()?; + providers.push(provider); + } + } + Ok(providers) } /// Return an iterator of named configured [`KeyValueStore`]s. @@ -473,7 +475,7 @@ mod tests { let mut config = RuntimeConfig::new(None); // One default provider - assert_eq!(config.variables_providers().len(), 1); + assert_eq!(config.variables_providers()?.len(), 1); merge_config_toml( &mut config, @@ -485,7 +487,7 @@ mod tests { mount = "root" }, ); - assert_eq!(config.variables_providers().len(), 2); + assert_eq!(config.variables_providers()?.len(), 2); Ok(()) } @@ -495,7 +497,7 @@ mod tests { let mut config = RuntimeConfig::new(None); // One default provider - assert_eq!(config.variables_providers().len(), 1); + assert_eq!(config.variables_providers()?.len(), 1); merge_config_toml( &mut config, @@ -507,7 +509,7 @@ mod tests { mount = "root" }, ); - assert_eq!(config.variables_providers().len(), 2); + assert_eq!(config.variables_providers()?.len(), 2); Ok(()) } diff --git a/crates/trigger/src/runtime_config/variables_provider.rs b/crates/trigger/src/runtime_config/variables_provider.rs index d08633fece..3cfc5c1de5 100644 --- a/crates/trigger/src/runtime_config/variables_provider.rs +++ b/crates/trigger/src/runtime_config/variables_provider.rs @@ -1,6 +1,10 @@ use std::path::PathBuf; +use anyhow::{anyhow, Result}; use serde::Deserialize; +use spin_variables::provider::azure_key_vault::{ + AzureKeyVaultAuthOptions, AzureKeyVaultRuntimeConfigOptions, +}; use spin_variables::provider::{ azure_key_vault::{AzureAuthorityHost, AzureKeyVaultProvider}, env::EnvProvider, @@ -27,7 +31,7 @@ impl VariablesProviderOpts { )) } - pub fn build_provider(&self) -> VariablesProvider { + pub fn build_provider(&self) -> Result { match self { Self::Env(opts) => opts.build_provider(), Self::Vault(opts) => opts.build_provider(), @@ -60,11 +64,11 @@ impl EnvVariablesProviderOpts { } } - pub fn build_provider(&self) -> VariablesProvider { - Box::new(EnvProvider::new( + pub fn build_provider(&self) -> Result { + Ok(Box::new(EnvProvider::new( self.prefix.clone(), self.dotenv_path.clone(), - )) + ))) } } @@ -79,35 +83,52 @@ pub struct VaultVariablesProviderOpts { } impl VaultVariablesProviderOpts { - pub fn build_provider(&self) -> VariablesProvider { - Box::new(VaultProvider::new( + pub fn build_provider(&self) -> Result { + Ok(Box::new(VaultProvider::new( &self.url, &self.token, &self.mount, self.prefix.as_deref(), - )) + ))) } } #[derive(Debug, Default, Deserialize)] #[serde(deny_unknown_fields)] pub struct AzureKeyVaultVariablesProviderOpts { - pub client_id: String, - pub client_secret: String, - pub tenant_id: String, pub vault_url: String, - #[serde(default)] - pub authority_host: AzureAuthorityHost, + pub client_id: Option, + pub client_secret: Option, + pub tenant_id: Option, + pub authority_host: Option, } impl AzureKeyVaultVariablesProviderOpts { - pub fn build_provider(&self) -> VariablesProvider { - Box::new(AzureKeyVaultProvider::new( - &self.client_id, - &self.client_secret, - &self.tenant_id, + pub fn build_provider(&self) -> Result { + let auth_config_runtime_vars = [&self.client_id, &self.tenant_id, &self.client_secret]; + let any_some = auth_config_runtime_vars.iter().any(|&var| var.is_some()); + let any_none = auth_config_runtime_vars.iter().any(|&var| var.is_none()); + + if any_none && any_some { + // some of the service principal auth options were specified, but not enough to authenticate. + return Err(anyhow!("The current runtime config specifies some but not all of the Azure KeyVault 'client_id', 'client_secret', and 'tenant_id' values. Provide the missing values to authenticate to Azure KeyVault with the given service principal, or remove all these values to authenticate using ambient authentication (e.g. env vars, Azure CLI, Managed Identity, Workload Identity).")); + } + + let auth_options = if any_some { + // all the service principal auth options were specified in the runtime config + AzureKeyVaultAuthOptions::RuntimeConfigValues(AzureKeyVaultRuntimeConfigOptions::new( + self.client_id.clone().unwrap(), + self.client_secret.clone().unwrap(), + self.tenant_id.clone().unwrap(), + self.authority_host, + )) + } else { + AzureKeyVaultAuthOptions::Environmental + }; + + Ok(Box::new(AzureKeyVaultProvider::new( &self.vault_url, - self.authority_host, - )) + auth_options, + )?)) } } diff --git a/crates/variables/Cargo.toml b/crates/variables/Cargo.toml index e44e83171c..f5de219e41 100644 --- a/crates/variables/Cargo.toml +++ b/crates/variables/Cargo.toml @@ -18,9 +18,9 @@ tokio = { version = "1", features = ["rt-multi-thread"] } vaultrs = "0.6.2" serde = "1.0.188" tracing = { workspace = true } -azure_security_keyvault = "0.20.0" -azure_core = "0.20.0" -azure_identity = "0.20.0" +azure_security_keyvault = { git = "https://github.com/azure/azure-sdk-for-rust.git", rev = "8c4caa251c3903d5eae848b41bb1d02a4d65231c" } +azure_core = { git = "https://github.com/azure/azure-sdk-for-rust.git", rev = "8c4caa251c3903d5eae848b41bb1d02a4d65231c" } +azure_identity = { git = "https://github.com/azure/azure-sdk-for-rust.git", rev = "8c4caa251c3903d5eae848b41bb1d02a4d65231c" } [dev-dependencies] toml = "0.5" diff --git a/crates/variables/src/provider/azure_key_vault.rs b/crates/variables/src/provider/azure_key_vault.rs index bc37a6c437..c9009a52fd 100644 --- a/crates/variables/src/provider/azure_key_vault.rs +++ b/crates/variables/src/provider/azure_key_vault.rs @@ -2,54 +2,113 @@ use std::sync::Arc; use anyhow::{Context, Result}; use async_trait::async_trait; +use azure_core::auth::TokenCredential; use azure_core::Url; use azure_security_keyvault::SecretClient; use serde::Deserialize; use spin_expressions::{Key, Provider}; use tracing::{instrument, Level}; -#[derive(Debug)] -pub struct AzureKeyVaultProvider { +/// Azure KeyVault runtime config literal options for authentication +#[derive(Clone, Debug)] +pub struct AzureKeyVaultRuntimeConfigOptions { client_id: String, client_secret: String, tenant_id: String, - vault_url: String, authority_host: AzureAuthorityHost, } -impl AzureKeyVaultProvider { +impl AzureKeyVaultRuntimeConfigOptions { pub fn new( - client_id: impl Into, - client_secret: impl Into, - tenant_id: impl Into, - vault_url: impl Into, - authority_host: impl Into, + client_id: String, + client_secret: String, + tenant_id: String, + authority_host: Option, ) -> Self { Self { - client_id: client_id.into(), - client_secret: client_secret.into(), - tenant_id: tenant_id.into(), - vault_url: vault_url.into(), - authority_host: authority_host.into(), + client_id, + client_secret, + tenant_id, + authority_host: authority_host.unwrap_or_default(), } } } +/// Azure Cosmos Key / Value enumeration for the possible authentication options +#[derive(Clone, Debug)] +pub enum AzureKeyVaultAuthOptions { + /// Runtime Config values indicates the service principal credentials have been supplied + RuntimeConfigValues(AzureKeyVaultRuntimeConfigOptions), + /// Environmental indicates that the environment variables of the process should be used to + /// create the TokenCredential for the Cosmos client. This will use the Azure Rust SDK's + /// DefaultCredentialChain to derive the TokenCredential based on what environment variables + /// have been set. + /// + /// Service Principal with client secret: + /// - `AZURE_TENANT_ID`: ID of the service principal's Azure tenant. + /// - `AZURE_CLIENT_ID`: the service principal's client ID. + /// - `AZURE_CLIENT_SECRET`: one of the service principal's secrets. + /// + /// Service Principal with certificate: + /// - `AZURE_TENANT_ID`: ID of the service principal's Azure tenant. + /// - `AZURE_CLIENT_ID`: the service principal's client ID. + /// - `AZURE_CLIENT_CERTIFICATE_PATH`: path to a PEM or PKCS12 certificate file including the private key. + /// - `AZURE_CLIENT_CERTIFICATE_PASSWORD`: (optional) password for the certificate file. + /// + /// Workload Identity (Kubernetes, injected by the Workload Identity mutating webhook): + /// - `AZURE_TENANT_ID`: ID of the service principal's Azure tenant. + /// - `AZURE_CLIENT_ID`: the service principal's client ID. + /// - `AZURE_FEDERATED_TOKEN_FILE`: TokenFilePath is the path of a file containing a Kubernetes service account token. + /// + /// Managed Identity (User Assigned or System Assigned identities): + /// - `AZURE_CLIENT_ID`: (optional) if using a user assigned identity, this will be the client ID of the identity. + /// + /// Azure CLI: + /// - `AZURE_TENANT_ID`: (optional) use a specific tenant via the Azure CLI. + /// + /// Common across each: + /// - `AZURE_AUTHORITY_HOST`: (optional) the host for the identity provider. For example, for Azure public cloud the host defaults to "https://login.microsoftonline.com". + /// See also: https://github.com/Azure/azure-sdk-for-rust/blob/main/sdk/identity/README.md + Environmental, +} + +#[derive(Debug)] +pub struct AzureKeyVaultProvider { + secret_client: SecretClient, +} + +impl AzureKeyVaultProvider { + pub fn new( + vault_url: impl Into, + auth_options: AzureKeyVaultAuthOptions, + ) -> Result { + let http_client = azure_core::new_http_client(); + let token_credential = match auth_options.clone() { + AzureKeyVaultAuthOptions::RuntimeConfigValues(config) => { + let credential = azure_identity::ClientSecretCredential::new( + http_client, + config.authority_host.into(), + config.tenant_id.to_string(), + config.client_id.to_string(), + config.client_secret.to_string(), + ); + Arc::new(credential) as Arc + } + AzureKeyVaultAuthOptions::Environmental => azure_identity::create_default_credential()?, + }; + + Ok(Self { + secret_client: SecretClient::new(&vault_url.into(), token_credential)?, + }) + } +} + #[async_trait] impl Provider for AzureKeyVaultProvider { #[instrument(name = "spin_variables.get_from_azure_key_vault", skip(self), err(level = Level::INFO), fields(otel.kind = "client"))] async fn get(&self, key: &Key) -> Result> { - let http_client = azure_core::new_http_client(); - let credential = azure_identity::ClientSecretCredential::new( - http_client, - self.authority_host.into(), - self.tenant_id.to_string(), - self.client_id.to_string(), - self.client_secret.to_string(), - ); - - let secret_client = SecretClient::new(&self.vault_url, Arc::new(credential))?; - let secret = secret_client + let secret = self + .secret_client .get(key.as_str()) .await .context("Failed to read variable from Azure Key Vault")?; diff --git a/examples/spin-timer/Cargo.lock b/examples/spin-timer/Cargo.lock index 8c9adcfc83..ee337d766d 100644 --- a/examples/spin-timer/Cargo.lock +++ b/examples/spin-timer/Cargo.lock @@ -470,33 +470,6 @@ dependencies = [ "tower-service", ] -[[package]] -name = "azure_core" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ce3de4b65b1ee2667c81d1fc692949049502a4cf9c38118d811d6d79a7eaef" -dependencies = [ - "async-trait", - "base64 0.22.0", - "bytes", - "dyn-clone", - "futures", - "getrandom 0.2.12", - "http-types", - "once_cell", - "paste", - "pin-project", - "rand 0.8.5", - "reqwest 0.12.4", - "rustc_version", - "serde 1.0.203", - "serde_json", - "time", - "tracing", - "url", - "uuid", -] - [[package]] name = "azure_core" version = "0.20.0" @@ -531,7 +504,7 @@ version = "0.20.0" source = "git+https://github.com/azure/azure-sdk-for-rust.git?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c#8c4caa251c3903d5eae848b41bb1d02a4d65231c" dependencies = [ "async-trait", - "azure_core 0.20.0 (git+https://github.com/azure/azure-sdk-for-rust.git?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c)", + "azure_core", "bytes", "futures", "serde 1.0.203", @@ -543,27 +516,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "azure_identity" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c97790480791ec1ee9b76f5c6499b1d0aac0d4cd1e62010bfc19bb545544c5" -dependencies = [ - "async-lock 3.3.0", - "async-process 2.2.2", - "async-trait", - "azure_core 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", - "futures", - "oauth2", - "pin-project", - "serde 1.0.203", - "time", - "tracing", - "tz-rs", - "url", - "uuid", -] - [[package]] name = "azure_identity" version = "0.20.0" @@ -572,7 +524,7 @@ dependencies = [ "async-lock 3.3.0", "async-process 2.2.2", "async-trait", - "azure_core 0.20.0 (git+https://github.com/azure/azure-sdk-for-rust.git?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c)", + "azure_core", "futures", "oauth2", "pin-project", @@ -587,11 +539,10 @@ dependencies = [ [[package]] name = "azure_security_keyvault" version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "338cac645bda0555f59189873be0cccaf420c26791f009b2207b62474cebbab8" +source = "git+https://github.com/azure/azure-sdk-for-rust.git?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c#8c4caa251c3903d5eae848b41bb1d02a4d65231c" dependencies = [ "async-trait", - "azure_core 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", + "azure_core", "futures", "serde 1.0.203", "serde_json", @@ -5782,7 +5733,7 @@ version = "2.7.0-pre0" dependencies = [ "anyhow", "azure_data_cosmos", - "azure_identity 0.20.0 (git+https://github.com/azure/azure-sdk-for-rust.git?rev=8c4caa251c3903d5eae848b41bb1d02a4d65231c)", + "azure_identity", "futures", "serde 1.0.203", "spin-core", @@ -6062,8 +6013,8 @@ version = "2.7.0-pre0" dependencies = [ "anyhow", "async-trait", - "azure_core 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", - "azure_identity 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", + "azure_core", + "azure_identity", "azure_security_keyvault", "dotenvy", "once_cell", From 2ecaec1ba16a772368b9c95fdcf2dbe78cc8b1da Mon Sep 17 00:00:00 2001 From: Michelle Dhanani Date: Thu, 25 Jul 2024 14:54:16 -0400 Subject: [PATCH 02/13] add MAINTAINERS.md follow up for https://github.com/fermyon/spin/issues/2629 Signed-off-by: Michelle Dhanani --- MAINTAINERS.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 MAINTAINERS.md diff --git a/MAINTAINERS.md b/MAINTAINERS.md new file mode 100644 index 0000000000..2f6b882e1f --- /dev/null +++ b/MAINTAINERS.md @@ -0,0 +1,20 @@ +# MAINTAINERS + +## Current Maintainers + +| GitHub Username | Name | +| --- | --- | +| **fibonacci1729** | Brian Hardock | +| **itowlson** | Ivan Towlson | +| **dicej** | Joel Dice | +| **kate-goldenring** | Kate Goldenring | +| **lann** | Lann Martin | +| **michelleN** | Michelle Dhanani | +| **radu-matei** | Radu Matei | +| **rajatjindal** | Rajat Jindal | +| **rylev** | Ryan Levick | +| **vdice** | Vaughn Dice | + +## Emeritus Maintainers + +None \ No newline at end of file From 689136bfa2e565d0fa85a88c259c0fb542ef5aa9 Mon Sep 17 00:00:00 2001 From: Danielle Lancashire Date: Tue, 30 Jul 2024 15:16:27 +0200 Subject: [PATCH 03/13] [COC]: Embed content from Fermyon COC This is a first step towards the spin project having it's own Code of Conduct + enforcement. Reporting stays with the `conduct@fermyon.com` address while the project still lives under `github.com/fermyon`, but can eventually migrate to its own enforcement and reporting team. Signed-off-by: Danielle Lancashire --- CODE_OF_CONDUCT.md | 82 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index d0a69378d2..735f4795e4 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,3 +1,83 @@ # Code of Conduct -This project subscribes to the Fermyon [Code of Conduct](https://www.fermyon.com/code-of-conduct). +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [conduct@fermyon.com](mailto:conduct@fermyon.com). All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations From fa2695052c21516749baf895ccf7b43e62642962 Mon Sep 17 00:00:00 2001 From: Vaughn Dice Date: Thu, 1 Aug 2024 10:13:01 -0600 Subject: [PATCH 04/13] chore(*): post-v2.7.0 version bumps Signed-off-by: Vaughn Dice --- Cargo.lock | 88 +++++++++++++++++----------------- Cargo.toml | 2 +- examples/spin-timer/Cargo.lock | 60 +++++++++++------------ 3 files changed, 75 insertions(+), 75 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f36c9aa9c8..4b32e3fd93 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1504,7 +1504,7 @@ dependencies = [ [[package]] name = "conformance" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "conformance-tests", @@ -5293,7 +5293,7 @@ dependencies = [ [[package]] name = "outbound-http" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "http 0.2.12", @@ -5312,7 +5312,7 @@ dependencies = [ [[package]] name = "outbound-mqtt" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "rumqttc", @@ -5328,7 +5328,7 @@ dependencies = [ [[package]] name = "outbound-mysql" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "flate2", @@ -5347,7 +5347,7 @@ dependencies = [ [[package]] name = "outbound-pg" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "native-tls", @@ -5365,7 +5365,7 @@ dependencies = [ [[package]] name = "outbound-redis" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "redis 0.21.7", @@ -6513,7 +6513,7 @@ dependencies = [ [[package]] name = "runtime-tests" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "env_logger", @@ -7305,7 +7305,7 @@ dependencies = [ [[package]] name = "spin-app" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -7320,7 +7320,7 @@ dependencies = [ [[package]] name = "spin-build" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "futures", @@ -7336,7 +7336,7 @@ dependencies = [ [[package]] name = "spin-cli" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -7421,7 +7421,7 @@ dependencies = [ [[package]] name = "spin-common" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "dirs 4.0.0", @@ -7433,7 +7433,7 @@ dependencies = [ [[package]] name = "spin-componentize" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -7459,7 +7459,7 @@ dependencies = [ [[package]] name = "spin-core" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -7485,7 +7485,7 @@ dependencies = [ [[package]] name = "spin-doctor" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -7506,7 +7506,7 @@ dependencies = [ [[package]] name = "spin-expressions" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -7521,7 +7521,7 @@ dependencies = [ [[package]] name = "spin-http" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "http 1.1.0", @@ -7540,7 +7540,7 @@ dependencies = [ [[package]] name = "spin-key-value" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "lru 0.9.0", @@ -7554,7 +7554,7 @@ dependencies = [ [[package]] name = "spin-key-value-azure" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "azure_data_cosmos", @@ -7570,7 +7570,7 @@ dependencies = [ [[package]] name = "spin-key-value-redis" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "redis 0.21.7", @@ -7584,7 +7584,7 @@ dependencies = [ [[package]] name = "spin-key-value-sqlite" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "once_cell", @@ -7598,7 +7598,7 @@ dependencies = [ [[package]] name = "spin-llm" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "bytesize", @@ -7610,7 +7610,7 @@ dependencies = [ [[package]] name = "spin-llm-local" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "candle-core", @@ -7634,7 +7634,7 @@ dependencies = [ [[package]] name = "spin-llm-remote-http" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "http 0.2.12", @@ -7651,7 +7651,7 @@ dependencies = [ [[package]] name = "spin-loader" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -7691,7 +7691,7 @@ dependencies = [ [[package]] name = "spin-locked-app" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -7704,7 +7704,7 @@ dependencies = [ [[package]] name = "spin-manifest" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "glob", @@ -7723,7 +7723,7 @@ dependencies = [ [[package]] name = "spin-oci" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-compression", @@ -7753,7 +7753,7 @@ dependencies = [ [[package]] name = "spin-outbound-networking" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "http 1.1.0", @@ -7767,7 +7767,7 @@ dependencies = [ [[package]] name = "spin-plugins" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "bytes", @@ -7793,7 +7793,7 @@ dependencies = [ [[package]] name = "spin-serde" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "base64 0.21.7", "serde 1.0.197", @@ -7801,7 +7801,7 @@ dependencies = [ [[package]] name = "spin-sqlite" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -7815,7 +7815,7 @@ dependencies = [ [[package]] name = "spin-sqlite-inproc" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -7830,7 +7830,7 @@ dependencies = [ [[package]] name = "spin-sqlite-libsql" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -7845,7 +7845,7 @@ dependencies = [ [[package]] name = "spin-telemetry" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "http 0.2.12", @@ -7864,7 +7864,7 @@ dependencies = [ [[package]] name = "spin-templates" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -7898,7 +7898,7 @@ dependencies = [ [[package]] name = "spin-testing" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "http 1.1.0", @@ -7916,7 +7916,7 @@ dependencies = [ [[package]] name = "spin-trigger" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -7972,7 +7972,7 @@ dependencies = [ [[package]] name = "spin-trigger-http" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -8016,7 +8016,7 @@ dependencies = [ [[package]] name = "spin-trigger-redis" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -8037,7 +8037,7 @@ dependencies = [ [[package]] name = "spin-variables" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -8060,7 +8060,7 @@ dependencies = [ [[package]] name = "spin-world" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "wasmtime", ] @@ -8251,7 +8251,7 @@ dependencies = [ [[package]] name = "table" -version = "2.7.0-pre0" +version = "2.8.0-pre0" [[package]] name = "tar" @@ -8299,7 +8299,7 @@ dependencies = [ [[package]] name = "terminal" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "atty", "once_cell", @@ -9009,7 +9009,7 @@ dependencies = [ [[package]] name = "ui-testing" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "dirs 4.0.0", diff --git a/Cargo.toml b/Cargo.toml index 8497b1e1c3..3eb119a7a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ edition = { workspace = true } license = { workspace = true } [workspace.package] -version = "2.7.0-pre0" +version = "2.8.0-pre0" authors = ["Fermyon Engineering "] edition = "2021" license = "Apache-2.0 WITH LLVM-exception" diff --git a/examples/spin-timer/Cargo.lock b/examples/spin-timer/Cargo.lock index 8c9adcfc83..2a89daee85 100644 --- a/examples/spin-timer/Cargo.lock +++ b/examples/spin-timer/Cargo.lock @@ -3999,7 +3999,7 @@ dependencies = [ [[package]] name = "outbound-http" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "http 0.2.11", @@ -4018,7 +4018,7 @@ dependencies = [ [[package]] name = "outbound-mqtt" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "rumqttc", @@ -4034,7 +4034,7 @@ dependencies = [ [[package]] name = "outbound-mysql" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "flate2", @@ -4053,7 +4053,7 @@ dependencies = [ [[package]] name = "outbound-pg" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "native-tls", @@ -4071,7 +4071,7 @@ dependencies = [ [[package]] name = "outbound-redis" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "redis", @@ -5688,7 +5688,7 @@ dependencies = [ [[package]] name = "spin-app" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -5703,7 +5703,7 @@ dependencies = [ [[package]] name = "spin-common" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "dirs 4.0.0", @@ -5715,7 +5715,7 @@ dependencies = [ [[package]] name = "spin-componentize" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "tracing", @@ -5728,7 +5728,7 @@ dependencies = [ [[package]] name = "spin-core" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -5751,7 +5751,7 @@ dependencies = [ [[package]] name = "spin-expressions" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -5764,7 +5764,7 @@ dependencies = [ [[package]] name = "spin-key-value" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "lru 0.9.0", @@ -5778,7 +5778,7 @@ dependencies = [ [[package]] name = "spin-key-value-azure" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "azure_data_cosmos", @@ -5794,7 +5794,7 @@ dependencies = [ [[package]] name = "spin-key-value-redis" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "redis", @@ -5808,7 +5808,7 @@ dependencies = [ [[package]] name = "spin-key-value-sqlite" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "once_cell", @@ -5822,7 +5822,7 @@ dependencies = [ [[package]] name = "spin-llm" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "bytesize", @@ -5834,7 +5834,7 @@ dependencies = [ [[package]] name = "spin-llm-remote-http" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "http 0.2.11", @@ -5851,7 +5851,7 @@ dependencies = [ [[package]] name = "spin-loader" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -5890,7 +5890,7 @@ dependencies = [ [[package]] name = "spin-locked-app" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -5903,7 +5903,7 @@ dependencies = [ [[package]] name = "spin-manifest" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "indexmap 1.9.3", @@ -5919,7 +5919,7 @@ dependencies = [ [[package]] name = "spin-outbound-networking" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "http 1.1.0", @@ -5933,7 +5933,7 @@ dependencies = [ [[package]] name = "spin-serde" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "base64 0.21.7", "serde 1.0.203", @@ -5941,7 +5941,7 @@ dependencies = [ [[package]] name = "spin-sqlite" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -5955,7 +5955,7 @@ dependencies = [ [[package]] name = "spin-sqlite-inproc" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -5970,7 +5970,7 @@ dependencies = [ [[package]] name = "spin-sqlite-libsql" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -5985,7 +5985,7 @@ dependencies = [ [[package]] name = "spin-telemetry" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "http 0.2.11", @@ -6004,7 +6004,7 @@ dependencies = [ [[package]] name = "spin-trigger" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -6058,7 +6058,7 @@ dependencies = [ [[package]] name = "spin-variables" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "anyhow", "async-trait", @@ -6080,7 +6080,7 @@ dependencies = [ [[package]] name = "spin-world" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "wasmtime", ] @@ -6252,7 +6252,7 @@ dependencies = [ [[package]] name = "table" -version = "2.7.0-pre0" +version = "2.8.0-pre0" [[package]] name = "tar" @@ -6294,7 +6294,7 @@ dependencies = [ [[package]] name = "terminal" -version = "2.7.0-pre0" +version = "2.8.0-pre0" dependencies = [ "atty", "once_cell", From c7f09fa770cf507a23b0580dafa185552d7c1857 Mon Sep 17 00:00:00 2001 From: Karthik Ganeshram Date: Thu, 1 Aug 2024 18:26:31 +0200 Subject: [PATCH 05/13] update node version for integration test (#2698) Signed-off-by: karthik2804 --- .github/workflows/build.yml | 2 +- tests/integration.rs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c7528d18e..6cd3149147 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -194,7 +194,7 @@ jobs: tinygo-version: '0.27.0' - uses: actions/setup-node@v3 with: - node-version: '16.x' + node-version: '20.x' - name: Install Swift run: | wget https://github.com/swiftwasm/swift/releases/download/swift-wasm-5.8-SNAPSHOT-2023-02-24-a/swift-wasm-5.8-SNAPSHOT-2023-02-24-a-ubuntu22.04_x86_64.tar.gz diff --git a/tests/integration.rs b/tests/integration.rs index 99ac5aeb99..ee869aeef4 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -597,10 +597,10 @@ Caused by: "http-js", Some("https://github.com/fermyon/spin-js-sdk"), None, - &["js2wasm"], + &[], prebuild, HashMap::default(), - "Hello from JS-SDK", + "hello universe", ) } @@ -617,10 +617,10 @@ Caused by: "http-ts", Some("https://github.com/fermyon/spin-js-sdk"), None, - &["js2wasm"], + &[], prebuild, HashMap::default(), - "Hello from TS-SDK", + "hello universe", ) } From 4d89077a1ffacef1604be5f0430a6ab9765e1d72 Mon Sep 17 00:00:00 2001 From: Michelle Dhanani Date: Thu, 1 Aug 2024 15:22:57 -0400 Subject: [PATCH 06/13] remove Fermyon specific plugins from scope of Spin project Signed-off-by: Michelle Dhanani --- GOVERNANCE.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/GOVERNANCE.md b/GOVERNANCE.md index 6b65933ca0..0216506842 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -16,8 +16,6 @@ The Spin project consists of several codebases with different release cycles. Th - [Spin Plugins Index Repository](https://github.com/fermyon/spin-plugins) - [Fermyon Platform Plugin](https://github.com/fermyon/platform-plugin) - [Spin Test Plugin](https://github.com/fermyon/spin-test) - - [Cloud Plugin](https://github.com/fermyon/cloud-plugin) - - [Spin Cloud GPU Plugin](https://github.com/fermyon/spin-cloud-gpu) - Triggers: - [Spin Command Trigger](https://github.com/fermyon/spin-trigger-command) - [Spin SQS Trigger](https://github.com/fermyon/spin-trigger-sqs) From 363a0decfd94863bb3e5279a413f775300d11f28 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Mon, 12 Aug 2024 17:58:01 +0200 Subject: [PATCH 07/13] Update broken dep in example Signed-off-by: Ryan Levick --- examples/spin-timer/Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/spin-timer/Cargo.lock b/examples/spin-timer/Cargo.lock index 2a89daee85..4ec7dfb389 100644 --- a/examples/spin-timer/Cargo.lock +++ b/examples/spin-timer/Cargo.lock @@ -6339,9 +6339,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -6363,9 +6363,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", From 5fd3054a94a21b3cc5e1c534cddf23cfbe76b713 Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Thu, 1 Aug 2024 15:31:13 +0200 Subject: [PATCH 08/13] Run v0.1.0 of the conformance tests Signed-off-by: Ryan Levick --- Cargo.lock | 4 ++-- Cargo.toml | 6 ++++-- tests/conformance-tests/Cargo.toml | 4 ++-- tests/conformance-tests/src/main.rs | 5 ++++- tests/runtime-tests/Cargo.toml | 2 +- tests/runtime.rs | 6 ++++-- tests/testing-framework/Cargo.toml | 2 +- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4b32e3fd93..bda3757a18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1515,7 +1515,7 @@ dependencies = [ [[package]] name = "conformance-tests" version = "0.1.0" -source = "git+https://github.com/fermyon/conformance-tests?rev=d2129a3fd73140a76c77f15a030a5273b37cbd11#d2129a3fd73140a76c77f15a030a5273b37cbd11" +source = "git+https://github.com/fermyon/conformance-tests?rev=387b7f375df59e6254a7c29cf4a53507a9f46d32#387b7f375df59e6254a7c29cf4a53507a9f46d32" dependencies = [ "anyhow", "flate2", @@ -8339,7 +8339,7 @@ dependencies = [ [[package]] name = "test-environment" version = "0.1.0" -source = "git+https://github.com/fermyon/conformance-tests?rev=d2129a3fd73140a76c77f15a030a5273b37cbd11#d2129a3fd73140a76c77f15a030a5273b37cbd11" +source = "git+https://github.com/fermyon/conformance-tests?rev=387b7f375df59e6254a7c29cf4a53507a9f46d32#387b7f375df59e6254a7c29cf4a53507a9f46d32" dependencies = [ "anyhow", "fslock", diff --git a/Cargo.toml b/Cargo.toml index 3eb119a7a9..89fafac710 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -99,8 +99,8 @@ redis = "0.24" runtime-tests = { path = "tests/runtime-tests" } test-components = { path = "tests/test-components" } test-codegen-macro = { path = "crates/test-codegen-macro" } -test-environment = { git = "https://github.com/fermyon/conformance-tests", rev = "d2129a3fd73140a76c77f15a030a5273b37cbd11" } -conformance-tests = { git = "https://github.com/fermyon/conformance-tests", rev = "d2129a3fd73140a76c77f15a030a5273b37cbd11" } +test-environment = { workspace = true } +conformance-tests = { workspace = true } conformance = { path = "tests/conformance-tests" } [build-dependencies] @@ -135,6 +135,8 @@ http-body-util = "0.1.0" hyper = { version = "1.0.0", features = ["full"] } reqwest = { version = "0.12", features = ["stream", "blocking"] } tracing = { version = "0.1", features = ["log"] } +conformance-tests = { git = "https://github.com/fermyon/conformance-tests", rev = "387b7f375df59e6254a7c29cf4a53507a9f46d32" } +test-environment = { git = "https://github.com/fermyon/conformance-tests", rev = "387b7f375df59e6254a7c29cf4a53507a9f46d32" } wasi-common-preview1 = { version = "22.0.0", package = "wasi-common", features = [ "tokio", diff --git a/tests/conformance-tests/Cargo.toml b/tests/conformance-tests/Cargo.toml index 8f97d2b01b..75549f85e6 100644 --- a/tests/conformance-tests/Cargo.toml +++ b/tests/conformance-tests/Cargo.toml @@ -11,8 +11,8 @@ rust-version.workspace = true [dependencies] anyhow = "1.0" testing-framework = { path = "../testing-framework" } -conformance-tests = { git = "https://github.com/fermyon/conformance-tests", rev = "d2129a3fd73140a76c77f15a030a5273b37cbd11" } -test-environment = { git = "https://github.com/fermyon/conformance-tests", rev = "d2129a3fd73140a76c77f15a030a5273b37cbd11" } +conformance-tests = { workspace = true } +test-environment = { workspace = true } [lints] workspace = true diff --git a/tests/conformance-tests/src/main.rs b/tests/conformance-tests/src/main.rs index 38b97a6bd0..b6e5804c38 100644 --- a/tests/conformance-tests/src/main.rs +++ b/tests/conformance-tests/src/main.rs @@ -3,5 +3,8 @@ fn main() { .nth(1) .expect("expected first argument to be path to spin binary") .into(); - conformance_tests::run_tests(move |test| conformance::run_test(test, &spin_binary)).unwrap(); + conformance_tests::run_tests("v0.1.0", move |test| { + conformance::run_test(test, &spin_binary) + }) + .unwrap(); } diff --git a/tests/runtime-tests/Cargo.toml b/tests/runtime-tests/Cargo.toml index 6e0f7a7df1..d696766f64 100644 --- a/tests/runtime-tests/Cargo.toml +++ b/tests/runtime-tests/Cargo.toml @@ -13,5 +13,5 @@ anyhow = "1.0" env_logger = "0.10.0" log = "0.4" testing-framework = { path = "../testing-framework" } -test-environment = { git = "https://github.com/fermyon/conformance-tests", rev = "d2129a3fd73140a76c77f15a030a5273b37cbd11" } +test-environment = { workspace = true } test-components = { path = "../test-components" } diff --git a/tests/runtime.rs b/tests/runtime.rs index e2cb1ee79c..b18bc3d517 100644 --- a/tests/runtime.rs +++ b/tests/runtime.rs @@ -28,8 +28,10 @@ mod runtime_tests { #[test] fn conformance_tests() { - conformance_tests::run_tests(move |test| conformance::run_test(test, &spin_binary())) - .unwrap(); + conformance_tests::run_tests("v0.1.0", move |test| { + conformance::run_test(test, &spin_binary()) + }) + .unwrap(); } fn spin_binary() -> PathBuf { diff --git a/tests/testing-framework/Cargo.toml b/tests/testing-framework/Cargo.toml index a8caa973ac..d247b4123b 100644 --- a/tests/testing-framework/Cargo.toml +++ b/tests/testing-framework/Cargo.toml @@ -13,7 +13,7 @@ nix = "0.26.1" regex = "1.10.2" reqwest = { workspace = true } temp-dir = "0.1.11" -test-environment = { git = "https://github.com/fermyon/conformance-tests", rev = "d2129a3fd73140a76c77f15a030a5273b37cbd11" } +test-environment = { workspace = true } spin-trigger-http = { path = "../../crates/trigger-http" } spin-http = { path = "../../crates/http" } spin-trigger = { path = "../../crates/trigger" } From ce1af087792af16d0ae8759898e401bf703b55b3 Mon Sep 17 00:00:00 2001 From: Michelle Dhanani Date: Tue, 6 Aug 2024 02:47:41 -0400 Subject: [PATCH 09/13] add ROADMAP.md + Add roadmap document to help describe near ish term goals for the project Signed-off-by: Michelle Dhanani --- ROADMAP.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 ROADMAP.md diff --git a/ROADMAP.md b/ROADMAP.md new file mode 100644 index 0000000000..a5cab5286e --- /dev/null +++ b/ROADMAP.md @@ -0,0 +1,17 @@ +# Spin Roadmap + +Spin is an open-source framework designed to facilitate the development and deployment of event-driven, serverless applications using WebAssembly (Wasm). Spin provides a lightweight runtime environment that encompasses Wasmtime for running fast and secure applications integrating the latest standards in the WebAssembly community. We’re excited for the growing engagement in the Spin community and for the hard earned continued development and progress in the WebAssembly community that are incorporated in the Spin project. + +Taking these considerations into account and feedback from the community, the Spin project is focusing on features and improvements both as a developer tool and as an extensible runtime environment. The following is a non-exhaustive list: + +1. Composition and polyglot development experience + +WebAssembly components unlock a new opportunity as it relates to the polyglot development experience. In Spin, we seek to enable the polyglot re-use of components, allowing developers to specify how to use components written in various languages as libraries to fulfill dependencies in their Spin components as specified in the [Component Dependencies SIP](https://github.com/fermyon/spin/pull/2543). We’ll use this as the foundational work to then iterate on the polyglot development experience. + +2. Building a composable runtime + +There are currently some assumptions baked into the Spin runtime about the functionality provided by underlying host environments, however it’s likely a host environment may offer a subset of the capabilities assumed in the Spin runtime today or an entirely custom set of capabilities. Modularizing the Spin runtime allows it to be more readily extendable and customizable based on host environment. This requires breaking changes and a major code refactor, so this work will also be the basis for a Spin 3.0 release. See the [Spin Factors SIP](https://github.com/fermyon/spin/pull/2518) for an overview. + +3. Spin application development experience improvements + +It has become increasingly clear that there is interest in scenarios where Spin is used as a developer tool to build applications that target runtimes other than the Spin runtime (example: [NGINX Unit](https://unit.nginx.org/news/2024/fermyon-spin-rust-sdk/)). Right now, there are implicit assumptions made about the target environment both by the Spin CLI and the Spin SDKs. To support these scenarios, there will need to be work done around modularizing SDKs and building tooling that validates a Spin application can be run with a specific target environment. Foundational work for these efforts is described in the [Spin Build Target Check SIP](https://github.com/fermyon/spin/pull/2556) and is an ongoing effort. From 57f04ac149a502bd49dc867b302a4f514b74a3ca Mon Sep 17 00:00:00 2001 From: Michelle Dhanani Date: Wed, 14 Aug 2024 12:35:46 -0400 Subject: [PATCH 10/13] Update roadmap formatting markdown is hard. Signed-off-by: Michelle Dhanani --- ROADMAP.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index a5cab5286e..df037be0dc 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -5,13 +5,13 @@ Spin is an open-source framework designed to facilitate the development and depl Taking these considerations into account and feedback from the community, the Spin project is focusing on features and improvements both as a developer tool and as an extensible runtime environment. The following is a non-exhaustive list: 1. Composition and polyglot development experience - -WebAssembly components unlock a new opportunity as it relates to the polyglot development experience. In Spin, we seek to enable the polyglot re-use of components, allowing developers to specify how to use components written in various languages as libraries to fulfill dependencies in their Spin components as specified in the [Component Dependencies SIP](https://github.com/fermyon/spin/pull/2543). We’ll use this as the foundational work to then iterate on the polyglot development experience. + + WebAssembly components unlock a new opportunity as it relates to the polyglot development experience. In Spin, we seek to enable the polyglot re-use of components, allowing developers to specify how to use components written in various languages as libraries to fulfill dependencies in their Spin components as specified in the [Component Dependencies SIP](https://github.com/fermyon/spin/pull/2543). We’ll use this as the foundational work to then iterate on the polyglot development experience. 2. Building a composable runtime - -There are currently some assumptions baked into the Spin runtime about the functionality provided by underlying host environments, however it’s likely a host environment may offer a subset of the capabilities assumed in the Spin runtime today or an entirely custom set of capabilities. Modularizing the Spin runtime allows it to be more readily extendable and customizable based on host environment. This requires breaking changes and a major code refactor, so this work will also be the basis for a Spin 3.0 release. See the [Spin Factors SIP](https://github.com/fermyon/spin/pull/2518) for an overview. + + There are currently some assumptions baked into the Spin runtime about the functionality provided by underlying host environments, however it’s likely a host environment may offer a subset of the capabilities assumed in the Spin runtime today or an entirely custom set of capabilities. Modularizing the Spin runtime allows it to be more readily extendable and customizable based on host environment. This requires breaking changes and a major code refactor, so this work will also be the basis for a Spin 3.0 release. See the [Spin Factors SIP](https://github.com/fermyon/spin/pull/2518) for an overview. 3. Spin application development experience improvements - -It has become increasingly clear that there is interest in scenarios where Spin is used as a developer tool to build applications that target runtimes other than the Spin runtime (example: [NGINX Unit](https://unit.nginx.org/news/2024/fermyon-spin-rust-sdk/)). Right now, there are implicit assumptions made about the target environment both by the Spin CLI and the Spin SDKs. To support these scenarios, there will need to be work done around modularizing SDKs and building tooling that validates a Spin application can be run with a specific target environment. Foundational work for these efforts is described in the [Spin Build Target Check SIP](https://github.com/fermyon/spin/pull/2556) and is an ongoing effort. + + It has become increasingly clear that there is interest in scenarios where Spin is used as a developer tool to build applications that target runtimes other than the Spin runtime (example: [NGINX Unit](https://unit.nginx.org/news/2024/fermyon-spin-rust-sdk/)). Right now, there are implicit assumptions made about the target environment both by the Spin CLI and the Spin SDKs. To support these scenarios, there will need to be work done around modularizing SDKs and building tooling that validates a Spin application can be run with a specific target environment. Foundational work for these efforts is described in the [Spin Build Target Check SIP](https://github.com/fermyon/spin/pull/2556) and is an ongoing effort. From 56253c53f66a590e86f420d4bf3d598818230d58 Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Thu, 15 Aug 2024 15:29:00 +0200 Subject: [PATCH 11/13] simplify break condition for epoch ticker thread Signed-off-by: Ben Brandt --- Cargo.lock | 1 - crates/core/Cargo.toml | 1 - crates/core/src/lib.rs | 23 ++++++++--------------- examples/spin-timer/Cargo.lock | 1 - 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bda3757a18..177201626e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7466,7 +7466,6 @@ dependencies = [ "bytes", "cap-primitives 3.0.0", "cap-std 3.0.0", - "crossbeam-channel", "futures", "http 1.1.0", "io-extras", diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index cba62cd50e..d0d96c44bb 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -7,7 +7,6 @@ edition = { workspace = true } [dependencies] anyhow = "1.0" async-trait = "0.1" -crossbeam-channel = "0.5" tracing = { workspace = true } wasmtime = { workspace = true } wasmtime-wasi = { workspace = true } diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index b9dc8fbb9a..0efc780c5f 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -19,7 +19,6 @@ use std::sync::OnceLock; use std::{path::PathBuf, time::Duration}; use anyhow::Result; -use crossbeam_channel::Sender; use http::Request; use tracing::{field::Empty, instrument}; use wasmtime::{InstanceAllocationStrategy, PoolingAllocationConfig}; @@ -406,27 +405,24 @@ impl EngineBuilder { self.epoch_ticker_thread = enable; } - fn maybe_spawn_epoch_ticker(&self) -> Option> { + fn maybe_spawn_epoch_ticker(&self) { if !self.epoch_ticker_thread { - return None; + return; } - let engine = self.engine.clone(); + let engine_weak = self.engine.weak(); let interval = self.epoch_tick_interval; - let (send, recv) = crossbeam_channel::bounded(0); std::thread::spawn(move || loop { - match recv.recv_timeout(interval) { - Err(crossbeam_channel::RecvTimeoutError::Timeout) => (), - Err(crossbeam_channel::RecvTimeoutError::Disconnected) => break, - res => panic!("unexpected epoch_ticker_signal: {res:?}"), - } + std::thread::sleep(interval); + let Some(engine) = engine_weak.upgrade() else { + break; + }; engine.increment_epoch(); }); - Some(send) } /// Builds an [`Engine`] from this builder. pub fn build(self) -> Engine { - let epoch_ticker_signal = self.maybe_spawn_epoch_ticker(); + self.maybe_spawn_epoch_ticker(); let host_components = self.host_components_builder.build(); @@ -436,7 +432,6 @@ impl EngineBuilder { module_linker: self.module_linker, host_components, epoch_tick_interval: self.epoch_tick_interval, - _epoch_ticker_signal: epoch_ticker_signal, } } } @@ -449,8 +444,6 @@ pub struct Engine { module_linker: ModuleLinker, host_components: HostComponents, epoch_tick_interval: Duration, - // Matching receiver closes on drop - _epoch_ticker_signal: Option>, } impl Engine { diff --git a/examples/spin-timer/Cargo.lock b/examples/spin-timer/Cargo.lock index 4ec7dfb389..bfe30ae916 100644 --- a/examples/spin-timer/Cargo.lock +++ b/examples/spin-timer/Cargo.lock @@ -5735,7 +5735,6 @@ dependencies = [ "bytes", "cap-primitives", "cap-std", - "crossbeam-channel", "http 1.1.0", "io-extras", "rustix 0.37.27", From 40ead8af3034ac0a2196becab27c70f159ddfb37 Mon Sep 17 00:00:00 2001 From: Michelle Dhanani Date: Wed, 14 Aug 2024 19:03:30 -0400 Subject: [PATCH 12/13] remove *.md docs from gh build workflow Signed-off-by: Michelle Dhanani --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6cd3149147..47645d25ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: branches: ["main", "v*"] paths-ignore: - "docs/**" - - "README.md" + - "*.md" - "tests/README.md" # Serialize workflow runs per ref From ccd5c9f790b410aa38376cda3d347cabf314681f Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Mon, 19 Aug 2024 09:21:33 -0600 Subject: [PATCH 13/13] set `max_core_instance_size` in pooling config (#2721) ...and make it configurable via an environment variable. Also, increase the `table_elements` default value. As of this writing, ahead-of-time compiled ASP.NET Core apps require more memory for metadata and larger tables than we had previously anticipated. This allows them to run. Signed-off-by: Joel Dice --- crates/core/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index 0efc780c5f..c98704f094 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -113,9 +113,12 @@ impl Default for Config { .max_component_instance_size( env("SPIN_WASMTIME_INSTANCE_SIZE", (10 * MB) as u32) as usize ) + .max_core_instance_size( + env("SPIN_WASMTIME_CORE_INSTANCE_SIZE", (10 * MB) as u32) as usize + ) .max_core_instances_per_component(env("SPIN_WASMTIME_CORE_INSTANCE_COUNT", 200)) .max_tables_per_component(env("SPIN_WASMTIME_INSTANCE_TABLES", 20)) - .table_elements(env("SPIN_WASMTIME_INSTANCE_TABLE_ELEMENTS", 30_000)) + .table_elements(env("SPIN_WASMTIME_INSTANCE_TABLE_ELEMENTS", 100_000)) // The number of memories an instance can have effectively limits the number of inner components // a composed component can have (since each inner component has its own memory). We default to 32 for now, and // we'll see how often this limit gets reached.