Skip to content

Commit ff04ab1

Browse files
ponyisiBenGalewsky
authored andcommitted
Make transformer memory limit configurable
1 parent 1f77f54 commit ff04ab1

File tree

6 files changed

+15
-1
lines changed

6 files changed

+15
-1
lines changed

docs/deployment/reference.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ parameters for the [rabbitMQ](https://github.com/bitnami/charts/tree/master/bitn
101101
| `transformer.pullPolicy` | Pull policy for transformer pods (Image name specified in REST Request) | Always |
102102
| `transformer.priorityClassName` | priorityClassName for transformer pods (Not setting it means getting global default) | Not Set |
103103
| `transformer.cpuLimit` | Set CPU resource limit for pod in number of cores | 1 |
104+
| `transformer.memoryLimit` | Set memory resource limit for pod (use Kubernetes units, e.g. (the Kubernetes documentation)[https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory]) | 2Gi |
104105
| `transformer.sidecarImage` | Image name for the transformer sidecar container that hold the serviceX code | 'sslhep/servicex_sidecar_transformer' |
105106
| `transformer.sidecarTag` | Tag for the sidecar container | 'develop' |
106107
| `transformer.sidecarPullPolicy` | Pull Policy for the sidecar container | 'Always' |

helm/servicex/templates/app/configmap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ data:
9292
{{- end }}
9393
TRANSFORMER_AUTOSCALE_ENABLED = {{- ternary "True" "False" .Values.transformer.autoscaler.enabled }}
9494
TRANSFORMER_CPU_LIMIT = {{ .Values.transformer.cpuLimit }}
95+
TRANSFORMER_MEMORY_LIMIT = {{ .Values.transformer.memoryLimit }}
9596
TRANSFORMER_CPU_SCALE_THRESHOLD = {{ .Values.transformer.autoscaler.cpuScaleThreshold }}
9697
TRANSFORMER_MIN_REPLICAS = {{ .Values.transformer.autoscaler.minReplicas }}
9798
TRANSFORMER_MAX_REPLICAS = {{ .Values.transformer.autoscaler.maxReplicas }}

helm/servicex/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ transformer:
170170
maxReplicas: 20
171171
minReplicas: 1
172172
cpuLimit: 1
173+
memoryLimit: 2Gi
173174

174175
sidecarImage: sslhep/servicex_sidecar_transformer
175176
sidecarTag: develop

servicex_app/app.conf.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ TRANSFORMER_MAX_REPLICAS = 20
5858

5959
# Use one core per transformer
6060
TRANSFORMER_CPU_LIMIT = 1
61+
# Use 2GB per transformer
62+
TRANSFORMER_MEMORY_LIMIT = 2Gi
6163

6264
# CPU threshold for HPA (in percent) to spawn additional transformers
6365
TRANSFORMER_CPU_SCALE_THRESHOLD = 70

servicex_app/servicex_app/transformer_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def create_job_object(request_id, image, rabbitmq_uri, workers,
218218

219219
resources = client.V1ResourceRequirements(
220220
limits={"cpu": current_app.config['TRANSFORMER_CPU_LIMIT'],
221-
"memory": "2Gi"}
221+
"memory": current_app.config['TRANSFORMER_MEMORY_LIMIT']}
222222
)
223223

224224
# Configure Pod template container

servicex_app/servicex_app_test/test_transformer_manager.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def test_launch_transformer_jobs(self, mocker):
114114
'MINIO_ACCESS_KEY': 'itsame',
115115
'MINIO_SECRET_KEY': 'shhh',
116116
'TRANSFORMER_CPU_LIMIT': 4,
117+
'TRANSFORMER_MEMORY_LIMIT': '2Gi',
117118
'TRANSFORMER_CPU_SCALE_THRESHOLD': 30,
118119
'TRANSFORMER_MIN_REPLICAS': 3,
119120
'TRANSFORMER_MAX_REPLICAS': 17,
@@ -182,6 +183,7 @@ def test_launch_transformer_jobs_no_autoscaler(self, mocker):
182183
'MINIO_SECRET_KEY': 'shhh',
183184
'TRANSFORMER_AUTOSCALE_ENABLED': False,
184185
'TRANSFORMER_CPU_LIMIT': 1,
186+
'TRANSFORMER_MEMORY_LIMIT': '2Gi',
185187
'TRANSFORMER_CPU_SCALE_THRESHOLD': 30,
186188
'TRANSFORMER_SIDECAR_VOLUME_PATH': '/servicex/output',
187189
'TRANSFORMER_SIDECAR_IMAGE': 'pondd/servicex_yt_transformer:sidecar',
@@ -224,6 +226,7 @@ def test_launch_transformer_with_hostpath(self, mocker):
224226
'MINIO_SECRET_KEY': 'shhh',
225227
'TRANSFORMER_LOCAL_PATH': '/tmp/foo',
226228
'TRANSFORMER_CPU_LIMIT': 1,
229+
'TRANSFORMER_MEMORY_LIMIT': '2Gi',
227230
'TRANSFORMER_CPU_SCALE_THRESHOLD': 30,
228231
'TRANSFORMER_SIDECAR_VOLUME_PATH': '/servicex/output',
229232
'TRANSFORMER_SIDECAR_IMAGE': 'pondd/servicex_yt_transformer:sidecar',
@@ -272,6 +275,7 @@ def test_launch_transformer_jobs_with_generated_code(self, mocker):
272275
'MINIO_ACCESS_KEY': 'itsame',
273276
'MINIO_SECRET_KEY': 'shhh',
274277
'TRANSFORMER_CPU_LIMIT': 1,
278+
'TRANSFORMER_MEMORY_LIMIT': '2Gi',
275279
'TRANSFORMER_CPU_SCALE_THRESHOLD': 30,
276280
'TRANSFORMER_SIDECAR_VOLUME_PATH': '/servicex/output',
277281
'TRANSFORMER_SIDECAR_IMAGE': 'pondd/servicex_yt_transformer:sidecar',
@@ -320,6 +324,7 @@ def test_launch_transformer_jobs_with_object_store(self, mocker):
320324
'MINIO_ACCESS_KEY': 'itsame',
321325
'MINIO_SECRET_KEY': 'shhh',
322326
'TRANSFORMER_CPU_LIMIT': 1,
327+
'TRANSFORMER_MEMORY_LIMIT': '2Gi',
323328
'TRANSFORMER_CPU_SCALE_THRESHOLD': 30,
324329
'TRANSFORMER_SIDECAR_VOLUME_PATH': '/servicex/output',
325330
'TRANSFORMER_SIDECAR_IMAGE': 'pondd/servicex_yt_transformer:sidecar',
@@ -370,6 +375,7 @@ def test_launch_transformer_jobs_with_secure_object_store(self, mocker):
370375
'MINIO_SECRET_KEY': 'shhh',
371376
'MINIO_ENCRYPT': 'True',
372377
'TRANSFORMER_CPU_LIMIT': 1,
378+
'TRANSFORMER_MEMORY_LIMIT': '2Gi',
373379
'TRANSFORMER_CPU_SCALE_THRESHOLD': 30,
374380
'TRANSFORMER_SIDECAR_VOLUME_PATH': '/servicex/output',
375381
'TRANSFORMER_SIDECAR_IMAGE': 'pondd/servicex_yt_transformer:sidecar',
@@ -417,6 +423,7 @@ def test_launch_transformer_jobs_with_provided_claim(self, mocker):
417423
'TRANSFORMER_PERSISTENCE_SUBDIR': 'output-data',
418424
'TRANSFORMER_AUTOSCALE_ENABLED': False,
419425
'TRANSFORMER_CPU_LIMIT': 1,
426+
'TRANSFORMER_MEMORY_LIMIT': '2Gi',
420427
'TRANSFORMER_SIDECAR_VOLUME_PATH': '/servicex/output',
421428
'TRANSFORMER_SIDECAR_IMAGE': 'pondd/servicex_yt_transformer:sidecar',
422429
'TRANSFORMER_SIDECAR_PULL_POLICY': 'Always',
@@ -466,6 +473,7 @@ def test_launch_transformer_jobs_with_posix_emptydir(self, mocker):
466473
'TRANSFORMER_PERSISTENCE_SUBDIR': 'output-data',
467474
'TRANSFORMER_AUTOSCALE_ENABLED': False,
468475
'TRANSFORMER_CPU_LIMIT': 1,
476+
'TRANSFORMER_MEMORY_LIMIT': '2Gi',
469477
'TRANSFORMER_SIDECAR_VOLUME_PATH': '/servicex/output',
470478
'TRANSFORMER_SIDECAR_IMAGE': 'pondd/servicex_yt_transformer:sidecar',
471479
'TRANSFORMER_SIDECAR_PULL_POLICY': 'Always',
@@ -518,6 +526,7 @@ def test_launch_transformer_jobs_no_certs(self, mocker):
518526
'MINIO_ACCESS_KEY': 'itsame',
519527
'MINIO_SECRET_KEY': 'shhh',
520528
'TRANSFORMER_CPU_LIMIT': 4,
529+
'TRANSFORMER_MEMORY_LIMIT': '2Gi',
521530
'TRANSFORMER_CPU_SCALE_THRESHOLD': 30,
522531
'TRANSFORMER_MIN_REPLICAS': 3,
523532
'TRANSFORMER_MAX_REPLICAS': 17,

0 commit comments

Comments
 (0)