airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject [06/16] incubator-airflow git commit: [AIRFLOW-1517] Remove authorship of resources
Date Fri, 12 Jan 2018 18:03:06 GMT
[AIRFLOW-1517] Remove authorship of resources

Collaboration authors got destroyed when splitting up a PR, this commit removes code which
will be readded in the next commit to restore authorship


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/ada7aed0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/ada7aed0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/ada7aed0

Branch: refs/heads/master
Commit: ada7aed0da1e84e2fc7b217295d6160a6764f787
Parents: cde3a5f
Author: GRANT NICHOLAS <gnicholas@homeaway.com>
Authored: Thu Dec 28 14:38:28 2017 -0600
Committer: Daniel Imberman <danielryan2430@gmail.com>
Committed: Thu Jan 11 15:28:33 2018 -0800

----------------------------------------------------------------------
 .../kubernetes_request_factory.py               | 33 ++------------------
 airflow/contrib/kubernetes/pod.py               | 19 -----------
 2 files changed, 2 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/ada7aed0/airflow/contrib/kubernetes/kubernetes_request_factory/kubernetes_request_factory.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/kubernetes/kubernetes_request_factory/kubernetes_request_factory.py
b/airflow/contrib/kubernetes/kubernetes_request_factory/kubernetes_request_factory.py
index 9398bef..7d698b4 100644
--- a/airflow/contrib/kubernetes/kubernetes_request_factory/kubernetes_request_factory.py
+++ b/airflow/contrib/kubernetes/kubernetes_request_factory/kubernetes_request_factory.py
@@ -37,10 +37,6 @@ class KubernetesRequestFactory:
     def extract_image(pod, req):
         req['spec']['containers'][0]['image'] = pod.image
 
-    @staticmethod
-    def extract_image_pull_policy(pod, req):
-        if pod.image_pull_policy:
-            req['spec']['containers'][0]['imagePullPolicy'] = pod.image_pull_policy
 
     @staticmethod
     def add_secret_to_env(env, secret):
@@ -73,9 +69,7 @@ class KubernetesRequestFactory:
         if len(pod.node_selectors) > 0:
             req['spec']['nodeSelector'] = pod.node_selectors
 
-    @staticmethod
-    def attach_volumes(pod, req):
-        req['spec']['volumes'] = pod.volumes
+
 
     @staticmethod
     def attach_volume_mounts(pod, req):
@@ -119,30 +113,7 @@ class KubernetesRequestFactory:
                 KubernetesRequestFactory.add_secret_to_env(env, secret)
             req['spec']['containers'][0]['env'] = env
 
-    @staticmethod
-    def extract_resources(pod, req):
-        if not pod.resources or pod.resources.is_empty_resource_request():
-            return
-
-        req['spec']['containers'][0]['resources'] = {}
-
-        if pod.resources.has_requests():
-            req['spec']['containers'][0]['resources']['requests'] = {}
-            if pod.resources.request_memory:
-                req['spec']['containers'][0]['resources']['requests'][
-                    'memory'] = pod.resources.request_memory
-            if pod.resources.request_cpu:
-                req['spec']['containers'][0]['resources']['requests'][
-                    'cpu'] = pod.resources.request_cpu
-
-        if pod.resources.has_limits():
-            req['spec']['containers'][0]['resources']['limits'] = {}
-            if pod.resources.request_memory:
-                req['spec']['containers'][0]['resources']['limits'][
-                    'memory'] = pod.resources.limit_memory
-            if pod.resources.request_cpu:
-                req['spec']['containers'][0]['resources']['limits'][
-                    'cpu'] = pod.resources.limit_cpu
+
 
     @staticmethod
     def extract_init_containers(pod, req):

http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/ada7aed0/airflow/contrib/kubernetes/pod.py
----------------------------------------------------------------------
diff --git a/airflow/contrib/kubernetes/pod.py b/airflow/contrib/kubernetes/pod.py
index 6a9f76d..cdb1d65 100644
--- a/airflow/contrib/kubernetes/pod.py
+++ b/airflow/contrib/kubernetes/pod.py
@@ -14,26 +14,7 @@
 # limitations under the License.
 
 
-class Resources:
-    def __init__(
-            self,
-            request_memory=None,
-            request_cpu=None,
-            limit_memory=None,
-            limit_cpu=None):
-        self.request_memory = request_memory
-        self.request_cpu = request_cpu
-        self.limit_memory = limit_memory
-        self.limit_cpu = limit_cpu
-
-    def is_empty_resource_request(self):
-        return not self.has_limits() and not self.has_requests()
-
-    def has_limits(self):
-        return self.limit_cpu is not None or self.limit_memory is not None
 
-    def has_requests(self):
-        return self.request_cpu is not None or self.request_memory is not None
 
 
 class Pod:


Mime
View raw message