From 46f9d14666c43e5ec324071d9ea42f79db6a88c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Barbosa?= Date: Wed, 1 Nov 2023 16:49:18 -0300 Subject: [PATCH 1/6] enabling postgresql read replica usage --- deploy/marlowe-runtime/templates/chain-sync.yaml | 2 +- deploy/marlowe-runtime/templates/marlowe-sync.yaml | 2 +- deploy/marlowe-runtime/values.yaml | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/deploy/marlowe-runtime/templates/chain-sync.yaml b/deploy/marlowe-runtime/templates/chain-sync.yaml index 11fae497f3..96d1dd0c58 100644 --- a/deploy/marlowe-runtime/templates/chain-sync.yaml +++ b/deploy/marlowe-runtime/templates/chain-sync.yaml @@ -36,7 +36,7 @@ spec: - name: DB_NAME value: chainsync_{{ $instanceName }}_{{ $network }} - name: DB_HOST - value: {{ $.Values.databaseHost }}:5432 + value: {{ $.Values.databaseReadReplica }}:5432 - name: DB_USER valueFrom: secretKeyRef: diff --git a/deploy/marlowe-runtime/templates/marlowe-sync.yaml b/deploy/marlowe-runtime/templates/marlowe-sync.yaml index 9f5c8034fc..2e32b64578 100644 --- a/deploy/marlowe-runtime/templates/marlowe-sync.yaml +++ b/deploy/marlowe-runtime/templates/marlowe-sync.yaml @@ -44,7 +44,7 @@ spec: name: chainsync-{{ $network }}-owner-user.{{ $.Values.databaseName }}.credentials.postgresql.acid.zalan.do namespace: {{ $.Values.namespace }} - name: DB_HOST - value: {{ $.Values.databaseHost }}:5432 + value: {{ $.Values.databaseReadReplica }}:5432 - name: HTTP_PORT value: "3784" - name: OTEL_EXPORTER_OTLP_ENDPOINT diff --git a/deploy/marlowe-runtime/values.yaml b/deploy/marlowe-runtime/values.yaml index cf292c1782..d2e536423e 100644 --- a/deploy/marlowe-runtime/values.yaml +++ b/deploy/marlowe-runtime/values.yaml @@ -24,3 +24,5 @@ releaseName: marlowe-runtime databaseName: marlowe-runtime-database databaseHost: dapps-marlowe-runtime-database.csguv6v6ban1.us-east-1.rds.amazonaws.com + +databaseReadReplica: dapps-marlowe-runtime-database-read-0.csguv6v6ban1.us-east-1.rds.amazonaws.com \ No newline at end of file From 8392c7b873eec75e08afea6481996aa5dcb4764c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Barbosa?= Date: Wed, 1 Nov 2023 16:49:47 -0300 Subject: [PATCH 2/6] enable hpa on marlowe-web-server --- deploy/marlowe-runtime/templates/marlowe-web-server.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deploy/marlowe-runtime/templates/marlowe-web-server.yaml b/deploy/marlowe-runtime/templates/marlowe-web-server.yaml index cf12e2a6cb..823089e8e7 100644 --- a/deploy/marlowe-runtime/templates/marlowe-web-server.yaml +++ b/deploy/marlowe-runtime/templates/marlowe-web-server.yaml @@ -34,6 +34,11 @@ spec: port: 3780 protocol: TCP traits: + - type: cpuscaler + properties: + min: 1 + max: 10 + cpuUtil: 50 - type: https-route properties: domains: From 7520201b81f73fd38d0d45a969f43c0ae0b9219c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Barbosa?= Date: Wed, 1 Nov 2023 16:50:00 -0300 Subject: [PATCH 3/6] bump chart version --- deploy/marlowe-runtime/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/marlowe-runtime/Chart.yaml b/deploy/marlowe-runtime/Chart.yaml index 062899d152..05e82235f9 100644 --- a/deploy/marlowe-runtime/Chart.yaml +++ b/deploy/marlowe-runtime/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: marlowe-runtime -version: v0.0.33 +version: v0.0.34 appVersion: v0.0.5 description: Marlowe smart contract language Cardano implementation home: https://marlowe.iohk.io From 340dd09299f83ed27980d952cd31aaa980eac022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Barbosa?= Date: Wed, 1 Nov 2023 17:02:17 -0300 Subject: [PATCH 4/6] enable hpa for everything but indexers --- deploy/marlowe-runtime/templates/chain-sync.yaml | 6 +++++- deploy/marlowe-runtime/templates/marlowe-contract.yaml | 5 +++++ deploy/marlowe-runtime/templates/marlowe-proxy.yaml | 6 +++++- deploy/marlowe-runtime/templates/marlowe-sync.yaml | 6 ++++++ deploy/marlowe-runtime/templates/marlowe-tx.yaml | 6 ++++++ deploy/marlowe-runtime/templates/marlowe-web-server.yaml | 2 +- 6 files changed, 28 insertions(+), 3 deletions(-) diff --git a/deploy/marlowe-runtime/templates/chain-sync.yaml b/deploy/marlowe-runtime/templates/chain-sync.yaml index 96d1dd0c58..ed78433839 100644 --- a/deploy/marlowe-runtime/templates/chain-sync.yaml +++ b/deploy/marlowe-runtime/templates/chain-sync.yaml @@ -94,7 +94,11 @@ spec: volumes: - name: ipc path: /ipc - + - type: cpuscaler + properties: + min: 1 + max: 10 + cpuUtil: 70 policies: - name: local-{{ $.Values.namespace }} properties: diff --git a/deploy/marlowe-runtime/templates/marlowe-contract.yaml b/deploy/marlowe-runtime/templates/marlowe-contract.yaml index c39a3a61ac..60cd52774c 100644 --- a/deploy/marlowe-runtime/templates/marlowe-contract.yaml +++ b/deploy/marlowe-runtime/templates/marlowe-contract.yaml @@ -67,6 +67,11 @@ spec: resources: requests: storage: 200Gi + - type: cpuscaler + properties: + min: 1 + max: 10 + cpuUtil: 70 policies: - name: local-{{ $.Values.namespace }} properties: diff --git a/deploy/marlowe-runtime/templates/marlowe-proxy.yaml b/deploy/marlowe-runtime/templates/marlowe-proxy.yaml index eb9fca5b56..e54aa46d21 100644 --- a/deploy/marlowe-runtime/templates/marlowe-proxy.yaml +++ b/deploy/marlowe-runtime/templates/marlowe-proxy.yaml @@ -63,7 +63,11 @@ spec: - port: 3700 - port: 3701 - port: 3786 - + - type: cpuscaler + properties: + min: 1 + max: 10 + cpuUtil: 70 policies: - name: local-{{ $.Values.namespace }} diff --git a/deploy/marlowe-runtime/templates/marlowe-sync.yaml b/deploy/marlowe-runtime/templates/marlowe-sync.yaml index 2e32b64578..dae537c9a3 100644 --- a/deploy/marlowe-runtime/templates/marlowe-sync.yaml +++ b/deploy/marlowe-runtime/templates/marlowe-sync.yaml @@ -71,6 +71,12 @@ spec: - expose: true port: 3784 protocol: TCP + traits: + - type: cpuscaler + properties: + min: 1 + max: 10 + cpuUtil: 70 policies: - name: local-{{ $.Values.namespace }} properties: diff --git a/deploy/marlowe-runtime/templates/marlowe-tx.yaml b/deploy/marlowe-runtime/templates/marlowe-tx.yaml index 2f237efea4..cc2deafceb 100644 --- a/deploy/marlowe-runtime/templates/marlowe-tx.yaml +++ b/deploy/marlowe-runtime/templates/marlowe-tx.yaml @@ -48,6 +48,12 @@ spec: - expose: true port: 3785 protocol: TCP + traits: + - type: cpuscaler + properties: + min: 1 + max: 10 + cpuUtil: 70 policies: - name: local-{{ $.Values.namespace }} properties: diff --git a/deploy/marlowe-runtime/templates/marlowe-web-server.yaml b/deploy/marlowe-runtime/templates/marlowe-web-server.yaml index 823089e8e7..09549d0957 100644 --- a/deploy/marlowe-runtime/templates/marlowe-web-server.yaml +++ b/deploy/marlowe-runtime/templates/marlowe-web-server.yaml @@ -38,7 +38,7 @@ spec: properties: min: 1 max: 10 - cpuUtil: 50 + cpuUtil: 70 - type: https-route properties: domains: From 6e39bbddf7c2d090e0e33fc8c3232a0bbc15931b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Barbosa?= Date: Wed, 1 Nov 2023 21:00:56 -0300 Subject: [PATCH 5/6] Revert "enable hpa for everything but indexers" This reverts commit 22e864d087f3601f26dc15e16e52dc98e51e65ed. --- deploy/marlowe-runtime/templates/chain-sync.yaml | 6 +----- deploy/marlowe-runtime/templates/marlowe-contract.yaml | 5 ----- deploy/marlowe-runtime/templates/marlowe-proxy.yaml | 6 +----- deploy/marlowe-runtime/templates/marlowe-sync.yaml | 6 ------ deploy/marlowe-runtime/templates/marlowe-tx.yaml | 6 ------ deploy/marlowe-runtime/templates/marlowe-web-server.yaml | 2 +- 6 files changed, 3 insertions(+), 28 deletions(-) diff --git a/deploy/marlowe-runtime/templates/chain-sync.yaml b/deploy/marlowe-runtime/templates/chain-sync.yaml index ed78433839..96d1dd0c58 100644 --- a/deploy/marlowe-runtime/templates/chain-sync.yaml +++ b/deploy/marlowe-runtime/templates/chain-sync.yaml @@ -94,11 +94,7 @@ spec: volumes: - name: ipc path: /ipc - - type: cpuscaler - properties: - min: 1 - max: 10 - cpuUtil: 70 + policies: - name: local-{{ $.Values.namespace }} properties: diff --git a/deploy/marlowe-runtime/templates/marlowe-contract.yaml b/deploy/marlowe-runtime/templates/marlowe-contract.yaml index 60cd52774c..c39a3a61ac 100644 --- a/deploy/marlowe-runtime/templates/marlowe-contract.yaml +++ b/deploy/marlowe-runtime/templates/marlowe-contract.yaml @@ -67,11 +67,6 @@ spec: resources: requests: storage: 200Gi - - type: cpuscaler - properties: - min: 1 - max: 10 - cpuUtil: 70 policies: - name: local-{{ $.Values.namespace }} properties: diff --git a/deploy/marlowe-runtime/templates/marlowe-proxy.yaml b/deploy/marlowe-runtime/templates/marlowe-proxy.yaml index e54aa46d21..eb9fca5b56 100644 --- a/deploy/marlowe-runtime/templates/marlowe-proxy.yaml +++ b/deploy/marlowe-runtime/templates/marlowe-proxy.yaml @@ -63,11 +63,7 @@ spec: - port: 3700 - port: 3701 - port: 3786 - - type: cpuscaler - properties: - min: 1 - max: 10 - cpuUtil: 70 + policies: - name: local-{{ $.Values.namespace }} diff --git a/deploy/marlowe-runtime/templates/marlowe-sync.yaml b/deploy/marlowe-runtime/templates/marlowe-sync.yaml index dae537c9a3..2e32b64578 100644 --- a/deploy/marlowe-runtime/templates/marlowe-sync.yaml +++ b/deploy/marlowe-runtime/templates/marlowe-sync.yaml @@ -71,12 +71,6 @@ spec: - expose: true port: 3784 protocol: TCP - traits: - - type: cpuscaler - properties: - min: 1 - max: 10 - cpuUtil: 70 policies: - name: local-{{ $.Values.namespace }} properties: diff --git a/deploy/marlowe-runtime/templates/marlowe-tx.yaml b/deploy/marlowe-runtime/templates/marlowe-tx.yaml index cc2deafceb..2f237efea4 100644 --- a/deploy/marlowe-runtime/templates/marlowe-tx.yaml +++ b/deploy/marlowe-runtime/templates/marlowe-tx.yaml @@ -48,12 +48,6 @@ spec: - expose: true port: 3785 protocol: TCP - traits: - - type: cpuscaler - properties: - min: 1 - max: 10 - cpuUtil: 70 policies: - name: local-{{ $.Values.namespace }} properties: diff --git a/deploy/marlowe-runtime/templates/marlowe-web-server.yaml b/deploy/marlowe-runtime/templates/marlowe-web-server.yaml index 09549d0957..823089e8e7 100644 --- a/deploy/marlowe-runtime/templates/marlowe-web-server.yaml +++ b/deploy/marlowe-runtime/templates/marlowe-web-server.yaml @@ -38,7 +38,7 @@ spec: properties: min: 1 max: 10 - cpuUtil: 70 + cpuUtil: 50 - type: https-route properties: domains: From 3b3cb483b96c2b531875195719ebaec8c2fa5e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20Barbosa?= Date: Thu, 2 Nov 2023 09:33:47 -0300 Subject: [PATCH 6/6] disabling cpuscaler trait on web-server --- deploy/marlowe-runtime/templates/marlowe-web-server.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/deploy/marlowe-runtime/templates/marlowe-web-server.yaml b/deploy/marlowe-runtime/templates/marlowe-web-server.yaml index 823089e8e7..cf12e2a6cb 100644 --- a/deploy/marlowe-runtime/templates/marlowe-web-server.yaml +++ b/deploy/marlowe-runtime/templates/marlowe-web-server.yaml @@ -34,11 +34,6 @@ spec: port: 3780 protocol: TCP traits: - - type: cpuscaler - properties: - min: 1 - max: 10 - cpuUtil: 50 - type: https-route properties: domains: