From 16335bf2c893cf673ab6ffbe797a135f9fe6c07f Mon Sep 17 00:00:00 2001 From: Adam Hendel Date: Fri, 4 Oct 2024 09:21:52 -0500 Subject: [PATCH 1/2] add paradedb config engine (#1000) --- tembo-stacks/Cargo.lock | 2 +- tembo-stacks/Cargo.toml | 2 +- tembo-stacks/src/stacks/config_engines.rs | 33 +++++++++++++++++++++ tembo-stacks/src/stacks/specs/paradedb.yaml | 2 +- tembo-stacks/src/stacks/types.rs | 4 ++- 5 files changed, 39 insertions(+), 4 deletions(-) diff --git a/tembo-stacks/Cargo.lock b/tembo-stacks/Cargo.lock index 6e4810079..78186524d 100644 --- a/tembo-stacks/Cargo.lock +++ b/tembo-stacks/Cargo.lock @@ -2471,7 +2471,7 @@ dependencies = [ [[package]] name = "tembo-stacks" -version = "0.16.7" +version = "0.17.0" dependencies = [ "anyhow", "clap", diff --git a/tembo-stacks/Cargo.toml b/tembo-stacks/Cargo.toml index 7943a56e4..4824513c9 100644 --- a/tembo-stacks/Cargo.toml +++ b/tembo-stacks/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tembo-stacks" description = "Tembo Stacks for Postgres" -version = "0.16.7" +version = "0.17.0" authors = ["tembo.io"] edition = "2021" license = "Apache-2.0" diff --git a/tembo-stacks/src/stacks/config_engines.rs b/tembo-stacks/src/stacks/config_engines.rs index 8272feb34..120ba6ee6 100644 --- a/tembo-stacks/src/stacks/config_engines.rs +++ b/tembo-stacks/src/stacks/config_engines.rs @@ -20,6 +20,7 @@ pub enum ConfigEngine { Standard, OLAP, MQ, + ParadeDB, } // The standard configuration engine @@ -154,6 +155,12 @@ pub fn mq_config_engine(stack: &Stack) -> Vec { configs } +pub fn paradedb_config_engine(stack: &Stack) -> Vec { + let mut configs = olap_config_engine(stack); + configs.retain(|cfg| cfg.name != "columnar.min_parallel_processes"); + configs +} + // olap formula for max_parallel_workers_per_gather fn olap_max_parallel_workers_per_gather(cpu: f32) -> i32 { // higher of default (2) or 0.5 * cpu. PGTune uses ceiling; we will, too @@ -530,6 +537,8 @@ mod tests { }; let configs = olap_config_engine(&stack); + assert_eq!(configs.len(), 11); + assert_eq!(configs[0].name, "effective_cache_size"); assert_eq!(configs[0].value.to_string(), "11468MB"); assert_eq!(configs[1].name, "maintenance_work_mem"); @@ -582,4 +591,28 @@ mod tests { assert_eq!(configs[8].name, "work_mem"); assert_eq!(configs[8].value.to_string(), "45MB"); } + + #[test] + fn test_paradedb_config_engine() { + let stack: Stack = Stack { + name: "test".to_owned(), + infrastructure: Some(Infrastructure { + cpu: "4".to_string(), + memory: "16Gi".to_string(), + storage: "10Gi".to_string(), + }), + postgres_config_engine: Some(ConfigEngine::Standard), + ..Stack::default() + }; + let olap_configs = olap_config_engine(&stack); + assert_eq!(olap_configs.len(), 11); + assert!(olap_configs + .iter() + .any(|item| item.name == "columnar.min_parallel_processes")); + let paradedb_configs = paradedb_config_engine(&stack); + assert_eq!(paradedb_configs.len(), 10); + assert!(!paradedb_configs + .iter() + .any(|item| item.name == "columnar.min_parallel_processes")); + } } diff --git a/tembo-stacks/src/stacks/specs/paradedb.yaml b/tembo-stacks/src/stacks/specs/paradedb.yaml index addee7f53..533949ef5 100644 --- a/tembo-stacks/src/stacks/specs/paradedb.yaml +++ b/tembo-stacks/src/stacks/specs/paradedb.yaml @@ -7,7 +7,7 @@ images: 15: "standard-cnpg:15-5120dd1" 16: "standard-cnpg:16-5120dd1" stack_version: 0.1.0 -postgres_config_engine: olap +postgres_config_engine: paradedb postgres_config: - name: autovacuum_vacuum_scale_factor value: 0.05 diff --git a/tembo-stacks/src/stacks/types.rs b/tembo-stacks/src/stacks/types.rs index 2807305c7..cdf0b6b1c 100644 --- a/tembo-stacks/src/stacks/types.rs +++ b/tembo-stacks/src/stacks/types.rs @@ -1,5 +1,6 @@ use crate::stacks::config_engines::{ - mq_config_engine, olap_config_engine, standard_config_engine, ConfigEngine, + mq_config_engine, olap_config_engine, paradedb_config_engine, standard_config_engine, + ConfigEngine, }; use k8s_openapi::apimachinery::pkg::api::resource::Quantity; use schemars::JsonSchema; @@ -180,6 +181,7 @@ impl Stack { Some(ConfigEngine::Standard) => Some(standard_config_engine(self)), Some(ConfigEngine::OLAP) => Some(olap_config_engine(self)), Some(ConfigEngine::MQ) => Some(mq_config_engine(self)), + Some(ConfigEngine::ParadeDB) => Some(paradedb_config_engine(self)), None => Some(standard_config_engine(self)), } } From a7149b17aa09d115a21831358f2f28aee62a4e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Miguel?= <36349314+vrmiguel@users.noreply.github.com> Date: Fri, 4 Oct 2024 16:56:03 -0300 Subject: [PATCH 2/2] actions: update image tag for `tembo-ai-events-reporter` every commit (#990) --- .github/actions/argocd-update/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/argocd-update/action.yml b/.github/actions/argocd-update/action.yml index 5634bee88..28fe75faf 100644 --- a/.github/actions/argocd-update/action.yml +++ b/.github/actions/argocd-update/action.yml @@ -64,7 +64,8 @@ runs: yq -i '(.spec.source.helm.parameters.[] | select(.name == "inferenceGateway.image.tag")).value = "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-ai.yaml yq -i '(.spec.source.helm.parameters.[] | select(.name == "controller.image.tag")).value = "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-operator-gke-usc1.yaml yq -i '.spec.source.targetRevision= "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-ai.yaml - yq -i '.spec.source.targetRevision= "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-ai-events-reporter.yaml + yq -i '(.spec.source.helm.parameters.[] | select(.name == "image.tag")).value = "${{ inputs.version }}"' ${{ inputs.clone_into }}/${{ inputs.subdirectory }}/tembo-ai-events-reporter.yaml + - name: Update for prod deployments if: inputs.branch == 'prod-updates'