From c39390553f9c3913d24c90ff96349ccc8e2524bb Mon Sep 17 00:00:00 2001 From: April Rieger Date: Wed, 21 Feb 2024 12:37:25 -0800 Subject: [PATCH 01/18] Trying to establish a pattern --- hyrax/templates/import-deployment-worker.yaml | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/hyrax/templates/import-deployment-worker.yaml b/hyrax/templates/import-deployment-worker.yaml index 15a07c44..ebbd8662 100644 --- a/hyrax/templates/import-deployment-worker.yaml +++ b/hyrax/templates/import-deployment-worker.yaml @@ -33,8 +33,14 @@ spec: name: app-secrets {{- end }} env: - {{- toYaml .Values.worker.extraEnvVars | nindent 12 }} - {{- toYaml .Values.importWorker.extraEnvVars | nindent 12 }} + {{- range .worker.extraEnvVars }} + - name: {{ .name }} + value: {{ .value | quote }} + {{- end }} + {{- range .Values.importWorker.extraEnvVars }} + - name: {{ .name }} + value: {{ .value | quote }} + {{- end }} command: - sh - -c @@ -77,8 +83,14 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} env: - {{- toYaml .Values.worker.extraEnvVars | nindent 12 }} - {{- toYaml .Values.importWorker.extraEnvVars | nindent 12 }} + {{- range .worker.extraEnvVars }} + - name: {{ .name }} + value: {{ .value | quote }} + {{- end }} + {{- range .Values.importWorker.extraEnvVars }} + - name: {{ .name }} + value: {{ .value | quote }} + {{- end }} {{- if .Values.worker.readinessProbe.enabled }} readinessProbe: exec: From 9ea9488ef1b6aa3a2677c125e33fcfa686474cbf Mon Sep 17 00:00:00 2001 From: April Rieger Date: Wed, 21 Feb 2024 12:56:05 -0800 Subject: [PATCH 02/18] Adds comments and fix the .Values --- hyrax/templates/import-deployment-worker.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hyrax/templates/import-deployment-worker.yaml b/hyrax/templates/import-deployment-worker.yaml index ebbd8662..493bbb7c 100644 --- a/hyrax/templates/import-deployment-worker.yaml +++ b/hyrax/templates/import-deployment-worker.yaml @@ -33,10 +33,12 @@ spec: name: app-secrets {{- end }} env: - {{- range .worker.extraEnvVars }} + # Include all environment variables from worker.extraEnvVars + {{- range .Values.worker.extraEnvVars }} - name: {{ .name }} value: {{ .value | quote }} {{- end }} + # Override or add specific environment variables for the import worker {{- range .Values.importWorker.extraEnvVars }} - name: {{ .name }} value: {{ .value | quote }} @@ -83,10 +85,12 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} env: - {{- range .worker.extraEnvVars }} + # Include all environment variables from worker.extraEnvVars + {{- range .Values.worker.extraEnvVars }} - name: {{ .name }} value: {{ .value | quote }} {{- end }} + # Override or add specific environment variables for the import worker {{- range .Values.importWorker.extraEnvVars }} - name: {{ .name }} value: {{ .value | quote }} From 93dbf05fb36f21d68814f03cc7827744d5243873 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Wed, 21 Feb 2024 13:08:52 -0800 Subject: [PATCH 03/18] Shakes fist, needed to change the demo reg values to SIDEKIQ_CONCURRENCY = 1, so I can test that this works, just like production has it set --- ops/demo-deploy.tmpl.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ops/demo-deploy.tmpl.yaml b/ops/demo-deploy.tmpl.yaml index 28a17065..be6182f4 100644 --- a/ops/demo-deploy.tmpl.yaml +++ b/ops/demo-deploy.tmpl.yaml @@ -117,7 +117,7 @@ extraEnvVars: &envVars - name: SOLR_URL value: http://10.0.4.190:8983/solr/ams - name: SIDEKIQ_CONCURRENCY - value: "10" + value: "1" - name: AWS_ACCESS_KEY value: "AKIAIWFN3WW3WBIMKNCQ" - name: MAIL_DELIVERY_METHOD From a23bcfff669ef64f24c7136db499e45ec336e2e7 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Wed, 21 Feb 2024 13:38:01 -0800 Subject: [PATCH 04/18] Double fist shake, had to turn a replica on to even deploy the bloody thing lol --- ops/demo-deploy.tmpl.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ops/demo-deploy.tmpl.yaml b/ops/demo-deploy.tmpl.yaml index be6182f4..2d9cea42 100644 --- a/ops/demo-deploy.tmpl.yaml +++ b/ops/demo-deploy.tmpl.yaml @@ -141,7 +141,7 @@ extraEnvVars: &envVars worker: replicaCount: 1 - importReplicaCount: 0 + importReplicaCount: 1 podSecurityContext: runAsUser: 1001 runAsGroup: 101 From b1d51d414add279df04e20b1ebc08ab4b5aa09e5 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Wed, 21 Feb 2024 13:54:28 -0800 Subject: [PATCH 05/18] Ok lets set the variable and add the values via the values file, so the dev user will still see the pattern and know how to use it --- hyrax/templates/import-deployment-worker.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hyrax/templates/import-deployment-worker.yaml b/hyrax/templates/import-deployment-worker.yaml index 493bbb7c..f01cdb12 100644 --- a/hyrax/templates/import-deployment-worker.yaml +++ b/hyrax/templates/import-deployment-worker.yaml @@ -39,10 +39,8 @@ spec: value: {{ .value | quote }} {{- end }} # Override or add specific environment variables for the import worker - {{- range .Values.importWorker.extraEnvVars }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end }} + - name: "SIDEKIQ_CONCURRENCY" + value: {{ .Values.importWorker.extraEnvVars.SIDEKIQ_CONCURRENCY | quote }} command: - sh - -c From 1fec6a346a0f10b05271ffab2d15d9b1214781f8 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Wed, 21 Feb 2024 14:20:46 -0800 Subject: [PATCH 06/18] Add to both sections --- hyrax/templates/import-deployment-worker.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hyrax/templates/import-deployment-worker.yaml b/hyrax/templates/import-deployment-worker.yaml index f01cdb12..0611971f 100644 --- a/hyrax/templates/import-deployment-worker.yaml +++ b/hyrax/templates/import-deployment-worker.yaml @@ -89,10 +89,8 @@ spec: value: {{ .value | quote }} {{- end }} # Override or add specific environment variables for the import worker - {{- range .Values.importWorker.extraEnvVars }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end }} + - name: "SIDEKIQ_CONCURRENCY" + value: {{ .Values.importWorker.extraEnvVars.SIDEKIQ_CONCURRENCY | quote }} {{- if .Values.worker.readinessProbe.enabled }} readinessProbe: exec: From fcc9042aae7f7577f60ff80fa6a33c290794796b Mon Sep 17 00:00:00 2001 From: April Rieger Date: Wed, 21 Feb 2024 14:24:07 -0800 Subject: [PATCH 07/18] Updates to the updated version due to issue with sytax in deploy --- hyrax/templates/import-deployment-worker.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hyrax/templates/import-deployment-worker.yaml b/hyrax/templates/import-deployment-worker.yaml index 0611971f..48143203 100644 --- a/hyrax/templates/import-deployment-worker.yaml +++ b/hyrax/templates/import-deployment-worker.yaml @@ -33,14 +33,18 @@ spec: name: app-secrets {{- end }} env: - # Include all environment variables from worker.extraEnvVars - {{- range .Values.worker.extraEnvVars }} + # Include env vars from worker.extraEnvVars except SIDEKIQ_CONCURRENCY + {{- range .Values.worker.extraEnvVars }} + {{- if ne .name "SIDEKIQ_CONCURRENCY" }} - name: {{ .name }} value: {{ .value | quote }} {{- end }} - # Override or add specific environment variables for the import worker - - name: "SIDEKIQ_CONCURRENCY" - value: {{ .Values.importWorker.extraEnvVars.SIDEKIQ_CONCURRENCY | quote }} + {{- end }} + # Set SIDEKIQ_CONCURRENCY for import worker + {{- range .Values.importWorker.extraEnvVars }} + - name: {{ .name }} + value: {{ .value | quote }} + {{- end }} command: - sh - -c From 29df467045aa72493d835a284f8cc11bf647b1b6 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Wed, 21 Feb 2024 14:53:33 -0800 Subject: [PATCH 08/18] updates both places take 2 --- hyrax/templates/import-deployment-worker.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hyrax/templates/import-deployment-worker.yaml b/hyrax/templates/import-deployment-worker.yaml index 48143203..65ebaf6a 100644 --- a/hyrax/templates/import-deployment-worker.yaml +++ b/hyrax/templates/import-deployment-worker.yaml @@ -87,14 +87,18 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} env: - # Include all environment variables from worker.extraEnvVars + # Include env vars from worker.extraEnvVars except SIDEKIQ_CONCURRENCY {{- range .Values.worker.extraEnvVars }} - - name: {{ .name }} - value: {{ .value | quote }} + {{- if ne .name "SIDEKIQ_CONCURRENCY" }} + - name: {{ .name }} + value: {{ .value | quote }} + {{- end }} + {{- end }} + # Set SIDEKIQ_CONCURRENCY for import worker + {{- range .Values.importWorker.extraEnvVars }} + - name: {{ .name }} + value: {{ .value | quote }} {{- end }} - # Override or add specific environment variables for the import worker - - name: "SIDEKIQ_CONCURRENCY" - value: {{ .Values.importWorker.extraEnvVars.SIDEKIQ_CONCURRENCY | quote }} {{- if .Values.worker.readinessProbe.enabled }} readinessProbe: exec: From 8fce7bfa612006adb7b39d1468f53a397acf3e5a Mon Sep 17 00:00:00 2001 From: April Rieger Date: Wed, 21 Feb 2024 15:32:28 -0800 Subject: [PATCH 09/18] Trying to get the updated value to override, but that wasn't working so tried getting the variable excluded, and then try to include it the same way, but that didnt work. So now trying to explicitly add it back to pass to the deployment - heavy sigh - --- hyrax/templates/import-deployment-worker.yaml | 28 ++++++++----------- ops/demo-deploy.tmpl.yaml | 4 +-- 2 files changed, 12 insertions(+), 20 deletions(-) diff --git a/hyrax/templates/import-deployment-worker.yaml b/hyrax/templates/import-deployment-worker.yaml index 65ebaf6a..b47e7f86 100644 --- a/hyrax/templates/import-deployment-worker.yaml +++ b/hyrax/templates/import-deployment-worker.yaml @@ -33,18 +33,15 @@ spec: name: app-secrets {{- end }} env: - # Include env vars from worker.extraEnvVars except SIDEKIQ_CONCURRENCY - {{- range .Values.worker.extraEnvVars }} - {{- if ne .name "SIDEKIQ_CONCURRENCY" }} - - name: {{ .name }} - value: {{ .value | quote }} + # Include env vars from worker.extraEnvVars except SIDEKIQ_CONCURRENCY + {{- range .Values.worker.extraEnvVars }} + {{- if ne .name "SIDEKIQ_CONCURRENCY" }} + - name: {{ .name }} + value: {{ .value | quote }} + {{- end }} {{- end }} - {{- end }} - # Set SIDEKIQ_CONCURRENCY for import worker - {{- range .Values.importWorker.extraEnvVars }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end }} + - name: "SIDEKIQ_CONCURRENCY" + value: {{ .Values.importWorker.SIDEKIQ_CONCURRENCY }} command: - sh - -c @@ -87,18 +84,15 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} env: - # Include env vars from worker.extraEnvVars except SIDEKIQ_CONCURRENCY + # Include env vars from worker.extraEnvVars except SIDEKIQ_CONCURRENCY {{- range .Values.worker.extraEnvVars }} {{- if ne .name "SIDEKIQ_CONCURRENCY" }} - name: {{ .name }} value: {{ .value | quote }} {{- end }} {{- end }} - # Set SIDEKIQ_CONCURRENCY for import worker - {{- range .Values.importWorker.extraEnvVars }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end }} + - name: "SIDEKIQ_CONCURRENCY" + value: {{ .Values.importWorker.SIDEKIQ_CONCURRENCY }} {{- if .Values.worker.readinessProbe.enabled }} readinessProbe: exec: diff --git a/ops/demo-deploy.tmpl.yaml b/ops/demo-deploy.tmpl.yaml index 2d9cea42..6d3ba7cb 100644 --- a/ops/demo-deploy.tmpl.yaml +++ b/ops/demo-deploy.tmpl.yaml @@ -151,9 +151,7 @@ worker: extraEnvVars: *envVars importWorker: - extraEnvVars: - - name: SIDEKIQ_CONCURRENCY - value: "10" + SIDEKIQ_CONCURRENCY: "10" podSecurityContext: runAsUser: 1001 From 0d69274579d2f8f26675f878dde4fbb43a892ba8 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Wed, 21 Feb 2024 15:43:34 -0800 Subject: [PATCH 10/18] Update the indentation --- hyrax/templates/import-deployment-worker.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hyrax/templates/import-deployment-worker.yaml b/hyrax/templates/import-deployment-worker.yaml index b47e7f86..d66563b6 100644 --- a/hyrax/templates/import-deployment-worker.yaml +++ b/hyrax/templates/import-deployment-worker.yaml @@ -40,8 +40,8 @@ spec: value: {{ .value | quote }} {{- end }} {{- end }} - - name: "SIDEKIQ_CONCURRENCY" - value: {{ .Values.importWorker.SIDEKIQ_CONCURRENCY }} + - name: "SIDEKIQ_CONCURRENCY" + value: {{ .Values.importWorker.SIDEKIQ_CONCURRENCY }} command: - sh - -c @@ -91,8 +91,8 @@ spec: value: {{ .value | quote }} {{- end }} {{- end }} - - name: "SIDEKIQ_CONCURRENCY" - value: {{ .Values.importWorker.SIDEKIQ_CONCURRENCY }} + - name: "SIDEKIQ_CONCURRENCY" + value: {{ .Values.importWorker.SIDEKIQ_CONCURRENCY }} {{- if .Values.worker.readinessProbe.enabled }} readinessProbe: exec: From e1f1ddae41823637ecefa243e313330e209beb51 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Wed, 21 Feb 2024 15:55:51 -0800 Subject: [PATCH 11/18] Update to prod values for the env var, finally making it through the deploy --- ops/prod-deploy.tmpl.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ops/prod-deploy.tmpl.yaml b/ops/prod-deploy.tmpl.yaml index e638a943..ac998201 100644 --- a/ops/prod-deploy.tmpl.yaml +++ b/ops/prod-deploy.tmpl.yaml @@ -156,9 +156,7 @@ worker: extraEnvVars: *envVars importWorker: - extraEnvVars: - - name: SIDEKIQ_CONCURRENCY - value: "10" + SIDEKIQ_CONCURRENCY: "20" podSecurityContext: runAsUser: 1001 From 0ab385a448f5f74dc63b07f553be0d5a4ca24b8c Mon Sep 17 00:00:00 2001 From: April Rieger Date: Wed, 21 Feb 2024 16:17:22 -0800 Subject: [PATCH 12/18] Update the strategy so we can make this more useful and use a list if needed for more overrides --- hyrax/templates/import-deployment-worker.yaml | 27 ++++++------------- ops/demo-deploy.tmpl.yaml | 4 ++- ops/prod-deploy.tmpl.yaml | 4 ++- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/hyrax/templates/import-deployment-worker.yaml b/hyrax/templates/import-deployment-worker.yaml index d66563b6..5e1d198d 100644 --- a/hyrax/templates/import-deployment-worker.yaml +++ b/hyrax/templates/import-deployment-worker.yaml @@ -33,15 +33,10 @@ spec: name: app-secrets {{- end }} env: - # Include env vars from worker.extraEnvVars except SIDEKIQ_CONCURRENCY - {{- range .Values.worker.extraEnvVars }} - {{- if ne .name "SIDEKIQ_CONCURRENCY" }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end }} - {{- end }} - - name: "SIDEKIQ_CONCURRENCY" - value: {{ .Values.importWorker.SIDEKIQ_CONCURRENCY }} + {{- $defaultEnv := .Values.worker.extraEnvVars }} + {{- $overrideEnv := .Values.importWorker.extraEnvVars }} + {{- $mergedEnv := merge $overrideEnv $defaultEnv }} + {{- toYaml $mergedEnv | nindent 12 }} command: - sh - -c @@ -84,16 +79,10 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} env: - # Include env vars from worker.extraEnvVars except SIDEKIQ_CONCURRENCY - {{- range .Values.worker.extraEnvVars }} - {{- if ne .name "SIDEKIQ_CONCURRENCY" }} - - name: {{ .name }} - value: {{ .value | quote }} - {{- end }} - {{- end }} - - name: "SIDEKIQ_CONCURRENCY" - value: {{ .Values.importWorker.SIDEKIQ_CONCURRENCY }} - {{- if .Values.worker.readinessProbe.enabled }} + {{- $defaultEnv := .Values.worker.extraEnvVars }} + {{- $overrideEnv := .Values.importWorker.extraEnvVars }} + {{- $mergedEnv := merge $overrideEnv $defaultEnv }} + {{- toYaml $mergedEnv | nindent 12 }} readinessProbe: exec: command: diff --git a/ops/demo-deploy.tmpl.yaml b/ops/demo-deploy.tmpl.yaml index 6d3ba7cb..c0232b8a 100644 --- a/ops/demo-deploy.tmpl.yaml +++ b/ops/demo-deploy.tmpl.yaml @@ -151,7 +151,9 @@ worker: extraEnvVars: *envVars importWorker: - SIDEKIQ_CONCURRENCY: "10" + extraEnvVars:: + - name: SIDEKIQ_CONCURRENCY + value: "10" podSecurityContext: runAsUser: 1001 diff --git a/ops/prod-deploy.tmpl.yaml b/ops/prod-deploy.tmpl.yaml index ac998201..97201d07 100644 --- a/ops/prod-deploy.tmpl.yaml +++ b/ops/prod-deploy.tmpl.yaml @@ -156,7 +156,9 @@ worker: extraEnvVars: *envVars importWorker: - SIDEKIQ_CONCURRENCY: "20" + extraEnvVars:: + - name: SIDEKIQ_CONCURRENCY + value: "20" podSecurityContext: runAsUser: 1001 From 3df8a017543745c2d57b7786584e2d467f6db0b6 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Wed, 21 Feb 2024 16:43:30 -0800 Subject: [PATCH 13/18] fix syntax --- ops/demo-deploy.tmpl.yaml | 2 +- ops/prod-deploy.tmpl.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ops/demo-deploy.tmpl.yaml b/ops/demo-deploy.tmpl.yaml index c0232b8a..2d9cea42 100644 --- a/ops/demo-deploy.tmpl.yaml +++ b/ops/demo-deploy.tmpl.yaml @@ -151,7 +151,7 @@ worker: extraEnvVars: *envVars importWorker: - extraEnvVars:: + extraEnvVars: - name: SIDEKIQ_CONCURRENCY value: "10" diff --git a/ops/prod-deploy.tmpl.yaml b/ops/prod-deploy.tmpl.yaml index 97201d07..b567e0b1 100644 --- a/ops/prod-deploy.tmpl.yaml +++ b/ops/prod-deploy.tmpl.yaml @@ -156,7 +156,7 @@ worker: extraEnvVars: *envVars importWorker: - extraEnvVars:: + extraEnvVars: - name: SIDEKIQ_CONCURRENCY value: "20" From 65db11c7785e2f4a0f9cdde24b857823ec5aced6 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Wed, 21 Feb 2024 18:29:41 -0800 Subject: [PATCH 14/18] This works with helm template, when i inspect the file the correct env takes precedence --- hyrax/templates/import-deployment-worker.yaml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/hyrax/templates/import-deployment-worker.yaml b/hyrax/templates/import-deployment-worker.yaml index 5e1d198d..5f6fc7a4 100644 --- a/hyrax/templates/import-deployment-worker.yaml +++ b/hyrax/templates/import-deployment-worker.yaml @@ -33,10 +33,8 @@ spec: name: app-secrets {{- end }} env: - {{- $defaultEnv := .Values.worker.extraEnvVars }} - {{- $overrideEnv := .Values.importWorker.extraEnvVars }} - {{- $mergedEnv := merge $overrideEnv $defaultEnv }} - {{- toYaml $mergedEnv | nindent 12 }} + {{- toYaml .Values.worker.extraEnvVars | nindent 12 }} + {{- toYaml .Values.importWorker.extraEnvVars | nindent 12 }} command: - sh - -c @@ -79,10 +77,9 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} env: - {{- $defaultEnv := .Values.worker.extraEnvVars }} - {{- $overrideEnv := .Values.importWorker.extraEnvVars }} - {{- $mergedEnv := merge $overrideEnv $defaultEnv }} - {{- toYaml $mergedEnv | nindent 12 }} + {{- toYaml .Values.worker.extraEnvVars | nindent 12 }} + {{- toYaml .Values.importWorker.extraEnvVars | nindent 12 }} + {{- if .Values.worker.readinessProbe.enabled }} readinessProbe: exec: command: From 68704637c7d8b57866c98e2b2ce5d43eadae1c02 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Wed, 21 Feb 2024 23:36:14 -0800 Subject: [PATCH 15/18] Takes and put the logic checking for the specific env variable into the worker script. And only set that env variable in the importWorker so that the reg worker will just use the default or one set in the deployment extraEnvVars --- bin/worker | 5 +++++ hyrax/templates/import-deployment-worker.yaml | 2 +- ops/demo-deploy.tmpl.yaml | 7 +++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/worker b/bin/worker index 840e9128..2899cce4 100755 --- a/bin/worker +++ b/bin/worker @@ -10,6 +10,11 @@ if ENV['AAPB_HOST'] %x{mkdir ~/.ssh && ssh-keyscan $AAPB_HOST >> ~/.ssh/known_hosts} end +# Dynamically set SIDEKIQ_CONCURRENCY based on the worker type +if ENV['IMPORT_WORKER_SIDEKIQ_CONCURRENCY'] + ENV['SIDEKIQ_CONCURRENCY'] = ENV.fetch('IMPORT_WORKER_SIDEKIQ_CONCURRENCY', '10') +end + queues = if !ARGV.empty? ' -q ' + ARGV.join(' -q ') else diff --git a/hyrax/templates/import-deployment-worker.yaml b/hyrax/templates/import-deployment-worker.yaml index 5f6fc7a4..ae8045dd 100644 --- a/hyrax/templates/import-deployment-worker.yaml +++ b/hyrax/templates/import-deployment-worker.yaml @@ -1,4 +1,4 @@ -{{- if .Values.worker.enabled }} +{{- if .Values.importWorker.enabled }} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/ops/demo-deploy.tmpl.yaml b/ops/demo-deploy.tmpl.yaml index 2d9cea42..8a879b40 100644 --- a/ops/demo-deploy.tmpl.yaml +++ b/ops/demo-deploy.tmpl.yaml @@ -151,9 +151,12 @@ worker: extraEnvVars: *envVars importWorker: + enabled: true + # extraEnvVars will not handle overriden values + # only additional to the original workerEnvVars list extraEnvVars: - - name: SIDEKIQ_CONCURRENCY - value: "10" + - name: IMPORT_WORKER_SIDEKIQ_CONCURRENCY + value: "20" podSecurityContext: runAsUser: 1001 From fa93495e26db3b91b64509af6e0f494035e38737 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Wed, 21 Feb 2024 23:56:40 -0800 Subject: [PATCH 16/18] Update the prid values file for the same strategy --- ops/prod-deploy.tmpl.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ops/prod-deploy.tmpl.yaml b/ops/prod-deploy.tmpl.yaml index b567e0b1..0de07bed 100644 --- a/ops/prod-deploy.tmpl.yaml +++ b/ops/prod-deploy.tmpl.yaml @@ -156,8 +156,11 @@ worker: extraEnvVars: *envVars importWorker: + enabled: true + # extraEnvVars will not handle overriden values + # only additional to the original workerEnvVars list extraEnvVars: - - name: SIDEKIQ_CONCURRENCY + - name: IMPORT_WORKER_SIDEKIQ_CONCURRENCY value: "20" podSecurityContext: From dd607d6105600397f57cabf2e7f7a1cb13f200c7 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Thu, 22 Feb 2024 00:02:13 -0800 Subject: [PATCH 17/18] Beef up prod for samesies on demo --- hyrax/templates/import-deployment-worker.yaml | 2 +- ops/demo-deploy.tmpl.yaml | 4 ++-- ops/prod-deploy.tmpl.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hyrax/templates/import-deployment-worker.yaml b/hyrax/templates/import-deployment-worker.yaml index ae8045dd..839762fe 100644 --- a/hyrax/templates/import-deployment-worker.yaml +++ b/hyrax/templates/import-deployment-worker.yaml @@ -6,7 +6,7 @@ metadata: labels: {{- include "hyrax.labels" . | nindent 4 }} spec: - replicas: {{ .Values.worker.importReplicaCount }} + replicas: {{ .Values.importWorker.replicaCount }} selector: matchLabels: {{- include "hyrax.workerSelectorLabels" . | nindent 6 }} diff --git a/ops/demo-deploy.tmpl.yaml b/ops/demo-deploy.tmpl.yaml index 8a879b40..d9770c1f 100644 --- a/ops/demo-deploy.tmpl.yaml +++ b/ops/demo-deploy.tmpl.yaml @@ -141,7 +141,6 @@ extraEnvVars: &envVars worker: replicaCount: 1 - importReplicaCount: 1 podSecurityContext: runAsUser: 1001 runAsGroup: 101 @@ -151,7 +150,8 @@ worker: extraEnvVars: *envVars importWorker: - enabled: true + enabled: false + replicaCount: 1 # extraEnvVars will not handle overriden values # only additional to the original workerEnvVars list extraEnvVars: diff --git a/ops/prod-deploy.tmpl.yaml b/ops/prod-deploy.tmpl.yaml index 0de07bed..4b3c1fdf 100644 --- a/ops/prod-deploy.tmpl.yaml +++ b/ops/prod-deploy.tmpl.yaml @@ -146,7 +146,6 @@ extraEnvVars: &envVars worker: replicaCount: 1 - importReplicaCount: 3 podSecurityContext: runAsUser: 1001 runAsGroup: 101 @@ -157,6 +156,7 @@ worker: importWorker: enabled: true + replicaCount: 3 # extraEnvVars will not handle overriden values # only additional to the original workerEnvVars list extraEnvVars: From 730346c1846d93df56b4ad8f49bcd69189a3a377 Mon Sep 17 00:00:00 2001 From: April Rieger Date: Thu, 22 Feb 2024 00:03:41 -0800 Subject: [PATCH 18/18] Remove uneeded comments --- bin/worker | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/worker b/bin/worker index 2899cce4..b0935964 100755 --- a/bin/worker +++ b/bin/worker @@ -10,7 +10,6 @@ if ENV['AAPB_HOST'] %x{mkdir ~/.ssh && ssh-keyscan $AAPB_HOST >> ~/.ssh/known_hosts} end -# Dynamically set SIDEKIQ_CONCURRENCY based on the worker type if ENV['IMPORT_WORKER_SIDEKIQ_CONCURRENCY'] ENV['SIDEKIQ_CONCURRENCY'] = ENV.fetch('IMPORT_WORKER_SIDEKIQ_CONCURRENCY', '10') end