You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/09/04 17:24:12 UTC
[GitHub] [airflow] dimberman opened a new pull request #10727: Make grace_period_seconds option on K8sPodOperator
dimberman opened a new pull request #10727:
URL: https://github.com/apache/airflow/pull/10727
This PR allows users to choose whether they want to gracefully kill
pods when they delete tasks in the UI or if they would like to
immediately kill them.
<!--
Thank you for contributing! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of existing issue, reference it using one of the following:
closes: #ISSUE
related: #ISSUE
How to write a good git commit message:
http://chris.beams.io/posts/git-commit/
-->
---
**^ Add meaningful description above**
Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] dimberman merged pull request #10727: Make grace_period_seconds option on K8sPodOperator
Posted by GitBox <gi...@apache.org>.
dimberman merged pull request #10727:
URL: https://github.com/apache/airflow/pull/10727
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] kaxil commented on a change in pull request #10727: Make grace_period_seconds option on K8sPodOperator
Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #10727:
URL: https://github.com/apache/airflow/pull/10727#discussion_r483769070
##########
File path: kubernetes_tests/test_kubernetes_pod_operator.py
##########
@@ -903,7 +904,6 @@ def test_on_kill(self,
self.assertEqual(pod.status.phase, "Running")
k.on_kill()
with self.assertRaises(ApiException):
- # pod should be deleted
- client.read_namespaced_pod(name=name, namespace=namespace)
+ pod = client.read_namespaced_pod(name=name, namespace=namespace)
Review comment:
Can we add a test that verifies that `termination_grace_period` is passed correctly i.e. mocking `delete_namespaced_pod` and just doing assert_called_with
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] dimberman commented on a change in pull request #10727: Make grace_period_seconds option on K8sPodOperator
Posted by GitBox <gi...@apache.org>.
dimberman commented on a change in pull request #10727:
URL: https://github.com/apache/airflow/pull/10727#discussion_r483770449
##########
File path: kubernetes_tests/test_kubernetes_pod_operator.py
##########
@@ -903,7 +904,6 @@ def test_on_kill(self,
self.assertEqual(pod.status.phase, "Running")
k.on_kill()
with self.assertRaises(ApiException):
- # pod should be deleted
- client.read_namespaced_pod(name=name, namespace=namespace)
+ pod = client.read_namespaced_pod(name=name, namespace=namespace)
Review comment:
@kaxil the termination_grace_period is being passed because without passing it this test would fail. read_namespaced_pod only returns an error when the pod is fully deleted and this pod would take 20 seconds to delete without a termination_grace_period.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] kaxil commented on a change in pull request #10727: Make grace_period_seconds option on K8sPodOperator
Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #10727:
URL: https://github.com/apache/airflow/pull/10727#discussion_r483763836
##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -146,6 +146,9 @@ class KubernetesPodOperator(BaseOperator): # pylint: disable=too-many-instance-
:type pod_template_file: str
:param priority_class_name: priority class name for the launched Pod
:type priority_class_name: str
+ :param termination_grace_period: Termination grace period if task killed in UI,
+ defaults to kubernetes default
+ :type termination_grace_period: int
Review comment:
```suggestion
:param termination_grace_period: Termination grace period if task killed in UI,
defaults to kubernetes default
:type termination_grace_period: int
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] kaxil commented on a change in pull request #10727: Make grace_period_seconds option on K8sPodOperator
Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #10727:
URL: https://github.com/apache/airflow/pull/10727#discussion_r483770896
##########
File path: kubernetes_tests/test_kubernetes_pod_operator.py
##########
@@ -903,7 +904,6 @@ def test_on_kill(self,
self.assertEqual(pod.status.phase, "Running")
k.on_kill()
with self.assertRaises(ApiException):
- # pod should be deleted
- client.read_namespaced_pod(name=name, namespace=namespace)
+ pod = client.read_namespaced_pod(name=name, namespace=namespace)
Review comment:
aah, fair enough
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org