You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by bo...@apache.org on 2017/09/24 17:35:55 UTC

incubator-airflow git commit: Revert "[AIRFLOW-1368] Automatically remove Docker container on exit"

Repository: incubator-airflow
Updated Branches:
  refs/heads/master 9dc7c4c5a -> fa1dc1eb2


Revert "[AIRFLOW-1368] Automatically remove Docker container on exit"

This reverts commit 46c86a5cd2b69f4f1853280b442e8810b178e6c7.


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

Branch: refs/heads/master
Commit: fa1dc1eb20bd453687c21bb3e75ce8924105377d
Parents: 9dc7c4c
Author: Bolke de Bruin <bo...@xs4all.nl>
Authored: Sun Sep 24 19:35:28 2017 +0200
Committer: Bolke de Bruin <bo...@xs4all.nl>
Committed: Sun Sep 24 19:35:28 2017 +0200

----------------------------------------------------------------------
 airflow/operators/docker_operator.py | 14 ++++----------
 scripts/ci/requirements.txt          |  2 +-
 setup.py                             |  2 --
 3 files changed, 5 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/fa1dc1eb/airflow/operators/docker_operator.py
----------------------------------------------------------------------
diff --git a/airflow/operators/docker_operator.py b/airflow/operators/docker_operator.py
index 75a7a39..3011f1c 100644
--- a/airflow/operators/docker_operator.py
+++ b/airflow/operators/docker_operator.py
@@ -18,7 +18,7 @@ from airflow.exceptions import AirflowException
 from airflow.models import BaseOperator
 from airflow.utils.decorators import apply_defaults
 from airflow.utils.file import TemporaryDirectory
-from docker import APIClient, tls
+from docker import Client, tls
 import ast
 
 
@@ -78,8 +78,6 @@ class DockerOperator(BaseOperator):
     :type xcom_push: bool
     :param xcom_all: Push all the stdout or just the last line. The default is False (last line).
     :type xcom_all: bool
-    :param auto_remove: Automatically remove the container when it exits
-    :type auto_remove: bool
     """
     template_fields = ('command',)
     template_ext = ('.sh', '.bash',)
@@ -107,7 +105,6 @@ class DockerOperator(BaseOperator):
             working_dir=None,
             xcom_push=False,
             xcom_all=False,
-            auto_remove=False,
             *args,
             **kwargs):
 
@@ -132,7 +129,6 @@ class DockerOperator(BaseOperator):
         self.working_dir = working_dir
         self.xcom_push_flag = xcom_push
         self.xcom_all = xcom_all
-        self.auto_remove = auto_remove
 
         self.cli = None
         self.container = None
@@ -151,7 +147,7 @@ class DockerOperator(BaseOperator):
             )
             self.docker_url = self.docker_url.replace('tcp://', 'https://')
 
-        self.cli = APIClient(base_url=self.docker_url, version=self.api_version, tls=tls_config)
+        self.cli = Client(base_url=self.docker_url, version=self.api_version, tls=tls_config)
 
         if ':' not in self.image:
             image = self.image + ':latest'
@@ -174,10 +170,8 @@ class DockerOperator(BaseOperator):
                     command=self.get_command(),
                     cpu_shares=cpu_shares,
                     environment=self.environment,
-                    host_config=self.cli.create_host_config(
-                                                binds=self.volumes,
-                                                network_mode=self.network_mode,
-                                                auto_remove=self.auto_remove),
+                    host_config=self.cli.create_host_config(binds=self.volumes,
+                                                            network_mode=self.network_mode),
                     image=image,
                     mem_limit=self.mem_limit,
                     user=self.user,

http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/fa1dc1eb/scripts/ci/requirements.txt
----------------------------------------------------------------------
diff --git a/scripts/ci/requirements.txt b/scripts/ci/requirements.txt
index 0429787..d612d6f 100644
--- a/scripts/ci/requirements.txt
+++ b/scripts/ci/requirements.txt
@@ -28,7 +28,7 @@ cryptography
 datadog
 dill
 distributed
-docker
+docker-py
 filechunkio
 flake8
 flask

http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/fa1dc1eb/setup.py
----------------------------------------------------------------------
diff --git a/setup.py b/setup.py
index 46f1b1b..a97abfd 100644
--- a/setup.py
+++ b/setup.py
@@ -125,8 +125,6 @@ doc = [
     'Sphinx-PyPI-upload>=0.2.1'
 ]
 docker = ['docker-py>=1.6.0']
-docker = ['docker>=2.4.0']
-druid = ['pydruid>=0.2.1']
 emr = ['boto3>=1.0.0']
 gcp_api = [
     'httplib2',