Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4A814200B72 for ; Fri, 12 Aug 2016 01:33:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 491E8160A94; Thu, 11 Aug 2016 23:33:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 54E4E160A93 for ; Fri, 12 Aug 2016 01:33:58 +0200 (CEST) Received: (qmail 6072 invoked by uid 500); 11 Aug 2016 23:33:57 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 6063 invoked by uid 99); 11 Aug 2016 23:33:57 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Aug 2016 23:33:57 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id E2AF2C0591 for ; Thu, 11 Aug 2016 23:33:56 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 9enrlJ2lTYT8 for ; Thu, 11 Aug 2016 23:33:55 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id F2BF65F484 for ; Thu, 11 Aug 2016 23:33:53 +0000 (UTC) Received: (qmail 6007 invoked by uid 99); 11 Aug 2016 23:33:53 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Aug 2016 23:33:53 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BD986E0019; Thu, 11 Aug 2016 23:33:52 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sanand@apache.org To: commits@airflow.incubator.apache.org Message-Id: <98f3174c63744420a63b6192a832c3f5@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-airflow git commit: [AIRFLOW-369] Allow setting default DAG orientation Date: Thu, 11 Aug 2016 23:33:52 +0000 (UTC) archived-at: Thu, 11 Aug 2016 23:33:59 -0000 Repository: incubator-airflow Updated Branches: refs/heads/master a737506bb -> ecdd8c6ea [AIRFLOW-369] Allow setting default DAG orientation Dear Airflow Maintainers, Please accept this PR that addresses the following issues: [AIRFLOW-369](https://issues.apache.org/jira/browse/AIRFLOW-369) No tests infrastructure for webserver exists - verified manually. Thanks. Closes #1713 from spektom/dag_orientation Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/ecdd8c6e Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/ecdd8c6e Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/ecdd8c6e Branch: refs/heads/master Commit: ecdd8c6ea963c07b8561838b89bac45e354686ef Parents: a737506 Author: Michael Spector Authored: Thu Aug 11 16:33:40 2016 -0700 Committer: Siddharth Anand Committed: Thu Aug 11 16:33:40 2016 -0700 ---------------------------------------------------------------------- airflow/configuration.py | 6 ++++++ airflow/models.py | 4 ++++ airflow/www/views.py | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/ecdd8c6e/airflow/configuration.py ---------------------------------------------------------------------- diff --git a/airflow/configuration.py b/airflow/configuration.py index 31b8f36..e1b3481 100644 --- a/airflow/configuration.py +++ b/airflow/configuration.py @@ -133,6 +133,7 @@ defaults = { 'worker_class': 'sync', 'access_logfile': '', 'error_logfile': '', + 'dag_orientation': 'LR', }, 'scheduler': { 'statsd_on': False, @@ -326,6 +327,10 @@ filter_by_owner = False # in order to user the ldapgroup mode. owner_mode = user +# Default DAG orientation. Valid values are: LR (Left->Right), TB (Top->Bottom), +# RL (Right->Left), BT (Bottom->Top). +dag_orientation = LR + [email] email_backend = airflow.utils.email.send_email_smtp @@ -466,6 +471,7 @@ default_owner = airflow base_url = http://localhost:8080 web_server_host = 0.0.0.0 web_server_port = 8080 +dag_orientation = LR [email] email_backend = airflow.utils.email.send_email_smtp http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/ecdd8c6e/airflow/models.py ---------------------------------------------------------------------- diff --git a/airflow/models.py b/airflow/models.py index df51be5..f4d7afd 100644 --- a/airflow/models.py +++ b/airflow/models.py @@ -2606,6 +2606,8 @@ class DAG(BaseDag, LoggingMixin): :param sla_miss_callback: specify a function to call when reporting SLA timeouts. :type sla_miss_callback: types.FunctionType + :param orientation: Specify DAG orientation in graph view (LR, TB, RL, BT) + :type orientation: string """ def __init__( @@ -2621,6 +2623,7 @@ class DAG(BaseDag, LoggingMixin): 'core', 'max_active_runs_per_dag'), dagrun_timeout=None, sla_miss_callback=None, + orientation=configuration.get('webserver', 'dag_orientation'), params=None): self.user_defined_macros = user_defined_macros @@ -2659,6 +2662,7 @@ class DAG(BaseDag, LoggingMixin): self.max_active_runs = max_active_runs self.dagrun_timeout = dagrun_timeout self.sla_miss_callback = sla_miss_callback + self.orientation = orientation self._comps = { 'dag_id', http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/ecdd8c6e/airflow/www/views.py ---------------------------------------------------------------------- diff --git a/airflow/www/views.py b/airflow/www/views.py index fa60b5c..08edd08 100644 --- a/airflow/www/views.py +++ b/airflow/www/views.py @@ -1228,7 +1228,6 @@ class Airflow(BaseView): session = settings.Session() dag_id = request.args.get('dag_id') blur = conf.getboolean('webserver', 'demo_mode') - arrange = request.args.get('arrange', "LR") dag = dagbag.get_dag(dag_id) if dag_id not in dagbag.dags: flash('DAG "{0}" seems to be missing.'.format(dag_id), "error") @@ -1241,6 +1240,8 @@ class Airflow(BaseView): include_upstream=True, include_downstream=False) + arrange = request.args.get('arrange', dag.orientation) + nodes = [] edges = [] for task in dag.tasks: