You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2020/08/22 18:26:28 UTC

[airflow] branch v1-10-test updated (9d80a57 -> ae12c52)

This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a change to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git.


    omit 9d80a57  Fix broken Kubernetes PodRuntimeInfoEnv (#10478)
    omit 846e9a5  Execute job cancel HTTPRequest in Dataproc Hook (#10361)
     new d784d8b  Fix broken Kubernetes PodRuntimeInfoEnv (#10478)
     new f052dcf  Update Changelog for 1.10.12rc4
     new ae12c52  Execute job cancel HTTPRequest in Dataproc Hook (#10361)

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (9d80a57)
            \
             N -- N -- N   refs/heads/v1-10-test (ae12c52)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 CHANGELOG.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


[airflow] 02/03: Update Changelog for 1.10.12rc4

Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit f052dcfc7149a07d6d713dba5ba392a253ca7ddc
Author: Kaxil Naik <ka...@apache.org>
AuthorDate: Sat Aug 22 19:25:10 2020 +0100

    Update Changelog for 1.10.12rc4
---
 CHANGELOG.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 6ccb089..3164ec2 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,4 +1,4 @@
-Airflow 1.10.12, 2020-08-23
+Airflow 1.10.12, 2020-08-25
 ----------------------------
 
 New Features
@@ -35,6 +35,7 @@ Bug Fixes
 - Fix issue with mounting volumes from secrets (#10366)
 - BugFix: K8s Executor Multinamespace mode is evaluated to true by default (#10410)
 - Make KubernetesExecutor recognize kubernetes_labels (#10412)
+- Fix broken Kubernetes PodRuntimeInfoEnv (#10478)
 
 Improvements
 """"""""""""


[airflow] 03/03: Execute job cancel HTTPRequest in Dataproc Hook (#10361)

Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit ae12c52a15f4d183117e160cf196188341d1639a
Author: Varun Dhussa <26...@users.noreply.github.com>
AuthorDate: Wed Aug 19 14:10:16 2020 +0530

    Execute job cancel HTTPRequest in Dataproc Hook (#10361)
    
    closes: #10357
---
 airflow/contrib/hooks/gcp_dataproc_hook.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/airflow/contrib/hooks/gcp_dataproc_hook.py b/airflow/contrib/hooks/gcp_dataproc_hook.py
index aae4e7a..dec3618 100644
--- a/airflow/contrib/hooks/gcp_dataproc_hook.py
+++ b/airflow/contrib/hooks/gcp_dataproc_hook.py
@@ -337,7 +337,7 @@ class DataProcHook(GoogleCloudBaseHook):
             projectId=project_id,
             region=region,
             jobId=job_id
-        )
+        ).execute(num_retries=self.num_retries)
 
 
 setattr(


[airflow] 01/03: Fix broken Kubernetes PodRuntimeInfoEnv (#10478)

Posted by ka...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit d784d8b2047b5b48ee242adb14b56a00522060ed
Author: Kaxil Naik <ka...@gmail.com>
AuthorDate: Sat Aug 22 17:52:41 2020 +0100

    Fix broken Kubernetes PodRuntimeInfoEnv (#10478)
    
    closes https://github.com/apache/airflow/issues/10456
    
    (cherry picked from commit 47c6657ce012f6db147fdcce3ca5e77f46a9e491)
---
 airflow/kubernetes/pod_runtime_info_env.py       |  2 +-
 kubernetes_tests/test_kubernetes_pod_operator.py | 38 +++++++++++++++++++++++-
 2 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/airflow/kubernetes/pod_runtime_info_env.py b/airflow/kubernetes/pod_runtime_info_env.py
index 72e2151..95fbe6b 100644
--- a/airflow/kubernetes/pod_runtime_info_env.py
+++ b/airflow/kubernetes/pod_runtime_info_env.py
@@ -47,7 +47,7 @@ class PodRuntimeInfoEnv(K8SModel):
             name=self.name,
             value_from=k8s.V1EnvVarSource(
                 field_ref=k8s.V1ObjectFieldSelector(
-                    self.field_path
+                    field_path=self.field_path
                 )
             )
         )
diff --git a/kubernetes_tests/test_kubernetes_pod_operator.py b/kubernetes_tests/test_kubernetes_pod_operator.py
index 89572f9..a5c9731 100644
--- a/kubernetes_tests/test_kubernetes_pod_operator.py
+++ b/kubernetes_tests/test_kubernetes_pod_operator.py
@@ -32,6 +32,7 @@ from airflow.kubernetes import kube_client
 from airflow.kubernetes.pod import Port
 from airflow.kubernetes.pod_generator import PodDefaults
 from airflow.kubernetes.pod_launcher import PodLauncher
+from airflow.kubernetes.pod_runtime_info_env import PodRuntimeInfoEnv
 from airflow.kubernetes.secret import Secret
 from airflow.kubernetes.volume import Volume
 from airflow.kubernetes.volume_mount import VolumeMount
@@ -669,7 +670,7 @@ class TestKubernetesPodOperatorSystem(unittest.TestCase):
 
     def test_pod_failure(self):
         """
-            Tests that the task fails when a pod reports a failure
+        Tests that the task fails when a pod reports a failure
         """
         bad_internal_command = ["foobar 10 "]
         k = KubernetesPodOperator(
@@ -780,6 +781,41 @@ class TestKubernetesPodOperatorSystem(unittest.TestCase):
             ))]
         )
 
+    def test_env_vars(self):
+        # WHEN
+        k = KubernetesPodOperator(
+            namespace='default',
+            image="ubuntu:16.04",
+            cmds=["bash", "-cx"],
+            arguments=["echo 10"],
+            env_vars={"ENV1": "val1", "ENV2": "val2", },
+            pod_runtime_info_envs=[PodRuntimeInfoEnv("ENV3", "status.podIP")],
+            labels={"foo": "bar"},
+            name="test",
+            task_id="task",
+            in_cluster=False,
+            do_xcom_push=False,
+        )
+
+        context = create_context(k)
+        k.execute(context)
+
+        # THEN
+        actual_pod = self.api_client.sanitize_for_serialization(k.pod)
+        self.expected_pod['spec']['containers'][0]['env'] = [
+            {'name': 'ENV1', 'value': 'val1'},
+            {'name': 'ENV2', 'value': 'val2'},
+            {
+                'name': 'ENV3',
+                'valueFrom': {
+                    'fieldRef': {
+                        'fieldPath': 'status.podIP'
+                    }
+                }
+            }
+        ]
+        self.assertEqual(self.expected_pod, actual_pod)
+
     def test_init_container(self):
         # GIVEN
         volume_mounts = [k8s.V1VolumeMount(