Skip to content

Commit 2940ff2

Browse files
author
Meer Sawood
authored
core: upgrade api server configuration (#787)
* core: upgrade api server configuration * small fix * linter fixes
1 parent 317bc01 commit 2940ff2

3 files changed

Lines changed: 31 additions & 9 deletions

File tree

bayesian/conf/gunicorn.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
"""Gunicorn config."""
22
# NOTE: Must be before we import or call anything that may be synchronous.
33
from gevent import monkey
4-
5-
monkey.patch_all()
6-
74
import logging
85
from bayesian.settings import GUNICORN_SETTINGS, log_all_settings
96
from prometheus_flask_exporter.multiprocess import GunicornPrometheusMetrics
107

8+
monkey.patch_all()
9+
1110
workers = GUNICORN_SETTINGS.workers
1211
worker_class = GUNICORN_SETTINGS.worker_class
1312
timeout = GUNICORN_SETTINGS.timeout

openshift/template.yaml

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ objects:
163163
timeoutSeconds: 10
164164
resources:
165165
requests:
166-
memory: "512Mi"
167-
cpu: "500m"
166+
memory: ${{MEMORY_REQUEST}}
167+
cpu: ${{CPU_REQUEST}}
168168
limits:
169-
memory: "1024Mi"
170-
cpu: "1000m"
169+
memory: ${{MEMORY_LIMIT}}
170+
cpu: ${CPU_LIMIT}
171171
restartPolicy: Always
172172
test: false
173173
triggers:
@@ -246,6 +246,30 @@ parameters:
246246
name: REPLICAS
247247
value: "1"
248248

249+
- description: Request Number of CPU cores required by each replica
250+
displayName: Request CPU cores
251+
required: true
252+
name: CPU_REQUEST
253+
value: "500m"
254+
255+
- description: Limit Number of CPU cores required by each replica
256+
displayName: Limit CPU cores
257+
required: true
258+
name: CPU_LIMIT
259+
value: "3"
260+
261+
- description: Request Memory Required by each replica
262+
displayName: Request Memory
263+
required: true
264+
name: MEMORY_REQUEST
265+
value: "512Mi"
266+
267+
- description: Limit Memory Required by each replica
268+
displayName: Limit Memory
269+
required: true
270+
name: MEMORY_LIMIT
271+
value: "5Gi"
272+
249273
- description: Batch size for component analysis gremlin query
250274
displayName: Batch size for component analysis gremlin query
251275
required: true

setup.cfg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
[pycodestyle]
2-
ignore = E121, E126, E402, W504
3-
max-line-length = 100
2+
max-line-length = 100

0 commit comments

Comments
 (0)