feng-tao closed pull request #4311: [AIRFLOW-3505] replace 'dags_in_docker' with 'dags_in_image' URL: https://github.com/apache/incubator-airflow/pull/4311
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/airflow/config_templates/default_airflow.cfg b/airflow/config_templates/default_airflow.cfg index 7b631b31bc..9c21f5d47e 100644 --- a/airflow/config_templates/default_airflow.cfg +++ b/airflow/config_templates/default_airflow.cfg @@ -607,7 +607,7 @@ airflow_configmap = # For docker image already contains DAGs, this is set to `True`, and the worker will search for dags in dags_folder, # otherwise use git sync or dags volumn chaim to mount DAGs -dags_in_docker = FALSE +dags_in_image = FALSE # For either git sync or volume mounted DAGs, the worker will look in this subpath for DAGs dags_volume_subpath = diff --git a/airflow/contrib/executors/kubernetes_executor.py b/airflow/contrib/executors/kubernetes_executor.py index 784ffcafc3..ca0cc1d128 100644 --- a/airflow/contrib/executors/kubernetes_executor.py +++ b/airflow/contrib/executors/kubernetes_executor.py @@ -139,7 +139,7 @@ def __init__(self): # NOTE: user can build the dags into the docker image directly, # this will set to True if so - self.dags_in_docker = conf.get(self.kubernetes_section, 'dags_in_docker') + self.dags_in_image = conf.get(self.kubernetes_section, 'dags_in_image') # NOTE: `git_repo` and `git_branch` must be specified together as a pair # The http URL of the git repository to clone from @@ -208,12 +208,12 @@ def __init__(self): self._validate() def _validate(self): - if not self.dags_volume_claim and not self.dags_in_docker \ + if not self.dags_volume_claim and not self.dags_in_image \ and (not self.git_repo or not self.git_branch): raise AirflowConfigException( 'In kubernetes mode the following must be set in the `kubernetes` ' 'config section: `dags_volume_claim` or `git_repo and git_branch` ' - 'or `dags_in_docker`') + 'or `dags_in_image`') class KubernetesJobWatcher(multiprocessing.Process, LoggingMixin, object): diff --git a/airflow/contrib/kubernetes/worker_configuration.py b/airflow/contrib/kubernetes/worker_configuration.py index aa23c4eef7..58cf9cbd20 100644 --- a/airflow/contrib/kubernetes/worker_configuration.py +++ b/airflow/contrib/kubernetes/worker_configuration.py @@ -38,7 +38,7 @@ def __init__(self, kube_config): def _get_init_containers(self, volume_mounts): """When using git to retrieve the DAGs, use the GitSync Init Container""" # If we're using volume claims to mount the dags, no init container is needed - if self.kube_config.dags_volume_claim or self.kube_config.dags_in_docker: + if self.kube_config.dags_volume_claim or self.kube_config.dags_in_image: return [] # Otherwise, define a git-sync init container @@ -134,7 +134,7 @@ def _construct_volume(name, claim): ) ] - if not self.kube_config.dags_in_docker: + if not self.kube_config.dags_in_image: volumes.append( _construct_volume( dags_volume_name, @@ -153,7 +153,7 @@ def _construct_volume(name, claim): logs_volume_mount ] - if not self.kube_config.dags_in_docker: + if not self.kube_config.dags_in_image: dag_volume_mount_path = "" if self.kube_config.dags_volume_claim: diff --git a/scripts/ci/kubernetes/kube/configmaps.yaml b/scripts/ci/kubernetes/kube/configmaps.yaml index 4c7ac388f4..759c7d637f 100644 --- a/scripts/ci/kubernetes/kube/configmaps.yaml +++ b/scripts/ci/kubernetes/kube/configmaps.yaml @@ -178,7 +178,7 @@ data: worker_container_image_pull_policy = IfNotPresent worker_dags_folder = /tmp/dags delete_worker_pods = True - dags_in_docker = False + dags_in_image = False git_repo = https://github.com/apache/incubator-airflow.git git_branch = master git_subpath = airflow/example_dags/ ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services