diff --git a/reana_workflow_controller/config.py b/reana_workflow_controller/config.py index d62cce3a..08175395 100644 --- a/reana_workflow_controller/config.py +++ b/reana_workflow_controller/config.py @@ -162,6 +162,12 @@ def _env_vars_dict_to_k8s_list(env_vars): ) """Default image for REANA Job Controller sidecar.""" + +JOB_CONTROLLER_ENV_VARS = _env_vars_dict_to_k8s_list( + json.loads(os.getenv("REANA_JOB_CONTROLLER_ENV_VARS", "{}")) +) +"""Environment variables to be passed to the job controller container.""" + JOB_CONTROLLER_CONTAINER_PORT = 5000 """Default container port for REANA Job Controller sidecar.""" diff --git a/reana_workflow_controller/workflow_run_manager.py b/reana_workflow_controller/workflow_run_manager.py index 03cc535f..c840242f 100644 --- a/reana_workflow_controller/workflow_run_manager.py +++ b/reana_workflow_controller/workflow_run_manager.py @@ -61,6 +61,7 @@ from reana_workflow_controller.config import ( # isort:skip IMAGE_PULL_SECRETS, JOB_CONTROLLER_CONTAINER_PORT, + JOB_CONTROLLER_ENV_VARS, JOB_CONTROLLER_SHUTDOWN_ENDPOINT, REANA_KUBERNETES_JOBS_MAX_USER_MEMORY_LIMIT, REANA_KUBERNETES_JOBS_MEMORY_LIMIT, @@ -484,7 +485,6 @@ def _create_job_spec( overwrite_operational_options=overwrite_operational_options, ) workflow_engine_env_vars = env_vars or self._workflow_engine_env_vars() - job_controller_env_vars = [] owner_id = str(self.workflow.owner_id) command = format_cmd(command) workspace_mount, workspace_volume = get_workspace_volume( @@ -586,6 +586,7 @@ def _create_job_spec( ), ) + job_controller_env_vars = copy.deepcopy(JOB_CONTROLLER_ENV_VARS) job_controller_env_vars.extend( [ {"name": "REANA_USER_ID", "value": owner_id},