From b64fcedd839bf61c4bd6dfc6aa4cf4518a78fa35 Mon Sep 17 00:00:00 2001 From: Joshua Jerin Date: Fri, 16 Aug 2024 11:27:37 -0400 Subject: [PATCH 01/10] Update Docker Images to latest rust stable version (#905) --- conductor/Dockerfile | 2 +- dataplane-webserver/Dockerfile | 2 +- inference-gateway/Dockerfile | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conductor/Dockerfile b/conductor/Dockerfile index a236ba723..c2479854c 100644 --- a/conductor/Dockerfile +++ b/conductor/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/tembo/rust:1.76-slim-bookworm as builder +FROM quay.io/tembo/rust:1.79-slim as builder RUN apt-get update && \ apt-get install -y pkg-config libssl-dev && apt-get clean && \ diff --git a/dataplane-webserver/Dockerfile b/dataplane-webserver/Dockerfile index a0ad48758..dc6418a84 100644 --- a/dataplane-webserver/Dockerfile +++ b/dataplane-webserver/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/tembo/rust:1.77-slim +FROM quay.io/tembo/rust:1.79-slim RUN apt-get update \ && apt-get install -y pkg-config libssl-dev \ diff --git a/inference-gateway/Dockerfile b/inference-gateway/Dockerfile index e4ccc9c1e..48faccfba 100644 --- a/inference-gateway/Dockerfile +++ b/inference-gateway/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.77.0-slim-buster as builder +FROM rust:1.79.0-slim-buster as builder RUN apt-get update && \ apt-get install -y pkg-config libssl-dev && apt-get clean && \ @@ -13,7 +13,7 @@ COPY migrations/ /build/migrations RUN SQLX_OFFLINE=true cargo build --release -FROM rust:1.77.0-slim-buster +FROM rust:1.79.0-slim-buster COPY --from=builder /build/target/release/gateway /usr/local/bin/gateway From 33157049cff9c9326c7c758c8681e8ace7ce3827 Mon Sep 17 00:00:00 2001 From: Adam Hendel Date: Mon, 19 Aug 2024 10:13:55 -0500 Subject: [PATCH 02/10] add documentation for inference-gateway env vars (#918) --- inference-gateway/src/config.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/inference-gateway/src/config.rs b/inference-gateway/src/config.rs index 334b1fa93..ab884e5b4 100644 --- a/inference-gateway/src/config.rs +++ b/inference-gateway/src/config.rs @@ -4,11 +4,19 @@ use url::Url; #[derive(Clone, Debug)] pub struct Config { + /// service and port of the inference service + /// Must be an OpenAI compatible interface pub llm_service_host_port: Url, + /// Postgres connection string to the timeseries databse which logs token usage pub pg_conn_str: String, + /// Port to run the inference gateway on pub server_port: u16, + /// Number of actix workers to spawn pub server_workers: u16, + /// Boolean to toggle billing request authorization. + /// When true, callers must have an active payment method on file pub org_auth_enabled: bool, + /// Interval to refresh the billing authorization cache pub org_auth_cache_refresh_interval_sec: u64, } From 1ed80c9c7dd561b60578aed2dc65fe3bd4005b4c Mon Sep 17 00:00:00 2001 From: Adam Hendel Date: Mon, 19 Aug 2024 12:04:47 -0500 Subject: [PATCH 03/10] fix trunk ver test (#919) --- tembo-operator/src/trunk.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tembo-operator/src/trunk.rs b/tembo-operator/src/trunk.rs index 1136ba07f..30ffcdc50 100644 --- a/tembo-operator/src/trunk.rs +++ b/tembo-operator/src/trunk.rs @@ -545,8 +545,23 @@ mod tests { let result = get_latest_trunk_project_metadata("pgmq").await; assert!(result.is_ok()); + // latest pgmq release per repo + let url = "https://api.github.com/repos/tembo-io/pgmq/releases/latest"; + let client = reqwest::Client::new(); + let res = client + .get(url) + .header("User-Agent", "reqwest") + .send() + .await + .unwrap() + .json::() + .await + .unwrap(); + let latest_rag = res.get("tag_name").unwrap().as_str().unwrap(); + let project = result.unwrap(); - assert!(project.version == "1.4.0"); + + assert_eq!(format!("v{}", project.version), latest_rag); assert!(project.name == "pgmq"); } From d8f988b876a4b5ca2c7d14bd3d1ecfd357f12a37 Mon Sep 17 00:00:00 2001 From: Adam Hendel Date: Mon, 19 Aug 2024 12:25:44 -0500 Subject: [PATCH 04/10] Update CODEOWNERS (#920) --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index 8aed90cef..140b4e7e2 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -6,5 +6,5 @@ conductor/** @sjmiller609 @nhudson @ianstanton @ChuckHend tembo-pod-init/** @nhudson tembo-cli/** @shahadarsh @vrmiguel @DarrenBaldwin07 @sjmiller609 tembo-py/** @chuckhend @EvanHStanton -tembo-stacks/** @chuckhend @jasonmp85 +tembo-stacks/** @chuckhend @jasonmp85 @shhnwz inference-gateway/** @chuckhend @jasonmp85 @shhnwz From ac366dd44a5a606ae9f8ec096a56f27446757925 Mon Sep 17 00:00:00 2001 From: Adam Hendel Date: Mon, 19 Aug 2024 13:39:21 -0500 Subject: [PATCH 05/10] analytics image + pg minor update (#917) --- tembo-stacks/Cargo.lock | 2 +- tembo-stacks/Cargo.toml | 2 +- tembo-stacks/src/stacks/specs/api.yaml | 6 +++--- tembo-stacks/src/stacks/specs/data_warehouse.yaml | 6 +++--- tembo-stacks/src/stacks/specs/gis.yaml | 6 +++--- tembo-stacks/src/stacks/specs/machine_learning.yaml | 4 ++-- tembo-stacks/src/stacks/specs/message_queue.yaml | 6 +++--- tembo-stacks/src/stacks/specs/mongo_alternative.yaml | 6 +++--- tembo-stacks/src/stacks/specs/olap.yaml | 7 ++++--- tembo-stacks/src/stacks/specs/oltp.yaml | 6 +++--- tembo-stacks/src/stacks/specs/rag.yaml | 6 +++--- tembo-stacks/src/stacks/specs/standard.yaml | 6 +++--- tembo-stacks/src/stacks/specs/timeseries.yaml | 6 +++--- tembo-stacks/src/stacks/specs/vectordb.yaml | 6 +++--- 14 files changed, 38 insertions(+), 37 deletions(-) diff --git a/tembo-stacks/Cargo.lock b/tembo-stacks/Cargo.lock index cf580533a..8a7c2a6be 100644 --- a/tembo-stacks/Cargo.lock +++ b/tembo-stacks/Cargo.lock @@ -2471,7 +2471,7 @@ dependencies = [ [[package]] name = "tembo-stacks" -version = "0.11.7" +version = "0.13.0" dependencies = [ "anyhow", "clap", diff --git a/tembo-stacks/Cargo.toml b/tembo-stacks/Cargo.toml index c543f6603..5fc5624a4 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.12.0" +version = "0.13.0" authors = ["tembo.io"] edition = "2021" license = "Apache-2.0" diff --git a/tembo-stacks/src/stacks/specs/api.yaml b/tembo-stacks/src/stacks/specs/api.yaml index 758621b6e..6e84e37fc 100644 --- a/tembo-stacks/src/stacks/specs/api.yaml +++ b/tembo-stacks/src/stacks/specs/api.yaml @@ -3,9 +3,9 @@ description: Tembo Stack with REST and graphQL interfaces. repository: "quay.io/tembo" organization: tembo images: - 14: "standard-cnpg:14-389a437" - 15: "standard-cnpg:15-389a437" - 16: "standard-cnpg:16-389a437" + 14: "standard-cnpg:14-5120dd1" + 15: "standard-cnpg:15-5120dd1" + 16: "standard-cnpg:16-5120dd1" stack_version: 0.1.0 appServices: - image: postgrest/postgrest:v12.0.0 diff --git a/tembo-stacks/src/stacks/specs/data_warehouse.yaml b/tembo-stacks/src/stacks/specs/data_warehouse.yaml index 5e940738c..021ba20a6 100644 --- a/tembo-stacks/src/stacks/specs/data_warehouse.yaml +++ b/tembo-stacks/src/stacks/specs/data_warehouse.yaml @@ -3,9 +3,9 @@ description: A Postgres instance equipped with configuration and extensions for repository: "quay.io/tembo" organization: tembo images: - 14: "dw-cnpg:14-c19d507" - 15: "dw-cnpg:15-c19d507" - 16: "dw-cnpg:16-c19d507" + 14: "dw-cnpg:14-5120dd1" + 15: "dw-cnpg:15-5120dd1" + 16: "dw-cnpg:16-5120dd1" stack_version: 0.1.0 postgres_config_engine: olap postgres_config: diff --git a/tembo-stacks/src/stacks/specs/gis.yaml b/tembo-stacks/src/stacks/specs/gis.yaml index 2edbfeb3c..3cdab0caf 100644 --- a/tembo-stacks/src/stacks/specs/gis.yaml +++ b/tembo-stacks/src/stacks/specs/gis.yaml @@ -3,9 +3,9 @@ description: Postgres for geospatial workloads. repository: "quay.io/tembo" organization: tembo images: - 14: "geo-cnpg:14-389a437" - 15: "geo-cnpg:15-389a437" - 16: "geo-cnpg:16-389a437" + 14: "geo-cnpg:14-5120dd1" + 15: "geo-cnpg:15-5120dd1" + 16: "geo-cnpg:16-5120dd1" stack_version: 0.1.0 postgres_config_engine: standard postgres_config: diff --git a/tembo-stacks/src/stacks/specs/machine_learning.yaml b/tembo-stacks/src/stacks/specs/machine_learning.yaml index 1460b7a18..60471512d 100644 --- a/tembo-stacks/src/stacks/specs/machine_learning.yaml +++ b/tembo-stacks/src/stacks/specs/machine_learning.yaml @@ -5,8 +5,8 @@ organization: tembo images: # currently an issue with plpython2u and plpythonu in image build for pg14 14: "ml-cnpg:14-a0a5ab5" - 15: "ml-cnpg:15-389a437" - 16: "ml-cnpg:16-389a437" + 15: "ml-cnpg:15-5120dd1" + 16: "ml-cnpg:16-5120dd1" stack_version: 0.3.0 compute_constraints: min: diff --git a/tembo-stacks/src/stacks/specs/message_queue.yaml b/tembo-stacks/src/stacks/specs/message_queue.yaml index 6e5b64489..653ce8866 100644 --- a/tembo-stacks/src/stacks/specs/message_queue.yaml +++ b/tembo-stacks/src/stacks/specs/message_queue.yaml @@ -3,9 +3,9 @@ description: A Tembo Postgres Stack optimized for Message Queue workloads. repository: "quay.io/tembo" organization: tembo images: - 14: "standard-cnpg:14-389a437" - 15: "standard-cnpg:15-389a437" - 16: "standard-cnpg:16-389a437" + 14: "standard-cnpg:14-5120dd1" + 15: "standard-cnpg:15-5120dd1" + 16: "standard-cnpg:16-5120dd1" stack_version: 0.3.0 appServices: - name: mq-api diff --git a/tembo-stacks/src/stacks/specs/mongo_alternative.yaml b/tembo-stacks/src/stacks/specs/mongo_alternative.yaml index 31f6de11c..94c06a82b 100644 --- a/tembo-stacks/src/stacks/specs/mongo_alternative.yaml +++ b/tembo-stacks/src/stacks/specs/mongo_alternative.yaml @@ -3,9 +3,9 @@ description: Document-facing workloads on Postgres. repository: "quay.io/tembo" organization: tembo images: - 14: "standard-cnpg:14-389a437" - 15: "standard-cnpg:15-389a437" - 16: "standard-cnpg:16-389a437" + 14: "standard-cnpg:14-5120dd1" + 15: "standard-cnpg:15-5120dd1" + 16: "standard-cnpg:16-5120dd1" stack_version: 0.1.0 appServices: - name: fdb-api diff --git a/tembo-stacks/src/stacks/specs/olap.yaml b/tembo-stacks/src/stacks/specs/olap.yaml index b2d7dd950..d7128c36d 100644 --- a/tembo-stacks/src/stacks/specs/olap.yaml +++ b/tembo-stacks/src/stacks/specs/olap.yaml @@ -3,9 +3,10 @@ description: A Postgres instance equipped with configuration and extensions for repository: "quay.io/tembo" organization: tembo images: - 14: "standard-cnpg:14-389a437" - 15: "standard-cnpg:15-389a437" - 16: "standard-cnpg:16-389a437" + # duckdb is installed into pg16, but not pg14 or pg15 (not compatible) + 14: "standard-cnpg:14-5120dd1" + 15: "standard-cnpg:15-5120dd1" + 16: "analytics-cnpg:16-5120dd1" stack_version: 0.1.0 postgres_config_engine: olap postgres_config: diff --git a/tembo-stacks/src/stacks/specs/oltp.yaml b/tembo-stacks/src/stacks/specs/oltp.yaml index c1da14a9c..bd898c1ad 100644 --- a/tembo-stacks/src/stacks/specs/oltp.yaml +++ b/tembo-stacks/src/stacks/specs/oltp.yaml @@ -3,9 +3,9 @@ description: A Postgres instance optimized for OLTP workloads. repository: "quay.io/tembo" organization: tembo images: - 14: "standard-cnpg:14-389a437" - 15: "standard-cnpg:15-389a437" - 16: "standard-cnpg:16-389a437" + 14: "standard-cnpg:14-5120dd1" + 15: "standard-cnpg:15-5120dd1" + 16: "standard-cnpg:16-5120dd1" stack_version: 0.1.0 postgres_config_engine: standard postgres_config: diff --git a/tembo-stacks/src/stacks/specs/rag.yaml b/tembo-stacks/src/stacks/specs/rag.yaml index d782548c6..33190848d 100644 --- a/tembo-stacks/src/stacks/specs/rag.yaml +++ b/tembo-stacks/src/stacks/specs/rag.yaml @@ -3,9 +3,9 @@ description: A Tembo Postgres Stack configured for retrieval augmented generatio repository: "quay.io/tembo" organization: tembo images: - 14: "standard-cnpg:14-389a437" - 15: "standard-cnpg:15-389a437" - 16: "standard-cnpg:16-389a437" + 14: "standard-cnpg:14-5120dd1" + 15: "standard-cnpg:15-5120dd1" + 16: "standard-cnpg:16-5120dd1" stack_version: 0.1.0 appServices: - image: quay.io/tembo/ai-proxy:2024.06.03 diff --git a/tembo-stacks/src/stacks/specs/standard.yaml b/tembo-stacks/src/stacks/specs/standard.yaml index a24af7769..7a5a689d3 100644 --- a/tembo-stacks/src/stacks/specs/standard.yaml +++ b/tembo-stacks/src/stacks/specs/standard.yaml @@ -3,9 +3,9 @@ description: A balanced Postgres instance optimized for OLTP workloads. repository: "quay.io/tembo" organization: tembo images: - 14: "standard-cnpg:14-389a437" - 15: "standard-cnpg:15-389a437" - 16: "standard-cnpg:16-389a437" + 14: "standard-cnpg:14-5120dd1" + 15: "standard-cnpg:15-5120dd1" + 16: "standard-cnpg:16-5120dd1" stack_version: 0.1.0 postgres_config_engine: standard postgres_config: diff --git a/tembo-stacks/src/stacks/specs/timeseries.yaml b/tembo-stacks/src/stacks/specs/timeseries.yaml index 78c41c4da..1219ead94 100644 --- a/tembo-stacks/src/stacks/specs/timeseries.yaml +++ b/tembo-stacks/src/stacks/specs/timeseries.yaml @@ -3,9 +3,9 @@ description: A Postgres instance equipped with configuration and extensions for repository: "quay.io/tembo" organization: tembo images: - 14: "standard-cnpg:14-389a437" - 15: "standard-cnpg:15-389a437" - 16: "standard-cnpg:16-389a437" + 14: "standard-cnpg:14-5120dd1" + 15: "standard-cnpg:15-5120dd1" + 16: "standard-cnpg:16-5120dd1" stack_version: 0.1.0 postgres_config_engine: olap postgres_config: diff --git a/tembo-stacks/src/stacks/specs/vectordb.yaml b/tembo-stacks/src/stacks/specs/vectordb.yaml index 1fcb32098..b096d9d30 100644 --- a/tembo-stacks/src/stacks/specs/vectordb.yaml +++ b/tembo-stacks/src/stacks/specs/vectordb.yaml @@ -3,9 +3,9 @@ description: A Tembo Postgres Stack configured to support vector data types, sto repository: "quay.io/tembo" organization: tembo images: - 14: "standard-cnpg:14-389a437" - 15: "standard-cnpg:15-389a437" - 16: "standard-cnpg:16-389a437" + 14: "standard-cnpg:14-5120dd1" + 15: "standard-cnpg:15-5120dd1" + 16: "standard-cnpg:16-5120dd1" stack_version: 0.1.0 appServices: - image: 387894460527.dkr.ecr.us-east-1.amazonaws.com/tembo-io/vector-serve:6397964 From ba7ce34f5d2628d1dbbcb850b2f1c99dbe76297f Mon Sep 17 00:00:00 2001 From: Nick Hudson Date: Mon, 19 Aug 2024 14:20:13 -0500 Subject: [PATCH 06/10] tembo-ai add option for private loadbalancer (#921) --- charts/tembo-ai/Chart.yaml | 2 +- .../inference-gateway/service-lb.yaml | 24 ++++++++++++++ charts/tembo-ai/values.yaml | 31 +++++++++++++------ 3 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 charts/tembo-ai/templates/inference-gateway/service-lb.yaml diff --git a/charts/tembo-ai/Chart.yaml b/charts/tembo-ai/Chart.yaml index cee5d76db..43b8509dd 100644 --- a/charts/tembo-ai/Chart.yaml +++ b/charts/tembo-ai/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.4 +version: 0.2.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/tembo-ai/templates/inference-gateway/service-lb.yaml b/charts/tembo-ai/templates/inference-gateway/service-lb.yaml new file mode 100644 index 000000000..4c74903bb --- /dev/null +++ b/charts/tembo-ai/templates/inference-gateway/service-lb.yaml @@ -0,0 +1,24 @@ +{{- if .Values.inferenceGateway.internalLoadBalancer.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "tembo-ai.fullname" . }}-gateway-internal-lb + labels: + {{- include "tembo-ai.inferenceGateway.labels" . | nindent 4 }} + annotations: + {{- toYaml .Values.inferenceGateway.internalLoadBalancer.annotations | nindent 4 }} + {{- if .Values.inferenceGateway.internalLoadBalancer.route53.enabled }} + external-dns.alpha.kubernetes.io/hostname: {{ .Values.inferenceGateway.internalLoadBalancer.route53.recordName }}.{{ .Values.inferenceGateway.internalLoadBalancer.route53.zoneName }} + external-dns.alpha.kubernetes.io/ttl: {{ .Values.inferenceGateway.internalLoadBalancer.route53.ttl | quote }} + {{- end }} + +spec: + type: LoadBalancer + ports: + - port: {{ .Values.inferenceGateway.internalLoadBalancer.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "tembo-ai.inferenceGateway.selectorLabels" . | nindent 4 }} +{{- end }} diff --git a/charts/tembo-ai/values.yaml b/charts/tembo-ai/values.yaml index eadf4f112..9d715757e 100644 --- a/charts/tembo-ai/values.yaml +++ b/charts/tembo-ai/values.yaml @@ -54,6 +54,17 @@ inferenceGateway: annotations: {} service: port: 8080 + internalLoadBalancer: + enabled: false + annotations: + service.beta.kubernetes.io/aws-load-balancer-type: nlb + service.beta.kubernetes.io/aws-load-balancer-internal: "true" + service.beta.kubernetes.io/aws-load-balancer-scheme: internal + route53: + enabled: false + zoneName: "" + recordName: "inference-gateway" + port: 8080 args: [] command: - "/usr/local/bin/gateway" @@ -82,13 +93,13 @@ inferenceService: tag: latest resources: requests: - cpu: '4' - memory: '16Gi' - nvidia.com/gpu: '1' + cpu: "4" + memory: "16Gi" + nvidia.com/gpu: "1" limits: - cpu: '8' - memory: '16Gi' - nvidia.com/gpu: '1' + cpu: "8" + memory: "16Gi" + nvidia.com/gpu: "1" livenessProbe: enabled: true path: /health @@ -140,10 +151,10 @@ inferenceService: # # readOnlyRootFilesystem: true nodeSelector: {} tolerations: - - key: "tembo.io/gpu" - operator: "Equal" - value: "true" - effect: "NoSchedule" + - key: "tembo.io/gpu" + operator: "Equal" + value: "true" + effect: "NoSchedule" affinity: {} podAnnotations: {} podSecurityContext: {} From d8c34334a9fafd13c65c47650ea0b9901e9713b4 Mon Sep 17 00:00:00 2001 From: Jason Petersen Date: Tue, 20 Aug 2024 08:45:56 -0600 Subject: [PATCH 07/10] Add Analytics stack (#922) --- tembo-stacks/src/stacks/mod.rs | 3 + tembo-stacks/src/stacks/specs/analytics.yaml | 61 ++++++++++++++++++++ tembo-stacks/src/stacks/types.rs | 6 ++ 3 files changed, 70 insertions(+) create mode 100644 tembo-stacks/src/stacks/specs/analytics.yaml diff --git a/tembo-stacks/src/stacks/mod.rs b/tembo-stacks/src/stacks/mod.rs index 648cc7bf9..42a721d6c 100644 --- a/tembo-stacks/src/stacks/mod.rs +++ b/tembo-stacks/src/stacks/mod.rs @@ -6,6 +6,8 @@ use crate::stacks::types::{Stack, StackType}; use lazy_static::lazy_static; lazy_static! { + pub static ref ANALYTICS: Stack = serde_yaml::from_str(include_str!("specs/analytics.yaml")) + .expect("analytics.yaml not found"); pub static ref API: Stack = serde_yaml::from_str(include_str!("specs/api.yaml")).expect("api.yaml not found"); pub static ref DATAWAREHOUSE: Stack = @@ -36,6 +38,7 @@ lazy_static! { pub fn get_stack(entity: StackType) -> Stack { match entity { + StackType::Analytics => ANALYTICS.clone(), StackType::API => API.clone(), StackType::DataWarehouse => DATAWAREHOUSE.clone(), StackType::Geospatial => GEOSPATIAL.clone(), diff --git a/tembo-stacks/src/stacks/specs/analytics.yaml b/tembo-stacks/src/stacks/specs/analytics.yaml new file mode 100644 index 000000000..934aa2a45 --- /dev/null +++ b/tembo-stacks/src/stacks/specs/analytics.yaml @@ -0,0 +1,61 @@ +name: Analytics +description: A Postgres instance equipped ParadeDB's pg_analytics extension. +repository: "quay.io/tembo" +organization: tembo +images: + 14: "standard-cnpg:14-5120dd1" + 15: "standard-cnpg:15-5120dd1" + 16: "standard-cnpg:16-5120dd1" +stack_version: 0.1.0 +postgres_config_engine: olap +postgres_config: + - name: autovacuum_vacuum_scale_factor + value: 0.05 + - name: autovacuum_vacuum_insert_scale_factor + value: 0.05 + - name: checkpoint_completion_target + value: 0.95 + - name: checkpoint_timeout + value: 30min + - name: cron.host + value: /controller/run + - name: pg_stat_statements.track + value: top + - name: shared_preload_libraries + value: pg_stat_statements,pg_cron + - name: track_io_timing + value: 'on' + - name: wal_level + value: logical +trunk_installs: + - name: pg_stat_statements + version: 1.10.0 + - name: pg_partman + version: 4.7.4 + - name: pg_cron + version: 1.6.2 + - name: pg_lakehouse + version: 0.9.0 +extensions: + - name: pg_stat_statements + locations: + - database: postgres + enabled: true + version: 1.10.0 + - name: pg_partman + locations: + - database: postgres + enabled: true + version: 4.7.4 + - name: pg_cron + description: pg_cron + locations: + - database: postgres + enabled: true + version: 1.6.2 + - name: pg_lakehouse + description: pg_lakehouse + locations: + - database: postgres + enabled: true + version: 0.9.0 diff --git a/tembo-stacks/src/stacks/types.rs b/tembo-stacks/src/stacks/types.rs index d2cb1ef42..bd56f48c0 100644 --- a/tembo-stacks/src/stacks/types.rs +++ b/tembo-stacks/src/stacks/types.rs @@ -28,6 +28,7 @@ use utoipa::ToSchema; strum_macros::Display, )] pub enum StackType { + Analytics, API, DataWarehouse, Geospatial, @@ -48,6 +49,7 @@ impl std::str::FromStr for StackType { fn from_str(value: &str) -> Result { match value { + "Analytics" => Ok(StackType::Analytics), "API" => Ok(StackType::API), "DataWarehouse" => Ok(StackType::DataWarehouse), "Geospatial" => Ok(StackType::Geospatial), @@ -68,6 +70,7 @@ impl std::str::FromStr for StackType { impl StackType { pub fn as_str(&self) -> &str { match self { + StackType::Analytics => "Analytics", StackType::API => "API", StackType::DataWarehouse => "DataWarehouse", StackType::Geospatial => "Geospatial", @@ -291,6 +294,9 @@ mod tests { fn test_all_stack_deserialization() { for stack in StackType::iter() { match stack { + StackType::Analytics => { + get_stack(StackType::Analytics); + } StackType::API => { get_stack(StackType::API); } From 8d1513d76dde438caa5d59adda74134cdee88aa6 Mon Sep 17 00:00:00 2001 From: Jason Petersen Date: Tue, 20 Aug 2024 09:01:46 -0600 Subject: [PATCH 08/10] Bump crate version for analytics (#923) --- tembo-stacks/Cargo.lock | 2 +- tembo-stacks/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tembo-stacks/Cargo.lock b/tembo-stacks/Cargo.lock index 8a7c2a6be..90559179a 100644 --- a/tembo-stacks/Cargo.lock +++ b/tembo-stacks/Cargo.lock @@ -2471,7 +2471,7 @@ dependencies = [ [[package]] name = "tembo-stacks" -version = "0.13.0" +version = "0.14.0" dependencies = [ "anyhow", "clap", diff --git a/tembo-stacks/Cargo.toml b/tembo-stacks/Cargo.toml index 5fc5624a4..05eebddee 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.13.0" +version = "0.14.0" authors = ["tembo.io"] edition = "2021" license = "Apache-2.0" From ec42853e896d56eb290917a42c51328225fabdaa Mon Sep 17 00:00:00 2001 From: Nick Hudson Date: Tue, 20 Aug 2024 12:54:40 -0500 Subject: [PATCH 09/10] add exception to egress policy for port 8080 (#924) --- tembo-operator/Cargo.lock | 2 +- tembo-operator/Cargo.toml | 2 +- tembo-operator/src/network_policies.rs | 40 ++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/tembo-operator/Cargo.lock b/tembo-operator/Cargo.lock index 87b97ec1c..906d5f06b 100644 --- a/tembo-operator/Cargo.lock +++ b/tembo-operator/Cargo.lock @@ -503,7 +503,7 @@ dependencies = [ [[package]] name = "controller" -version = "0.49.6" +version = "0.49.7" dependencies = [ "actix-web", "anyhow", diff --git a/tembo-operator/Cargo.toml b/tembo-operator/Cargo.toml index 8686f35b3..0fded3139 100644 --- a/tembo-operator/Cargo.toml +++ b/tembo-operator/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "controller" description = "Tembo Operator for Postgres" -version = "0.49.6" +version = "0.49.7" edition = "2021" default-run = "controller" license = "Apache-2.0" diff --git a/tembo-operator/src/network_policies.rs b/tembo-operator/src/network_policies.rs index e2953249a..8ba4ca249 100644 --- a/tembo-operator/src/network_policies.rs +++ b/tembo-operator/src/network_policies.rs @@ -311,6 +311,46 @@ pub async fn reconcile_network_policies(client: Client, namespace: &str) -> Resu apply_network_policy(namespace, &np_api, allow_proxy_to_access_tembo_ai_gateway).await?; + let allow_proxy_to_access_tembo_ai_gateway_internal_lb = serde_json::json!({ + "apiVersion": "networking.k8s.io/v1", + "kind": "NetworkPolicy", + "metadata": { + "name": "allow-proxy-to-access-tembo-ai-gateway-internal-lb", + "namespace": format!("{namespace}"), + }, + "spec": { + "podSelector": { + "matchLabels": { + "app": format!("{}-ai-proxy", namespace) + } + }, + "policyTypes": ["Egress"], + "egress": [ + { + "ports": [ + { + "port": 8080, + "protocol": "TCP" + } + ], + "to": [ + { + "ipBlock": { + "cidr": "10.0.0.0/8" + } + } + ] + } + ] + } + }); + + apply_network_policy( + namespace, + &np_api, + allow_proxy_to_access_tembo_ai_gateway_internal_lb, + ) + .await?; Ok(()) } From 2295805577f15dd283cf5bfa93d21b0f6ffaa060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Miguel?= <36349314+vrmiguel@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:38:05 -0300 Subject: [PATCH 10/10] operator(apps): don't duplicate `TEMBO_INSTANCE_ID`, `TEMBO_ORG_ID` (#925) --- tembo-operator/src/app_service/manager.rs | 37 +++++++++++++++-------- tembo-operator/src/extensions/toggle.rs | 2 +- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/tembo-operator/src/app_service/manager.rs b/tembo-operator/src/app_service/manager.rs index 63ed9d712..cd227c0a8 100644 --- a/tembo-operator/src/app_service/manager.rs +++ b/tembo-operator/src/app_service/manager.rs @@ -24,7 +24,7 @@ use kube::{ Client, Resource, }; use lazy_static::lazy_static; -use std::{collections::BTreeMap, sync::Arc, time::Duration}; +use std::{collections::BTreeMap, ops::Not, sync::Arc, time::Duration}; use crate::{ app_service::ingress::{generate_ingress_tcp_routes, reconcile_ingress_tcp}, @@ -432,21 +432,32 @@ fn generate_deployment( } } + let has_instance_id = env_vars.iter().any(|env| env.name == "TEMBO_INSTANCE_ID"); + let has_org_id = env_vars.iter().any(|env| env.name == "TEMBO_ORG_ID"); + // Check for tembo.io/instance_id and tembo.io/organization_id annotations - if let Some(instance_id) = annotations.get("tembo.io/instance_id") { - env_vars.push(EnvVar { - name: "TEMBO_INSTANCE_ID".to_string(), - value: Some(instance_id.clone()), - ..EnvVar::default() - }); + if has_instance_id.not() { + if let Some(instance_id) = annotations.get("tembo.io/instance_id") { + env_vars.push(EnvVar { + name: "TEMBO_INSTANCE_ID".to_string(), + value: Some(instance_id.clone()), + ..EnvVar::default() + }); + } + } else { + tracing::info!("Not applying TEMBO_INSTANCE_ID to env since it's already present"); } - if let Some(organization_id) = annotations.get("tembo.io/organization_id") { - env_vars.push(EnvVar { - name: "TEMBO_ORG_ID".to_string(), - value: Some(organization_id.clone()), - ..EnvVar::default() - }); + if has_org_id.not() { + if let Some(organization_id) = annotations.get("tembo.io/organization_id") { + env_vars.push(EnvVar { + name: "TEMBO_ORG_ID".to_string(), + value: Some(organization_id.clone()), + ..EnvVar::default() + }); + } + } else { + tracing::info!("Not applying TEMBO_ORG_ID to env since it's already present"); } // Add the pre-loaded forwarded environment variables diff --git a/tembo-operator/src/extensions/toggle.rs b/tembo-operator/src/extensions/toggle.rs index ba6b92887..a9005fb13 100644 --- a/tembo-operator/src/extensions/toggle.rs +++ b/tembo-operator/src/extensions/toggle.rs @@ -495,7 +495,7 @@ async fn get_trunk_project_version( if let Some(extension_version) = &location_to_toggle.version { let maybe_trunk_project = get_trunk_project_metadata_for_version( trunk_project_name, - trunk::Version::Extension(&extension_version), + trunk::Version::Extension(extension_version), ) .await;