Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(manager): increase termination period of run-batch pods (#572) #572

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions reana_workflow_controller/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,11 @@ def _env_vars_dict_to_k8s_list(env_vars):
RunStatus.pending,
]
"""Alive workflow statuses."""

REANA_RUNTIME_BATCH_TERMINATION_GRACE_PERIOD = int(
os.getenv("REANA_RUNTIME_BATCH_TERMINATION_GRACE_PERIOD", "120")
)
"""Grace period before terminating the job controller and workflow engine pod.

The job controller needs to clean up all the running jobs before the end of the grace period.
"""
2 changes: 2 additions & 0 deletions reana_workflow_controller/workflow_run_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
JOB_CONTROLLER_CONTAINER_PORT,
JOB_CONTROLLER_ENV_VARS,
JOB_CONTROLLER_SHUTDOWN_ENDPOINT,
REANA_RUNTIME_BATCH_TERMINATION_GRACE_PERIOD,
REANA_KUBERNETES_JOBS_MAX_USER_MEMORY_LIMIT,
REANA_KUBERNETES_JOBS_MEMORY_LIMIT,
REANA_KUBERNETES_JOBS_TIMEOUT_LIMIT,
Expand Down Expand Up @@ -662,6 +663,7 @@ def _create_job_spec(
containers=containers,
node_selector=REANA_RUNTIME_BATCH_KUBERNETES_NODE_LABEL,
init_containers=[],
termination_grace_period_seconds=REANA_RUNTIME_BATCH_TERMINATION_GRACE_PERIOD,
)
spec.template.spec.service_account_name = (
REANA_RUNTIME_KUBERNETES_SERVICEACCOUNT_NAME
Expand Down
Loading