Skip to content

Commit

Permalink
perf(manager): reduce size of job-controller's db connection pool (re…
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonadoni committed Aug 26, 2024
1 parent d9512fb commit 5ac27ef
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions reana_workflow_controller/workflow_run_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,7 @@ def _create_job_spec(
),
)

job_controller_env_vars = copy.deepcopy(JOB_CONTROLLER_ENV_VARS)
job_controller_env_vars.extend(
job_controller_container.env.extend(
[
{"name": "REANA_USER_ID", "value": owner_id},
{"name": "CERN_USER", "value": user},
Expand All @@ -670,6 +669,8 @@ def _create_job_spec(
"name": "REANA_SQLALCHEMY_DATABASE_URI",
"value": SQLALCHEMY_DATABASE_URI,
},
# reduce the number of open database connections kept in the pool
{"name": "SQLALCHEMY_POOL_SIZE", "value": "1"},
{"name": "REANA_STORAGE_BACKEND", "value": REANA_STORAGE_BACKEND},
{"name": "REANA_COMPONENT_PREFIX", "value": REANA_COMPONENT_PREFIX},
{
Expand Down Expand Up @@ -713,7 +714,9 @@ def _create_job_spec(
{"name": "WORKSPACE_PATHS", "value": json.dumps(WORKSPACE_PATHS)},
]
)
job_controller_container.env.extend(job_controller_env_vars)
# env vars coming from Helm values are added after the ones from r-w-controller
# so that the former can override the latter in case of necessity
job_controller_container.env.extend(copy.deepcopy(JOB_CONTROLLER_ENV_VARS))
job_controller_container.env.extend(job_controller_env_secrets)
if REANA_RUNTIME_JOBS_KUBERNETES_NODE_LABEL:
job_controller_container.env.append(
Expand Down

0 comments on commit 5ac27ef

Please sign in to comment.