[jira] [Created] (AIRFLOW-2781) SLA Usage
Xiaodong DENG created AIRFLOW-2781: -- Summary: SLA Usage Key: AIRFLOW-2781 URL: https://issues.apache.org/jira/browse/AIRFLOW-2781 Project: Apache Airflow Issue Type: Bug Components: configuration Affects Versions: 1.9.0 Reporter: Xiaodong DENG Hi, the documentation or information about SLA is quite limited. I'm trying to set up SLA for my DAGs, but it's not working as I expected/assumed. One example is {code:java} // https://github.com/DFStoneburner/airflow-sla-examples/blob/master/basic_sla.py t1 = BashOperator( task_id='timeout', # Set our task up with a 10 second SLA sla=timedelta(seconds=10), # Sleep 15 seconds to guarantee we miss the SLA bash_command='sleep 15', dag=dag ) {code} Actually I don't see any record in "*Browse -> SLA Misses*" even if this DAG can run on schedule. For my scenario, let's say my schedule interval of the DAG is `_*0 3 * * **_` (3AM in the morning), * if I expect my task is succeeded by 3:30AM, I set `*sla=timedelta(minutes=30)*`. * if I expect my task is succeeded by 3AM or earlier, I set `*sla=timedelta(seconds=0)*`. But seems it's not working as I assumed. May any one kindly advise on this? Thanks! -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRFLOW-2753) dataproc_operator job operators provide a way to get the actual jobId submitted to Dataproc
[ https://issues.apache.org/jira/browse/AIRFLOW-2753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16552152#comment-16552152 ] ASF subversion and git services commented on AIRFLOW-2753: -- Commit 03ac60dd67388951f033f4e64bbe55d62cd6257f in incubator-airflow's branch refs/heads/master from Jeffrey Scott Keone Payne [ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=03ac60d ] [AIRFLOW-2753] Add dataproc_job_id instance var holding actual DP jobId Closes #3622 from jeffkpayne/master > dataproc_operator job operators provide a way to get the actual jobId > submitted to Dataproc > --- > > Key: AIRFLOW-2753 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2753 > Project: Apache Airflow > Issue Type: Improvement > Components: contrib, operators >Reporter: Jeffrey Payne >Assignee: Jeffrey Payne >Priority: Minor > Labels: dataproc, google, google-compute-engine, operator > Fix For: 2.0.0 > > > I'd like to be able to get the {{jobId}} that's submitted by the > {{DataProcHook}} in order to do things like build the URL to the Dataproc job > UI, etc. The {{job_name}} that the caller passes into > {{DataProcPySparkOperator}}, etc gets an 8 character random string appended > to it before the job is submitted. I don't currently see a way to access > that value, which is needed for the above mentioned use case. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Resolved] (AIRFLOW-2753) dataproc_operator job operators provide a way to get the actual jobId submitted to Dataproc
[ https://issues.apache.org/jira/browse/AIRFLOW-2753?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Kaxil Naik resolved AIRFLOW-2753. - Resolution: Fixed Fix Version/s: 2.0.0 Issue resolved by pull request #3622 [https://github.com/apache/incubator-airflow/pull/3622] > dataproc_operator job operators provide a way to get the actual jobId > submitted to Dataproc > --- > > Key: AIRFLOW-2753 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2753 > Project: Apache Airflow > Issue Type: Improvement > Components: contrib, operators >Reporter: Jeffrey Payne >Assignee: Jeffrey Payne >Priority: Minor > Labels: dataproc, google, google-compute-engine, operator > Fix For: 2.0.0 > > > I'd like to be able to get the {{jobId}} that's submitted by the > {{DataProcHook}} in order to do things like build the URL to the Dataproc job > UI, etc. The {{job_name}} that the caller passes into > {{DataProcPySparkOperator}}, etc gets an 8 character random string appended > to it before the job is submitted. I don't currently see a way to access > that value, which is needed for the above mentioned use case. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
incubator-airflow git commit: [AIRFLOW-2753] Add dataproc_job_id instance var holding actual DP jobId
Repository: incubator-airflow Updated Branches: refs/heads/master c1217c349 -> 03ac60dd6 [AIRFLOW-2753] Add dataproc_job_id instance var holding actual DP jobId Closes #3622 from jeffkpayne/master Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/03ac60dd Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/03ac60dd Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/03ac60dd Branch: refs/heads/master Commit: 03ac60dd67388951f033f4e64bbe55d62cd6257f Parents: c1217c3 Author: Jeffrey Scott Keone Payne Authored: Sun Jul 22 21:54:21 2018 +0100 Committer: Kaxil Naik Committed: Sun Jul 22 21:54:21 2018 +0100 -- airflow/contrib/operators/dataproc_operator.py | 61 +-- .../contrib/operators/test_dataproc_operator.py | 79 +--- 2 files changed, 125 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/03ac60dd/airflow/contrib/operators/dataproc_operator.py -- diff --git a/airflow/contrib/operators/dataproc_operator.py b/airflow/contrib/operators/dataproc_operator.py index 5d59f7f..23cfeb0 100644 --- a/airflow/contrib/operators/dataproc_operator.py +++ b/airflow/contrib/operators/dataproc_operator.py @@ -669,6 +669,11 @@ class DataProcPigOperator(BaseOperator): :type delegate_to: string :param region: The specified region where the dataproc cluster is created. :type region: string +:var dataproc_job_id: The actual "jobId" as submitted to the Dataproc API. +This is useful for identifying or linking to the job in the Google Cloud Console +Dataproc UI, as the actual "jobId" submitted to the Dataproc API is appended with +an 8 character random string. +:vartype dataproc_job_id: string """ template_fields = ['query', 'variables', 'job_name', 'cluster_name', 'dataproc_jars'] template_ext = ('.pg', '.pig',) @@ -716,7 +721,10 @@ class DataProcPigOperator(BaseOperator): job.add_jar_file_uris(self.dataproc_jars) job.set_job_name(self.job_name) -hook.submit(hook.project_id, job.build(), self.region) +job_to_submit = job.build() +self.dataproc_job_id = job_to_submit["job"]["reference"]["jobId"] + +hook.submit(hook.project_id, job_to_submit, self.region) class DataProcHiveOperator(BaseOperator): @@ -749,6 +757,11 @@ class DataProcHiveOperator(BaseOperator): :type delegate_to: string :param region: The specified region where the dataproc cluster is created. :type region: string +:var dataproc_job_id: The actual "jobId" as submitted to the Dataproc API. +This is useful for identifying or linking to the job in the Google Cloud Console +Dataproc UI, as the actual "jobId" submitted to the Dataproc API is appended with +an 8 character random string. +:vartype dataproc_job_id: string """ template_fields = ['query', 'variables', 'job_name', 'cluster_name', 'dataproc_jars'] template_ext = ('.q',) @@ -797,7 +810,10 @@ class DataProcHiveOperator(BaseOperator): job.add_jar_file_uris(self.dataproc_jars) job.set_job_name(self.job_name) -hook.submit(hook.project_id, job.build(), self.region) +job_to_submit = job.build() +self.dataproc_job_id = job_to_submit["job"]["reference"]["jobId"] + +hook.submit(hook.project_id, job_to_submit, self.region) class DataProcSparkSqlOperator(BaseOperator): @@ -831,6 +847,11 @@ class DataProcSparkSqlOperator(BaseOperator): :type delegate_to: string :param region: The specified region where the dataproc cluster is created. :type region: string +:var dataproc_job_id: The actual "jobId" as submitted to the Dataproc API. +This is useful for identifying or linking to the job in the Google Cloud Console +Dataproc UI, as the actual "jobId" submitted to the Dataproc API is appended with +an 8 character random string. +:vartype dataproc_job_id: string """ template_fields = ['query', 'variables', 'job_name', 'cluster_name', 'dataproc_jars'] template_ext = ('.q',) @@ -879,7 +900,10 @@ class DataProcSparkSqlOperator(BaseOperator): job.add_jar_file_uris(self.dataproc_jars) job.set_job_name(self.job_name) -hook.submit(hook.project_id, job.build(), self.region) +job_to_submit = job.build() +self.dataproc_job_id = job_to_submit["job"]["reference"]["jobId"] + +hook.submit(hook.project_id, job_to_submit, self.region) class DataProcSparkOperator(BaseOperator): @@ -920,6 +944,11 @@ class DataProcSparkOperator(BaseOperator): :type delegate_to: string
incubator-airflow git commit: [AIRFLOW-XXX] Fix typos in docs
Repository: incubator-airflow Updated Branches: refs/heads/master 51fed8b1f -> c1217c349 [AIRFLOW-XXX] Fix typos in docs Closes #3625 from feluelle/master Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/c1217c34 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/c1217c34 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/c1217c34 Branch: refs/heads/master Commit: c1217c349f2c44c0ab024abaadb1108a478131d8 Parents: 51fed8b Author: Felix Authored: Sun Jul 22 14:56:52 2018 +0200 Committer: Bolke de Bruin Committed: Sun Jul 22 14:57:03 2018 +0200 -- CONTRIBUTING.md | 2 +- TODO.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/c1217c34/CONTRIBUTING.md -- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3fe5204..94997ae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -65,7 +65,7 @@ If you are proposing a feature: The latest API documentation is usually available [here](https://airflow.incubator.apache.org/). To generate a local version, -you need to have set up an Airflow development environemnt (see below). Also +you need to have set up an Airflow development environment (see below). Also install the `doc` extra. pip install -e .[doc] http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/c1217c34/TODO.md -- diff --git a/TODO.md b/TODO.md index cf19035..9f1a8a9 100644 --- a/TODO.md +++ b/TODO.md @@ -4,7 +4,7 @@ * Distributed scheduler (supervisors) * Get the supervisors to run sensors (as opposed to each sensor taking a slot) * Improve DagBag differential refresh -* Pickle all the THINGS! supervisors maintains fresh, versionned pickles in the database as they monitor for change +* Pickle all the THINGS! supervisors maintains fresh, versioned pickles in the database as they monitor for change * Pre-prod running off of master * Containment / YarnExecutor / Docker? * Get s3 logs
[jira] [Resolved] (AIRFLOW-2778) Bad Import in collect_dag in DagBag
[ https://issues.apache.org/jira/browse/AIRFLOW-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ash Berlin-Taylor resolved AIRFLOW-2778. Resolution: Fixed Fix Version/s: 1.10.1 2.0.0 Issue resolved by pull request #3624 [https://github.com/apache/incubator-airflow/pull/3624] > Bad Import in collect_dag in DagBag > --- > > Key: AIRFLOW-2778 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2778 > Project: Apache Airflow > Issue Type: Bug > Components: DAG >Affects Versions: 1.10 >Reporter: Kevin Yuen >Assignee: Kevin Yuen >Priority: Minor > Fix For: 2.0.0, 1.10.1 > > > I run the following test to make sure there are no import errors in our CI. > After upgrading to 1.10-stable from 1.9.0, the following test starting > failing: > {code:java} > class TestAirflowDag: > def test_dagbag_import(self): > """Verify that Airflow will be able to import all DAGS in the repo > """ > dagbag = self._get_dagbag() > assert len(dagbag.import_errors) == 0 > def _get_dagbag(self): > dag_folder = os.getenv('AIRFLOW_DAGS', False) > assert dag_folder is not None > return DagBag(dag_folder=dag_folder, include_examples=False) > {code} > The following error was raised: > {code:java} > # Used to store stats around DagBag processing > stats = [] > FileLoadStat = namedtuple( > 'FileLoadStat', > "file duration dag_num task_num dags" > ) > for filepath in utils.dag_processing.list_py_file_paths(dag_folder): > E AttributeError: module 'airflow.utils' has no attribute 'dag_processing' > {code} > The issue is likely because `dag_processing` was not imported. > [https://github.com/apache/incubator-airflow/blob/7f2bc0ddf74c9bf9113401c4ecb1355e6c2fab7f/airflow/models.py#L68-L94] > This was further validated by stopping execution using pdb, and running > before utils.dag_processing.list_py_file_paths(dag_folder) is called. > {code:java} > >> from airflow.utils.dag_processing import *{code} > The test then proceed to pass since the file was loaded. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRFLOW-2778) Bad Import in collect_dag in DagBag
[ https://issues.apache.org/jira/browse/AIRFLOW-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16551990#comment-16551990 ] ASF subversion and git services commented on AIRFLOW-2778: -- Commit 64dacb1ca319443f06e4860b817888946943c8f1 in incubator-airflow's branch refs/heads/v1-10-stable from [~knyuen] [ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=64dacb1 ] [AIRFLOW-2778] Explicit import for dag_processing.list_py_file_paths The use of utils.dag_processing.list_py_file_paths causes a failure if utils.dag_processing is not already loaded indirectly. (cherry picked from commit ba5b67b6c99e0bfb0f827518cdb31b5eb5a5a626) Signed-off-by: Ash Berlin-Taylor > Bad Import in collect_dag in DagBag > --- > > Key: AIRFLOW-2778 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2778 > Project: Apache Airflow > Issue Type: Bug > Components: DAG >Affects Versions: 1.10 >Reporter: Kevin Yuen >Assignee: Kevin Yuen >Priority: Minor > Fix For: 2.0.0, 1.10.1 > > > I run the following test to make sure there are no import errors in our CI. > After upgrading to 1.10-stable from 1.9.0, the following test starting > failing: > {code:java} > class TestAirflowDag: > def test_dagbag_import(self): > """Verify that Airflow will be able to import all DAGS in the repo > """ > dagbag = self._get_dagbag() > assert len(dagbag.import_errors) == 0 > def _get_dagbag(self): > dag_folder = os.getenv('AIRFLOW_DAGS', False) > assert dag_folder is not None > return DagBag(dag_folder=dag_folder, include_examples=False) > {code} > The following error was raised: > {code:java} > # Used to store stats around DagBag processing > stats = [] > FileLoadStat = namedtuple( > 'FileLoadStat', > "file duration dag_num task_num dags" > ) > for filepath in utils.dag_processing.list_py_file_paths(dag_folder): > E AttributeError: module 'airflow.utils' has no attribute 'dag_processing' > {code} > The issue is likely because `dag_processing` was not imported. > [https://github.com/apache/incubator-airflow/blob/7f2bc0ddf74c9bf9113401c4ecb1355e6c2fab7f/airflow/models.py#L68-L94] > This was further validated by stopping execution using pdb, and running > before utils.dag_processing.list_py_file_paths(dag_folder) is called. > {code:java} > >> from airflow.utils.dag_processing import *{code} > The test then proceed to pass since the file was loaded. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
incubator-airflow git commit: [AIRFLOW-2778] Explicit import for dag_processing.list_py_file_paths
Repository: incubator-airflow Updated Branches: refs/heads/v1-10-stable fc00875ed -> 64dacb1ca [AIRFLOW-2778] Explicit import for dag_processing.list_py_file_paths The use of utils.dag_processing.list_py_file_paths causes a failure if utils.dag_processing is not already loaded indirectly. (cherry picked from commit ba5b67b6c99e0bfb0f827518cdb31b5eb5a5a626) Signed-off-by: Ash Berlin-Taylor Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/64dacb1c Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/64dacb1c Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/64dacb1c Branch: refs/heads/v1-10-stable Commit: 64dacb1ca319443f06e4860b817888946943c8f1 Parents: fc00875 Author: Kevin Yuen Authored: Sat Jul 21 12:38:21 2018 -0400 Committer: Ash Berlin-Taylor Committed: Sun Jul 22 13:16:45 2018 +0100 -- airflow/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/64dacb1c/airflow/models.py -- diff --git a/airflow/models.py b/airflow/models.py index cb0165a..6b244cd 100755 --- a/airflow/models.py +++ b/airflow/models.py @@ -79,6 +79,7 @@ from airflow.ti_deps.deps.trigger_rule_dep import TriggerRuleDep from airflow.ti_deps.dep_context import DepContext, QUEUE_DEPS, RUN_DEPS from airflow.utils import timezone +from airflow.utils.dag_processing import list_py_file_paths from airflow.utils.dates import cron_presets, date_range as utils_date_range from airflow.utils.db import provide_session from airflow.utils.decorators import apply_defaults @@ -520,7 +521,7 @@ class DagBag(BaseDagBag, LoggingMixin): stats = [] FileLoadStat = namedtuple( 'FileLoadStat', "file duration dag_num task_num dags") -for filepath in utils.dag_processing.list_py_file_paths(dag_folder): +for filepath in list_py_file_paths(dag_folder): try: ts = timezone.utcnow() found_dags = self.process_file(
[jira] [Commented] (AIRFLOW-2778) Bad Import in collect_dag in DagBag
[ https://issues.apache.org/jira/browse/AIRFLOW-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16551988#comment-16551988 ] ASF subversion and git services commented on AIRFLOW-2778: -- Commit ba5b67b6c99e0bfb0f827518cdb31b5eb5a5a626 in incubator-airflow's branch refs/heads/master from [~knyuen] [ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=ba5b67b ] [AIRFLOW-2778] Explicit import for dag_processing.list_py_file_paths The use of utils.dag_processing.list_py_file_paths causes a failure if utils.dag_processing is not already loaded indirectly. > Bad Import in collect_dag in DagBag > --- > > Key: AIRFLOW-2778 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2778 > Project: Apache Airflow > Issue Type: Bug > Components: DAG >Affects Versions: 1.10 >Reporter: Kevin Yuen >Assignee: Kevin Yuen >Priority: Minor > > I run the following test to make sure there are no import errors in our CI. > After upgrading to 1.10-stable from 1.9.0, the following test starting > failing: > {code:java} > class TestAirflowDag: > def test_dagbag_import(self): > """Verify that Airflow will be able to import all DAGS in the repo > """ > dagbag = self._get_dagbag() > assert len(dagbag.import_errors) == 0 > def _get_dagbag(self): > dag_folder = os.getenv('AIRFLOW_DAGS', False) > assert dag_folder is not None > return DagBag(dag_folder=dag_folder, include_examples=False) > {code} > The following error was raised: > {code:java} > # Used to store stats around DagBag processing > stats = [] > FileLoadStat = namedtuple( > 'FileLoadStat', > "file duration dag_num task_num dags" > ) > for filepath in utils.dag_processing.list_py_file_paths(dag_folder): > E AttributeError: module 'airflow.utils' has no attribute 'dag_processing' > {code} > The issue is likely because `dag_processing` was not imported. > [https://github.com/apache/incubator-airflow/blob/7f2bc0ddf74c9bf9113401c4ecb1355e6c2fab7f/airflow/models.py#L68-L94] > This was further validated by stopping execution using pdb, and running > before utils.dag_processing.list_py_file_paths(dag_folder) is called. > {code:java} > >> from airflow.utils.dag_processing import *{code} > The test then proceed to pass since the file was loaded. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (AIRFLOW-2778) Bad Import in collect_dag in DagBag
[ https://issues.apache.org/jira/browse/AIRFLOW-2778?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16551989#comment-16551989 ] ASF subversion and git services commented on AIRFLOW-2778: -- Commit 51fed8b1f1070cd2736071d96355a8f42e740edd in incubator-airflow's branch refs/heads/master from [~ashb] [ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=51fed8b ] Merge pull request #3624 from KevYuen/AIRFLOW-2778-bad-dagbag-import > Bad Import in collect_dag in DagBag > --- > > Key: AIRFLOW-2778 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2778 > Project: Apache Airflow > Issue Type: Bug > Components: DAG >Affects Versions: 1.10 >Reporter: Kevin Yuen >Assignee: Kevin Yuen >Priority: Minor > > I run the following test to make sure there are no import errors in our CI. > After upgrading to 1.10-stable from 1.9.0, the following test starting > failing: > {code:java} > class TestAirflowDag: > def test_dagbag_import(self): > """Verify that Airflow will be able to import all DAGS in the repo > """ > dagbag = self._get_dagbag() > assert len(dagbag.import_errors) == 0 > def _get_dagbag(self): > dag_folder = os.getenv('AIRFLOW_DAGS', False) > assert dag_folder is not None > return DagBag(dag_folder=dag_folder, include_examples=False) > {code} > The following error was raised: > {code:java} > # Used to store stats around DagBag processing > stats = [] > FileLoadStat = namedtuple( > 'FileLoadStat', > "file duration dag_num task_num dags" > ) > for filepath in utils.dag_processing.list_py_file_paths(dag_folder): > E AttributeError: module 'airflow.utils' has no attribute 'dag_processing' > {code} > The issue is likely because `dag_processing` was not imported. > [https://github.com/apache/incubator-airflow/blob/7f2bc0ddf74c9bf9113401c4ecb1355e6c2fab7f/airflow/models.py#L68-L94] > This was further validated by stopping execution using pdb, and running > before utils.dag_processing.list_py_file_paths(dag_folder) is called. > {code:java} > >> from airflow.utils.dag_processing import *{code} > The test then proceed to pass since the file was loaded. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[1/2] incubator-airflow git commit: [AIRFLOW-2778] Explicit import for dag_processing.list_py_file_paths
Repository: incubator-airflow Updated Branches: refs/heads/master 5a7f0b2e5 -> 51fed8b1f [AIRFLOW-2778] Explicit import for dag_processing.list_py_file_paths The use of utils.dag_processing.list_py_file_paths causes a failure if utils.dag_processing is not already loaded indirectly. Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/ba5b67b6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/ba5b67b6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/ba5b67b6 Branch: refs/heads/master Commit: ba5b67b6c99e0bfb0f827518cdb31b5eb5a5a626 Parents: 7f2bc0d Author: Kevin Yuen Authored: Sat Jul 21 12:38:21 2018 -0400 Committer: Kevin Yuen Committed: Sat Jul 21 12:51:53 2018 -0400 -- airflow/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/ba5b67b6/airflow/models.py -- diff --git a/airflow/models.py b/airflow/models.py index 57ef9d3..68a502d 100755 --- a/airflow/models.py +++ b/airflow/models.py @@ -79,6 +79,7 @@ from airflow.ti_deps.deps.trigger_rule_dep import TriggerRuleDep from airflow.ti_deps.dep_context import DepContext, QUEUE_DEPS, RUN_DEPS from airflow.utils import timezone +from airflow.utils.dag_processing import list_py_file_paths from airflow.utils.dates import cron_presets, date_range as utils_date_range from airflow.utils.db import provide_session from airflow.utils.decorators import apply_defaults @@ -520,7 +521,7 @@ class DagBag(BaseDagBag, LoggingMixin): stats = [] FileLoadStat = namedtuple( 'FileLoadStat', "file duration dag_num task_num dags") -for filepath in utils.dag_processing.list_py_file_paths(dag_folder): +for filepath in list_py_file_paths(dag_folder): try: ts = timezone.utcnow() found_dags = self.process_file(
[16/16] incubator-airflow git commit: [AIRFLOW-2691] Manage JS dependencies via npm
[AIRFLOW-2691] Manage JS dependencies via npm Closes #3572 from verdan/AIRFLOW-2691-npm-webpack Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/5a7f0b2e Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/5a7f0b2e Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/5a7f0b2e Branch: refs/heads/master Commit: 5a7f0b2e5333c936b39cdec06315d109ccf96934 Parents: 27fde38 Author: Verdan Mahmood Authored: Sun Jul 22 09:23:57 2018 +0200 Committer: Bolke de Bruin Committed: Sun Jul 22 09:24:11 2018 +0200 -- .gitignore | 6 + .rat-excludes | 2 + CONTRIBUTING.md |57 + MANIFEST.in | 6 +- airflow/www_rbac/app.py | 3 +- airflow/www_rbac/compile_assets.sh |23 + airflow/www_rbac/package-lock.json | 12408 ++ airflow/www_rbac/package.json |55 + airflow/www_rbac/static/bootstrap-theme.css | 6494 .../www_rbac/static/bootstrap-toggle.min.css|28 - airflow/www_rbac/static/bootstrap-toggle.min.js | 9 - .../www_rbac/static/bootstrap3-typeahead.min.js |26 - airflow/www_rbac/static/connection_form.js |78 - airflow/www_rbac/static/css/bootstrap-theme.css | 6494 airflow/www_rbac/static/css/gantt.css |57 + airflow/www_rbac/static/css/graph.css |92 + airflow/www_rbac/static/css/main.css| 267 + airflow/www_rbac/static/css/tree.css|96 + airflow/www_rbac/static/d3.tip.v0.6.3.js| 302 - airflow/www_rbac/static/d3.v3.min.js| 5 - airflow/www_rbac/static/dagre-d3.js | 5007 -- airflow/www_rbac/static/dagre-d3.min.js | 2 - airflow/www_rbac/static/dagre.css |38 - .../www_rbac/static/dataTables.bootstrap.css| 333 - airflow/www_rbac/static/gantt-chart-d3v2.js | 267 - airflow/www_rbac/static/gantt.css |57 - airflow/www_rbac/static/graph.css |72 - airflow/www_rbac/static/jqClock.min.js |27 - airflow/www_rbac/static/jquery.dataTables.css | 495 - .../www_rbac/static/jquery.dataTables.min.js| 189 - airflow/www_rbac/static/js/clock.js |41 + airflow/www_rbac/static/js/connection_form.js |80 + airflow/www_rbac/static/js/dagre-d3.js | 5007 ++ airflow/www_rbac/static/js/gantt-chart-d3v2.js | 267 + airflow/www_rbac/static/js/jqClock.min.js |27 + airflow/www_rbac/static/main.css| 267 - airflow/www_rbac/static/nv.d3.css | 788 - airflow/www_rbac/static/nv.d3.js| 14260 - airflow/www_rbac/static/tree.css|96 - airflow/www_rbac/static_config.py |63 + airflow/www_rbac/templates/airflow/chart.html |11 +- airflow/www_rbac/templates/airflow/circles.html | 8 +- .../www_rbac/templates/airflow/conn_create.html | 8 +- .../www_rbac/templates/airflow/conn_edit.html | 8 +- airflow/www_rbac/templates/airflow/dag.html |23 +- airflow/www_rbac/templates/airflow/dags.html|17 +- .../templates/airflow/duration_chart.html |11 +- airflow/www_rbac/templates/airflow/gantt.html |10 +- airflow/www_rbac/templates/airflow/graph.html |10 +- airflow/www_rbac/templates/airflow/tree.html| 7 +- .../templates/appbuilder/baselayout.html|35 +- airflow/www_rbac/webpack.config.js | 128 + dev/README.md |15 +- setup.py|19 + 54 files changed, 25274 insertions(+), 28927 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/.gitignore -- diff --git a/.gitignore b/.gitignore index 0e53aad..9749b1a 100644 --- a/.gitignore +++ b/.gitignore @@ -138,3 +138,9 @@ rat-results.txt *.generated *.tar.gz scripts/ci/kubernetes/kube/.generated/airflow.yaml + +# Node & Webpack Stuff +*.entry.js +node_modules +npm-debug.log* +static/dist http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/.rat-excludes -- diff --git a/.rat-excludes b/.rat-excludes index e5373aa..0164f99 100644 --- a/.rat-excludes +++ b/.rat-excludes @@ -37,3 +37,5 @@ bootstrap-toggle.min.js bootstrap-toggle.min.css d3.v3.min.js ace.js +airflow/www_rbac/node_modules +.*json
[14/16] incubator-airflow git commit: [AIRFLOW-2691] Manage JS dependencies via npm
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/package.json -- diff --git a/airflow/www_rbac/package.json b/airflow/www_rbac/package.json new file mode 100644 index 000..5f0c4bc --- /dev/null +++ b/airflow/www_rbac/package.json @@ -0,0 +1,55 @@ +{ + "description": "Apache Airflow is a platform to programmatically author, schedule and monitor workflows.", + "scripts": { +"test": "echo \"Error: no test specified\" && exit 1", +"dev": "NODE_ENV=dev webpack --watch --colors --progress --debug --output-pathinfo --devtool eval-cheap-source-map --mode development", +"prod": "NODE_ENV=production node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js -p --colors --progress", +"build": "NODE_ENV=production webpack --colors --progress" + }, + "author": "Apache", + "license": "Apache-2.0", + "repository": { +"type": "git", +"url": "git+https://github.com/apache/incubator-airflow.git; + }, + "homepage": "http://airflow.apache.org/;, + "keywords": [ +"big", +"data", +"workflow", +"airflow", +"d3", +"nerds", +"database", +"flask" + ], + "devDependencies": { +"babel": "^6.23.0", +"babel-core": "^6.26.3", +"babel-istanbul": "^0.12.2", +"babel-loader": "^7.1.4", +"babel-plugin-css-modules-transform": "^1.6.1", +"babel-polyfill": "^6.26.0", +"clean-webpack-plugin": "^0.1.19", +"copy-webpack-plugin": "^4.5.2", +"css-loader": "^0.28.11", +"file-loader": "^1.1.11", +"imports-loader": "^0.8.0", +"mini-css-extract-plugin": "^0.4.1", +"style-loader": "^0.21.0", +"url-loader": "^1.0.1", +"webpack": "^4.12.2", +"webpack-cli": "^3.0.8", +"webpack-manifest-plugin": "^2.0.3" + }, + "dependencies": { +"bootstrap-3-typeahead": "^4.0.2", +"bootstrap-toggle": "^2.2.2", +"d3": "^3.4.4", +"d3-tip": "^0.9.1", +"datatables.net": "^1.10.19", +"datatables.net-bs": "^1.10.19", +"npm": "^6.1.0", +"nvd3": "^1.8.6" + } +}
[02/16] incubator-airflow git commit: [AIRFLOW-2691] Manage JS dependencies via npm
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static/nv.d3.js -- diff --git a/airflow/www_rbac/static/nv.d3.js b/airflow/www_rbac/static/nv.d3.js deleted file mode 100644 index faa9a00..000 --- a/airflow/www_rbac/static/nv.d3.js +++ /dev/null @@ -1,14260 +0,0 @@ -/** -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -(function(){ - -var nv = window.nv || {}; - - -nv.version = '1.1.11b'; -nv.dev = true //set false when in production - -window.nv = nv; - -nv.tooltip = {}; // For the tooltip system -nv.utils = {}; // Utility subsystem -nv.models = {}; //stores all the possible models/components -nv.charts = {}; //stores all the ready to use charts -nv.graphs = []; //stores all the graphs currently on the page -nv.logs = {}; //stores some statistics and potential error messages - -nv.dispatch = d3.dispatch('render_start', 'render_end'); - -// * -// Development render timers - disabled if dev = false - -if (nv.dev) { - nv.dispatch.on('render_start', function(e) { -nv.logs.startTime = +new Date(); - }); - - nv.dispatch.on('render_end', function(e) { -nv.logs.endTime = +new Date(); -nv.logs.totalTime = nv.logs.endTime - nv.logs.startTime; -nv.log('total', nv.logs.totalTime); // used for development, to keep track of graph generation times - }); -} - -// -// Public Core NV functions - -// Logs all arguments, and returns the last so you can test things in place -// Note: in IE8 console.log is an object not a function, and if modernizr is used -// then calling Function.prototype.bind with with anything other than a function -// causes a TypeError to be thrown. -nv.log = function() { - if (nv.dev && console.log && console.log.apply) -console.log.apply(console, arguments) - else if (nv.dev && typeof console.log == "function" && Function.prototype.bind) { -var log = Function.prototype.bind.call(console.log, console); -log.apply(console, arguments); - } - return arguments[arguments.length - 1]; -}; - - -nv.render = function render(step) { - step = step || 1; // number of graphs to generate in each timeout loop - - nv.render.active = true; - nv.dispatch.render_start(); - - setTimeout(function() { -var chart, graph; - -for (var i = 0; i < step && (graph = nv.render.queue[i]); i++) { - chart = graph.generate(); - if (typeof graph.callback == typeof(Function)) graph.callback(chart); - nv.graphs.push(chart); -} - -nv.render.queue.splice(0, i); - -if (nv.render.queue.length) setTimeout(arguments.callee, 0); -else { nv.render.active = false; nv.dispatch.render_end(); } - }, 0); -}; - -nv.render.active = false; -nv.render.queue = []; - -nv.addGraph = function(obj) { - if (typeof arguments[0] === typeof(Function)) -obj = {generate: arguments[0], callback: arguments[1]}; - - nv.render.queue.push(obj); - - if (!nv.render.active) nv.render(); -}; - -nv.identity = function(d) { return d; }; - -nv.strip = function(s) { return s.replace(/(\s|&)/g,''); }; - -function daysInMonth(month,year) { - return (new Date(year, month+1, 0)).getDate(); -} - -function d3_time_range(floor, step, number) { - return function(t0, t1, dt) { -var time = floor(t0), times = []; -if (time < t0) step(time); -if (dt > 1) { - while (time < t1) { -var date = new Date(+time); -if ((number(date) % dt === 0)) times.push(date); -step(time); - } -} else { - while (time < t1) { times.push(new Date(+time)); step(time); } -} -return times; - }; -} - -d3.time.monthEnd = function(date) { - return new Date(date.getFullYear(), date.getMonth(), 0); -}; - -d3.time.monthEnds = d3_time_range(d3.time.monthEnd, function(date) { -date.setUTCDate(date.getUTCDate() + 1); -date.setDate(daysInMonth(date.getMonth() + 1, date.getFullYear())); - }, function(date) { -return date.getMonth(); - } -); - -/* Utility class to handle creation of an interactive layer. -This places a rectangle on top of the chart. When you mouse move over it, it sends a
[jira] [Commented] (AIRFLOW-2691) Make Airflow's JS code (and dependencies) manageable via npm and webpack
[ https://issues.apache.org/jira/browse/AIRFLOW-2691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16551918#comment-16551918 ] ASF subversion and git services commented on AIRFLOW-2691: -- Commit 5a7f0b2e5333c936b39cdec06315d109ccf96934 in incubator-airflow's branch refs/heads/master from [~verdan] [ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=5a7f0b2 ] [AIRFLOW-2691] Manage JS dependencies via npm Closes #3572 from verdan/AIRFLOW-2691-npm-webpack > Make Airflow's JS code (and dependencies) manageable via npm and webpack > > > Key: AIRFLOW-2691 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2691 > Project: Apache Airflow > Issue Type: New Feature >Reporter: Verdan Mahmood >Assignee: Verdan Mahmood >Priority: Major > Fix For: 2.0.0 > > > Airflow's JS code is hard to maintain and upgrade. The dependencies are > locally existing files making it hard to upgrade versions. > Make sure Airflow uses *npm* and *webpack* for the dependencies management. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[03/16] incubator-airflow git commit: [AIRFLOW-2691] Manage JS dependencies via npm
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static/js/gantt-chart-d3v2.js -- diff --git a/airflow/www_rbac/static/js/gantt-chart-d3v2.js b/airflow/www_rbac/static/js/gantt-chart-d3v2.js new file mode 100644 index 000..d21311a --- /dev/null +++ b/airflow/www_rbac/static/js/gantt-chart-d3v2.js @@ -0,0 +1,267 @@ +/** +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +/** + * @author Dimitry Kudrayvtsev + * @version 2.1 + * @modifiedby Maxime Beauchemin + */ + +d3.gantt = function() { + var FIT_TIME_DOMAIN_MODE = "fit"; + var FIXED_TIME_DOMAIN_MODE = "fixed"; + var tip = d3.tip() +.attr('class', 'd3-tip') +.offset([-10, 0]) +.html(function(d) { + var s = "" + s += ""; + s += "start:end:duration:" + s += " " + s += d.isoStart + ""; + s += d.isoEnd + ""; + s += d.duration + ""; + s += ""; + s += ""; + return s; + }) + + var margin = { +top : 20, +right : 40, +bottom : 20, +left : 150 + }; + var yAxisLeftOffset = 220; + var selector = 'body'; + var timeDomainStart = d3.time.day.offset(new Date(),-3); + var timeDomainEnd = d3.time.hour.offset(new Date(),+3); + var timeDomainMode = FIT_TIME_DOMAIN_MODE;// fixed or fit + var taskTypes = []; + var taskStatus = []; + var height = document.body.clientHeight - margin.top - margin.bottom-5; + var width = $('.gantt').width() - margin.right - margin.left-5; + + var tickFormat = "%H:%M"; + + var keyFunction = function(d) { +return d.startDate + d.taskName + d.endDate; + }; + + var rectTransform = function(d) { +return "translate(" + (x(d.startDate) + yAxisLeftOffset) + "," + y(d.taskName) + ")"; + }; + + var x = d3.time.scale().domain([ timeDomainStart, timeDomainEnd ]).range([ 0, (width-yAxisLeftOffset) ]).clamp(true); + + var y = d3.scale.ordinal().domain(taskTypes).rangeRoundBands([ 0, height - margin.top - margin.bottom ], .1); + + var xAxis = d3.svg.axis().scale(x).orient("bottom").tickFormat(d3.time.format(tickFormat)).tickSubdivide(true) + .tickSize(8).tickPadding(8); + + var yAxis = d3.svg.axis().scale(y).orient("left").tickSize(0); + + var initTimeDomain = function(tasks) { +if (timeDomainMode === FIT_TIME_DOMAIN_MODE) { + if (tasks === undefined || tasks.length < 1) { +timeDomainStart = d3.time.day.offset(new Date(), -3); +timeDomainEnd = d3.time.hour.offset(new Date(), +3); +return; + } + tasks.sort(function(a, b) { +return a.endDate - b.endDate; + }); + timeDomainEnd = tasks[tasks.length - 1].endDate; + tasks.sort(function(a, b) { +return a.startDate - b.startDate; + }); + timeDomainStart = tasks[0].startDate; +} + }; + + var initAxis = function() { +x = d3.time.scale().domain([ timeDomainStart, timeDomainEnd ]).range([ 0, width-yAxisLeftOffset ]).clamp(true); +y = d3.scale.ordinal().domain(taskTypes).rangeRoundBands([ 0, height - margin.top - margin.bottom ], .1); +xAxis = d3.svg.axis().scale(x).orient("bottom").tickFormat(d3.time.format(tickFormat)).tickSubdivide(true) +.tickSize(8).tickPadding(8); + +yAxis = d3.svg.axis().scale(y).orient("left").tickSize(0); + }; + + function gantt(tasks) { + +initTimeDomain(tasks); +initAxis(); + +var svg = d3.select(selector) +.append("svg") +.attr("class", "chart") +.attr("width", width + margin.left + margin.right) +.attr("height", height + margin.top + margin.bottom) +.append("g") +.attr("class", "gantt-chart") +.attr("width", width + margin.left + margin.right) +.attr("height", height + margin.top + margin.bottom) +.attr("transform", "translate(" + margin.left + ", " + margin.top + ")"); + +svg.selectAll(".chart") +.data(tasks, keyFunction).enter() +.append("rect") +.on('mouseover', tip.show) +.on('mouseout', tip.hide) +.on('click', function(d) { + call_modal(d.taskName, d.executionDate); +}) +.attr("class", function(d){ + if(taskStatus[d.status] == null){ return "bar";} + return taskStatus[d.status]; +}) +.attr("y", 0) +
[10/16] incubator-airflow git commit: [AIRFLOW-2691] Manage JS dependencies via npm
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static/css/gantt.css -- diff --git a/airflow/www_rbac/static/css/gantt.css b/airflow/www_rbac/static/css/gantt.css new file mode 100644 index 000..8714705 --- /dev/null +++ b/airflow/www_rbac/static/css/gantt.css @@ -0,0 +1,57 @@ +/** +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +.axis path,.axis line { +fill: none; +stroke: #000; +shape-rendering: crispEdges; +} +rect { +stroke: black; +cursor: pointer; +} +.d3-tip { + line-height: 1; + font-weight: bold; + padding: 5px; + background: rgba(0, 0, 0, 0.8); + color: #fff; + border-radius: 2px; + font-size: 12px; +} + +/* Creates a small triangle extender for the tooltip */ +.d3-tip:after { + box-sizing: border-box; + display: inline; + font-size: 8px; + width: 100%; + line-height: 1; + color: rgba(0, 0, 0, 0.8); + content: "\25BC"; + position: absolute; + text-align: center; +} + +/* Style northward tooltips differently */ +.d3-tip.n:after { + margin: -1px 0 0 0; + top: 100%; + left: 0; +} http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static/css/graph.css -- diff --git a/airflow/www_rbac/static/css/graph.css b/airflow/www_rbac/static/css/graph.css new file mode 100644 index 000..fa055b9 --- /dev/null +++ b/airflow/www_rbac/static/css/graph.css @@ -0,0 +1,92 @@ +/** +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +svg { +overflow: hidden; +} + +.node rect { +stroke: #333; +stroke-width: 1px; +fill: #fff; +} + +.edgeLabel rect { +fill: #fff; +} + +.edgePath { +stroke: #333; +stroke-width: 1px; +fill: none; +} + +g.node rect { +stroke-width: 3; +stroke: white; +cursor: pointer; +} +g.node text { +cursor: pointer; +} +g.node.success rect { +stroke: green; +} +g.node.up_for_retry rect { +stroke: gold; +} + +g.node.queued rect { +stroke: grey; +} + +g.node.running rect{ +stroke: lime; +} +g.node.failed rect { +stroke: red; +} +g.node.shutdown rect{ +stroke: blue; +} +g.node.upstream_failed rect{ +stroke: orange; +} +g.node.skipped rect{ +stroke: pink; +} +div#svg_container { + border: 1px solid black; + background-color: #EEE; + cursor: move; +} + +#refresh_button { +top: 15px; +right: 15px; +position: relative; +} + +#loading { +margin: auto; +display: none; +position: relative; +width: 100px; +top: -550px; +} http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static/css/main.css -- diff --git a/airflow/www_rbac/static/css/main.css b/airflow/www_rbac/static/css/main.css new file mode 100644 index 000..ac61899 --- /dev/null +++ b/airflow/www_rbac/static/css/main.css @@ -0,0 +1,267 @@ +/** +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +*
[11/16] incubator-airflow git commit: [AIRFLOW-2691] Manage JS dependencies via npm
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static/css/bootstrap-theme.css -- diff --git a/airflow/www_rbac/static/css/bootstrap-theme.css b/airflow/www_rbac/static/css/bootstrap-theme.css new file mode 100644 index 000..734f940 --- /dev/null +++ b/airflow/www_rbac/static/css/bootstrap-theme.css @@ -0,0 +1,6494 @@ +/*! + * Bootstrap v3.2 + * + * Copyright 2014 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world by @mdo and @fat. + * BootSwatchr built and provided by @DrewStrickland + */ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ +html { + font-family: sans-serif; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; +} +body { + margin: 0; +} +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} +audio, +canvas, +progress, +video { + display: inline-block; + vertical-align: baseline; +} +audio:not([controls]) { + display: none; + height: 0; +} +[hidden], +template { + display: none; +} +a { + background-color: transparent; +} +a:active, +a:hover { + outline: 0; +} +abbr[title] { + border-bottom: 1px dotted; +} +b, +strong { + font-weight: bold; +} +dfn { + font-style: italic; +} +h1 { + font-size: 2em; + margin: 0.67em 0; +} +mark { + background: #ff0; + color: #000; +} +small { + font-size: 80%; +} +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} +img { + border: 0; +} +svg:not(:root) { + overflow: hidden; +} +figure { + margin: 1em 40px; +} +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; +} +pre { + overflow: auto; +} +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} +button, +input, +optgroup, +select, +textarea { + color: inherit; + font: inherit; + margin: 0; +} +button { + overflow: visible; +} +button, +select { + text-transform: none; +} +button, +html input[type="button"], +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; + cursor: pointer; +} +button[disabled], +html input[disabled] { + cursor: default; +} +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; +} +input { + line-height: normal; +} +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; +} +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} +input[type="search"] { + -webkit-appearance: textfield; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + box-sizing: content-box; +} +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} +legend { + border: 0; + padding: 0; +} +textarea { + overflow: auto; +} +optgroup { + font-weight: bold; +} +table { + border-collapse: collapse; + border-spacing: 0; +} +td, +th { + padding: 0; +} +/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ +@media print { + *, + *:before, + *:after { +background: transparent !important; +color: #000 !important; +box-shadow: none !important; +text-shadow: none !important; + } + a, + a:visited { +text-decoration: underline; + } + a[href]:after { +content: " (" attr(href) ")"; + } + abbr[title]:after { +content: " (" attr(title) ")"; + } + a[href^="#"]:after, + a[href^="javascript:"]:after { +content: ""; + } + pre, + blockquote { +border: 1px solid #999; +page-break-inside: avoid; + } + thead { +display: table-header-group; + } + tr, + img { +page-break-inside: avoid; + } + img { +max-width: 100% !important; + } + p, + h2, + h3 { +orphans: 3; +widows: 3; + } + h2, + h3 { +page-break-after: avoid; + } + select { +background: #fff !important; + } + .navbar { +display: none; + } + .btn > .caret, + .dropup > .btn > .caret { +border-top-color: #000 !important; + } + .label { +border: 1px solid #000; + } + .table { +border-collapse: collapse !important; + } + .table td, + .table th { +background-color: #fff !important; + } + .table-bordered th, + .table-bordered td { +border: 1px solid #ddd !important; + } +} +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +*:before, +*:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +html { + font-size: 10px; + -webkit-tap-highlight-color: rgba(0,
[09/16] incubator-airflow git commit: [AIRFLOW-2691] Manage JS dependencies via npm
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static/d3.v3.min.js -- diff --git a/airflow/www_rbac/static/d3.v3.min.js b/airflow/www_rbac/static/d3.v3.min.js deleted file mode 100644 index 77615c0..000 --- a/airflow/www_rbac/static/d3.v3.min.js +++ /dev/null @@ -1,5 +0,0 @@ -d3=function(){function n(n){return null!=n&&!isNaN(n)}function t(n){return n.length}function e(n){for(var t=1;n*t%1;)t*=10;return t}function r(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function u(){}function i(){}function o(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function a(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.substring(1);for(var e=0,r=Do.length;r>e;++e){var u=Do[e]+t;if(u in n)return u}}function c(){}function l(){}function s(n){function t(){for(var t,r=e,u=-1,i=r.length;++ue;e++)for(var u,i=n[e],o=0,a=i.length;a>o;o++)(u=i[o])&(u,o,e);return n}function T(n){return Lo(n,Io),n}function q(n){var t,e;return function(r,u,i){var o,a=n[i].update,c=a.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(o=a[t])&&++t0&&(n=n.substring(0,a));var s=Zo.get(n);return s&&(n=s,l=j),a?t?u:r:t?c:i}function D(n,t){return function(e){var r=mo.event;mo.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{mo.event=r}}}function j(n,t){var e=D(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8(t))||e.call(t,n)}}function L(){var n=".dragsuppress-"+ ++Xo,t="touchmove"+n,e="selectstart"+n,r="dragstart"+n,u="click"+n,i=mo.select(_o).on(t,f).on(e,f).on(r,f),o=bo.style,a=o[Vo];return o[Vo]="none",function(t){function e(){i.on(u,null)}i.on(n,null),o[Vo]=a,t&&(i.on(u,function(){f(),e()},!0),setTimeout(e,0))}}function H(n,t){t.changedTouches&&(t=t.changedTouches[0]);var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>$o&&(_o.scrollX||_o.scrollY)){e=mo.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=e[0][0].getScreenCTM();$o=!(u.f||u.e),e.remove()}return $o? (r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),r=r.matrixTransform(n.getScreenCTM().inverse()),[r.x,r.y]}var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}function F(n){return n>0?1:0>n?-1:0}function P(n){return n>1?0:-1>n?Bo:Math.acos(n)}function O(n){return n>1?Jo:-1>n?-Jo:Math.asin(n)}function R(n){return((n=Math.exp(n))-1/n)/2}function Y(n){return((n=Math.exp(n))+1/n)/2}function I(n){return((n=Math.exp(2*n))-1)/(n+1)}function U(n){return(n=Math.sin(n/2))*n}function Z(){}function V(n,t,e){return new X(n,t,e)}function X(n,t,e){this.h=n,this.s=t,this.l=e}function $(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(o-i)*n/60:180>n?o:240>n?i+(o-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,i=2*e-o,ot(u(n+120),u(n),u(n-120))}function B(n,t,e){return new W(n,t,e)}function W(n,t,e){this.h=n,thi s.c=t,this.l=e}function J(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),G(e,Math.cos(n*=Qo)*t,Math.sin(n)*t)}function G(n,t,e){return new K(n,t,e)}function K(n,t,e){this.l=n,this.a=t,this.b=e}function Q(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=tt(u)*sa,r=tt(r)*fa,i=tt(i)*ha,ot(rt(3.2404542*u-1.5371385*r-.4985314*i),rt(-.969266*u+1.8760108*r+.041556*i),rt(.0556434*u-.2040259*r+1.0572252*i))}function nt(n,t,e){return n>0?B(Math.atan2(e,t)*na,Math.sqrt(t*t+e*e),n):B(0/0,0/0,n)}function tt(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function et(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function rt(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function ut(n){return ot(n>>16,255>>8,255)}function it(n){return ut(n)+""}function ot(n,t,e){return new at(n,t,e)}function at(n,t,e){this.r=n,this.g=t,this.b=e}function ct(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function lt(n,t,e){var r,u,i,o=0,a=0,c=0;if(r =/([a-z]+)\((.*)\)/i.exec(n))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(gt(u[0]),gt(u[1]),gt(u[2]))}return(i=da.get(n))?t(i.r,i.g,i.b):(null!=n&&"#"===n.charAt(0)&&(4===n.length?(o=n.charAt(1),o+=o,a=n.charAt(2),a+=a,c=n.charAt(3),c+=c):7===n.length&&(o=n.substring(1,3),a=n.substring(3,5),c=n.substring(5,7)),o=parseInt(o,16),a=parseInt(a,16),c=parseInt(c,16)),t(o,a,c))}function st(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-i,c=(o+i)/2;return a?(u=.5>c?a/(o+i):a/(2-o-i),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=0/0,u=c>0&&1>c?0:r),V(r,u,c)}function ft(n,t,e){n=ht(n),t=ht(t),e=ht(e);var
[13/16] incubator-airflow git commit: [AIRFLOW-2691] Manage JS dependencies via npm
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static/bootstrap-theme.css -- diff --git a/airflow/www_rbac/static/bootstrap-theme.css b/airflow/www_rbac/static/bootstrap-theme.css deleted file mode 100644 index 734f940..000 --- a/airflow/www_rbac/static/bootstrap-theme.css +++ /dev/null @@ -1,6494 +0,0 @@ -/*! - * Bootstrap v3.2 - * - * Copyright 2014 Twitter, Inc - * Licensed under the Apache License v2.0 - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Designed and built with all the love in the world by @mdo and @fat. - * BootSwatchr built and provided by @DrewStrickland - */ -/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ -html { - font-family: sans-serif; - -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100%; -} -body { - margin: 0; -} -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -menu, -nav, -section, -summary { - display: block; -} -audio, -canvas, -progress, -video { - display: inline-block; - vertical-align: baseline; -} -audio:not([controls]) { - display: none; - height: 0; -} -[hidden], -template { - display: none; -} -a { - background-color: transparent; -} -a:active, -a:hover { - outline: 0; -} -abbr[title] { - border-bottom: 1px dotted; -} -b, -strong { - font-weight: bold; -} -dfn { - font-style: italic; -} -h1 { - font-size: 2em; - margin: 0.67em 0; -} -mark { - background: #ff0; - color: #000; -} -small { - font-size: 80%; -} -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} -sup { - top: -0.5em; -} -sub { - bottom: -0.25em; -} -img { - border: 0; -} -svg:not(:root) { - overflow: hidden; -} -figure { - margin: 1em 40px; -} -hr { - -moz-box-sizing: content-box; - box-sizing: content-box; - height: 0; -} -pre { - overflow: auto; -} -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - font-size: 1em; -} -button, -input, -optgroup, -select, -textarea { - color: inherit; - font: inherit; - margin: 0; -} -button { - overflow: visible; -} -button, -select { - text-transform: none; -} -button, -html input[type="button"], -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; - cursor: pointer; -} -button[disabled], -html input[disabled] { - cursor: default; -} -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; -} -input { - line-height: normal; -} -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; - padding: 0; -} -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { - height: auto; -} -input[type="search"] { - -webkit-appearance: textfield; - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; - box-sizing: content-box; -} -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} -fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; -} -legend { - border: 0; - padding: 0; -} -textarea { - overflow: auto; -} -optgroup { - font-weight: bold; -} -table { - border-collapse: collapse; - border-spacing: 0; -} -td, -th { - padding: 0; -} -/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ -@media print { - *, - *:before, - *:after { -background: transparent !important; -color: #000 !important; -box-shadow: none !important; -text-shadow: none !important; - } - a, - a:visited { -text-decoration: underline; - } - a[href]:after { -content: " (" attr(href) ")"; - } - abbr[title]:after { -content: " (" attr(title) ")"; - } - a[href^="#"]:after, - a[href^="javascript:"]:after { -content: ""; - } - pre, - blockquote { -border: 1px solid #999; -page-break-inside: avoid; - } - thead { -display: table-header-group; - } - tr, - img { -page-break-inside: avoid; - } - img { -max-width: 100% !important; - } - p, - h2, - h3 { -orphans: 3; -widows: 3; - } - h2, - h3 { -page-break-after: avoid; - } - select { -background: #fff !important; - } - .navbar { -display: none; - } - .btn > .caret, - .dropup > .btn > .caret { -border-top-color: #000 !important; - } - .label { -border: 1px solid #000; - } - .table { -border-collapse: collapse !important; - } - .table td, - .table th { -background-color: #fff !important; - } - .table-bordered th, - .table-bordered td { -border: 1px solid #ddd !important; - } -} -* { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -*:before, -*:after { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -html { - font-size: 10px; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -}
[08/16] incubator-airflow git commit: [AIRFLOW-2691] Manage JS dependencies via npm
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static/dagre-d3.js -- diff --git a/airflow/www_rbac/static/dagre-d3.js b/airflow/www_rbac/static/dagre-d3.js deleted file mode 100644 index 2da7cdd..000 --- a/airflow/www_rbac/static/dagre-d3.js +++ /dev/null @@ -1,5007 +0,0 @@ -;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&if(!u&)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&for(var o=0;ohttp://james.padolsey.com/javascript/wordwrap-for-javascript/ -function wordwrap (str, width, cut, brk) { - brk = brk || '\n'; - width = width || 75; - cut = cut || false; - - if (!str) { return str; } - - var regex = '.{1,' + width + '}(\\s|$)' + (cut ? '|.{' + width + '}|.+$' : '|\\S+?(\\s|$)'); - - return str.match(new RegExp(regex, 'g')).join(brk); -} - -function findMidPoint(points) { - var midIdx = points.length / 2; - if (points.length % 2) { -return points[Math.floor(midIdx)]; - } else { -var p0 = points[midIdx - 1]; -var p1 = points[midIdx]; -return {x: (p0.x + p1.x) / 2, y: (p0.y + p1.y) / 2}; - } -} - -function intersectRect(rect, point) { - var x = rect.x; - var y = rect.y; - - // Rectangle intersection algorithm from: - // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes - var dx = point.x - x; - var dy = point.y - y; - var w = rect.width / 2; - var h = rect.height / 2; - - var sx, sy; - if (Math.abs(dy) * w > Math.abs(dx) * h) { -// Intersection is top or bottom of rect. -if (dy < 0) { - h = -h; -} -sx = dy === 0 ? 0 : h * dx / dy; -sy = h; - } else { -// Intersection is left or right of rect. -if (dx < 0) { - w = -w; -} -sx = w; -sy = dx === 0 ? 0 : w * dy / dx; - } - - return {x: x + sx, y: y + sy}; -} - -function intersectEllipse(node, ellipseOrCircle, point) { - // Formulae from: http://mathworld.wolfram.com/Ellipse-LineIntersection.html - - var cx = node.x; - var cy = node.y; - var rx, ry; - - if (isCircle(ellipseOrCircle)) { -rx = ry = ellipseOrCircle.r.baseVal.value; - } else { -rx = ellipseOrCircle.rx.baseVal.value; -ry = ellipseOrCircle.ry.baseVal.value; - } - - var px = cx - point.x; - var py = cy - point.y; - - var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px); - - var dx = Math.abs(rx * ry * px / det); - if (point.x < cx) { -dx = -dx; - } - var dy = Math.abs(rx * ry * py / det); - if (point.y < cy) { -dy = -dy; - } - - return {x: cx + dx, y: cy + dy}; -} - -function sameSign(r1, r2) { - return r1 * r2 > 0; -} - -// Add point to the found intersections, but check first that it is unique. -function addPoint(x, y, intersections) { - if (!intersections.some(function (elm) { return elm[0] === x && elm[1] === y; })) { -intersections.push([x, y]); - } -} - -function intersectLine(x1, y1, x2, y2, x3, y3, x4, y4, intersections) { - // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994, p7 and p473. - - var a1, a2, b1, b2, c1, c2; - var r1, r2 , r3, r4; - var denom, offset, num; - var x, y; - - // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x + b1 y + c1 = 0. - a1 = y2 - y1; - b1 = x1 - x2; - c1 = (x2 * y1) - (x1 * y2); - - // Compute r3 and r4. - r3 = ((a1 * x3) + (b1 * y3) + c1); - r4 = ((a1 * x4) + (b1 * y4) + c1); - - // Check signs of r3 and r4. If both point 3 and point 4 lie on - // same side of line 1, the line segments do not intersect. - if ((r3 !== 0) && (r4 !== 0) && sameSign(r3, r4)) { -return /*DONT_INTERSECT*/; - } - - // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0 - a2 = y4 - y3; - b2 = x3 - x4; - c2 = (x4 * y3) - (x3 * y4); - - // Compute r1 and r2 - r1 = (a2 * x1) + (b2 * y1) + c2; - r2 = (a2 * x2) + (b2 * y2) + c2; - - // Check signs of r1 and r2. If both point 1 and point 2 lie - // on same side of second line segment, the line segments do - // not intersect. - if ((r1 !== 0) && (r2 !== 0) && (sameSign(r1, r2))) { -return /*DONT_INTERSECT*/; - } - - // Line segments intersect: compute intersection point. - denom = (a1 * b2) - (a2 * b1); - if (denom === 0) { -return /*COLLINEAR*/; - } - - offset = Math.abs(denom / 2); - - // The denom/2 is to get rounding instead of truncating. It - // is added or subtracted to the numerator, depending upon the - // sign of the numerator. - num = (b1 * c2) - (b2 * c1); - x = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom); - - num = (a2 * c1) - (a1 * c2); - y = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom); - - // lines_intersect - addPoint(x, y,
[jira] [Resolved] (AIRFLOW-2691) Make Airflow's JS code (and dependencies) manageable via npm and webpack
[ https://issues.apache.org/jira/browse/AIRFLOW-2691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Bolke de Bruin resolved AIRFLOW-2691. - Resolution: Fixed Fix Version/s: 2.0.0 Issue resolved by pull request #3572 [https://github.com/apache/incubator-airflow/pull/3572] > Make Airflow's JS code (and dependencies) manageable via npm and webpack > > > Key: AIRFLOW-2691 > URL: https://issues.apache.org/jira/browse/AIRFLOW-2691 > Project: Apache Airflow > Issue Type: New Feature >Reporter: Verdan Mahmood >Assignee: Verdan Mahmood >Priority: Major > Fix For: 2.0.0 > > > Airflow's JS code is hard to maintain and upgrade. The dependencies are > locally existing files making it hard to upgrade versions. > Make sure Airflow uses *npm* and *webpack* for the dependencies management. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[07/16] incubator-airflow git commit: [AIRFLOW-2691] Manage JS dependencies via npm
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static/dagre-d3.min.js -- diff --git a/airflow/www_rbac/static/dagre-d3.min.js b/airflow/www_rbac/static/dagre-d3.min.js deleted file mode 100644 index 8d9ec3a..000 --- a/airflow/www_rbac/static/dagre-d3.min.js +++ /dev/null @@ -1,2 +0,0 @@ -(function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var j=typeof require=="function"&if(!h&)return j(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}var f=typeof require=="function"&for(var g=0;gMath.abs(e)*h?(f<0&&(h=-h),i=f===0?0:h*e/f,j=h):(e<0&&(g=-g),i=g,j=e===0?0:g*f/e),{x:c+i,y:d+j}}function H(a,b,c){var d=a.x,e=a.y,f,g;r(b)?f=g=b.r.baseVal.value:(f=b.rx.baseVal.value,g=b.ry.baseVal.value);var h=d-c.x,i=e-c.y,j=Math.sqrt(f*f*i*i+g*g*h*h),k=Math.abs(f*g*h/j);c.x0}function J(a,b,c){c.some(function(c){return c[0]===a&[1]===b})||c.push([a,b])}function K(a,b,c,d,e,f,g,h,i){var j,k,l,m,n,o,p,q,r,s,t,u,v,w, x;j=d-b,l=a-c,n=c*b-a*d,r=j*e+l*f+n,s=j*g+l*h+n;if(r!==0&!==0&(r,s))return;k=h-f,m=e-g,o=g*f-e*h,p=k*a+m*b+o,q=k*c+m*d+o;if(p!==0&!==0&(p,q))return;t=j*m-k*l;if(t===0)return;u=Math.abs(t/2),v=l*o-m*n,w=v<0?(v-u)/t:(v+u)/t,v=k*n-j*o,x=v<0?(v-u)/t:(v+u)/t,J(w,x,i)}function L(a,b,c){var d=a.x,e=a.y,f=c.x,g=c.y,h=[],i=b.points,j=1e5,k=1e5;for(var l=0;l1?(h.sort(function(a,b){var d=a[0]-c.x,e=a[1]-c.y,f=Math.sqrt(d*d+e*e),g=b[0]-c.x,h=b[1]-c.y,i=Math.sqrt(g*g+h*h);return fthis._arr[c].priority)throw new Error("New priority is greater than current priority. Key: "+a+" Old: "+this._arr[c].priority+" New: "+b);this._arr[c].priority=b,this._decrease(c)},d.prototype._heapify=function(a){var b=this._arr,c=2*a,d=c+1,e=a;c>1;if(b[d].priority>>0,g=!1;1d;++d)a.hasOwnProperty(d)&&(g?e=b(e,a[d],d,a):(e=a[d],g=!0));if(!g)throw new TypeError("Reduce of empty array with no initial value");return e}:c.reduce=function(a,b,c){return a.reduce(b,c)}},{}],9:[function(a,b,c){b.exports="1.1.3"},{}],10:[function(a,b,c){a("./d3"),b.exports=d3,function(){delete this.d3}()},{}],11:[function(a,b,c){c.Digraph=a("graphlib").Digraph,c.Graph=a("graphlib").Graph,c.layout=a("./lib/layout"),c.version=a("./lib/version"),c.debug=a("./lib/debug")},{"./lib/debug":12,"./lib/layout":13,"./lib/version":28,graphlib:29}],12:[function(a,b,c){"use strict";var d=a("./util");c.dotOrdering=function(a){func tion e(b){var d=a.children(b);d.length?(c+="subgraph cluster_"+b+" {",c+='label="'+b+'";',d.forEach(function(a){e(a)}),c+="}"):(c+=b,a.node(b).dummy&&(c+=" [shape=diamond]"),c+=";")}var b=d.ordering(a.filterNodes(d.filterNonSubgraphs(a))),c="digraph {";return a.children(null).forEach(e),b.forEach(function(a){c+='subgraph { rank=same; edge [style="invis"];',c+=a.join("->"),c+="}"}),a.eachEdge(function(a,b,d){c+=b+"->"+d+";"}),c+="}",c}},{"./util":27}],13:[function(a,b,c){"use strict";var d=a("./util"),e=a("./rank"),f=a("./order"),g=a("graphlib").CGraph,h=a("graphlib").CDigraph;b.exports=function(){function j(a){var c=new h;a.eachNode(function(a,b){b===undefined&&(b={}),c.addNode(a,{width:b.width,height:b.height}),b.hasOwnProperty("rank")&&(c.node(a).prefRank=b.rank)}),a.parent&().forEach(function(b){c.parent(b,a.parent(b))}),a.eachEdge(function(a,b,d,e){e===undefined&&(e={});var f={e:a,minLen:e.minLen||1,width:e.width||0,height:e.height||0,points:[]};c.addEdge(null,b,d,f)});v ar d=a.graph()||{};return c.graph({rankDir:d.rankDir||b.rankDir,orderRestarts:d.orderRestarts}),c}function k(a){var g=i.rankSep(),h;try{return h=d.time("initLayoutGraph",j)(a),h.order()===0?h:(h.eachEdge(function(a,b,c,d){d.minLen*=2}),i.rankSep(g/2),d.time("rank.run",e.run)(h,b.rankSimplex),d.time("normalize",l)(h),d.time("order",f)(h,b.orderMaxSweeps),d.time("position",c.run)(h),d.time("undoNormalize",m)(h),d.time("fixupEdgePoints",n)(h),d.time("rank.restoreEdges",e.restoreEdges)(h),d.time("createFinalGraph",o)(h,a.isDirected()))}finally{i.rankSep(g)}}function l(a){var b=0;a.eachEdge(function(c,d,e,f){var g=a.node(d).rank,h=a.node(e).rank;if(g+10),d.log(2,"Order phase start cross count: "+a.graph().orderInitCC);var q,r,s;for(q=0,r=0;r<4&0;++q,++r,++j)m(a,h,q),s=e(a),s=0;--d)h(b[d],c,l(a,b[d].nodes()))}"use strict";var d=a("./util"),e=a("./order/crossCount"),f=a("./order/initLayerGraphs"),g=a("./order/initOrder"),h=a("./order/sortLayer");b.exports=j;var i=24;j.DEFAULT_MAX_SWEEPS=i},{"./order/crossCount":15,"./order/initLayerGraphs":16,"./order/initOrde r":17,"./order/sortLayer":18,"./util":27}],15:[function(a,b,c){function e(a){var b=0,c=d.ordering(a);for(var e=1;e0)b%2&&(i+=g[b+1]),b=b-1>>1,++g[b]}),i}"use strict";var d=a("../util");b.exports=e},{"../util":27}],16:[function(a,b,c){function f(a){function
[05/16] incubator-airflow git commit: [AIRFLOW-2691] Manage JS dependencies via npm
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static/jquery.dataTables.min.js -- diff --git a/airflow/www_rbac/static/jquery.dataTables.min.js b/airflow/www_rbac/static/jquery.dataTables.min.js deleted file mode 100644 index 59d4dac..000 --- a/airflow/www_rbac/static/jquery.dataTables.min.js +++ /dev/null @@ -1,189 +0,0 @@ -/* - * This combined file was created by the DataTables downloader builder: - * https://datatables.net/download - * - * To rebuild or modify this file with the latest versions of the included - * software please visit: - * https://datatables.net/download/#bs/dt-1.10.10 - * - * Included libraries: - * DataTables 1.10.10 - */ - -/*! - DataTables 1.10.10 - ©2008-2015 SpryMedia Ltd - datatables.net/license -*/ -(function(h){"function"===typeof define&?define(["jquery"],function(E){return h(E,window,document)}):"object"===typeof exports?module.exports=function(E,H){E||(E=window);H||(H="undefined"!==typeof window?require("jquery"):require("jquery")(E));return h(H,E,E.document)}:h(jQuery,window,document)})(function(h,E,H,k){function Y(a){var b,c,d={};h.each(a,function(e){if((b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" "))c=e.replace(b[0],b[2].toLowerCase()), -d[c]=e,"o"===b[1]&(a[e])});a._hungarianMap=d}function J(a,b,c){a._hungarianMap||Y(a);var d;h.each(b,function(e){d=a._hungarianMap[e];if(d!==k&&(c||b[d]===k))"o"===d.charAt(0)?(b[d]||(b[d]={}),h.extend(!0,b[d],b[e]),J(a[d],b[d],c)):b[d]=b[e]})}function Fa(a){var b=m.defaults.oLanguage,c=a.sZeroRecords;!a.sEmptyTable&&(c&&"No data available in table"===b.sEmptyTable)&(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&(c&&"Loading..."===b.sLoadingRecords)&(a,a,"sZeroRecords","sLoadingRecords"); -a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&(a)}function eb(a){A(a,"ordering","bSort");A(a,"orderMulti","bSortMulti");A(a,"orderClasses","bSortClasses");A(a,"orderCellsTop","bSortCellsTop");A(a,"order","aaSorting");A(a,"orderFixed","aaSortingFixed");A(a,"paging","bPaginate");A(a,"pagingType","sPaginationType");A(a,"pageLength","iDisplayLength");A(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":"");"boolean"===typeof a.scrollX&&(a.scrollX= -a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b").css({position:"fixed",top:0,left:0,height:1,width:1,overflow:"hidden"}).append(h("").css({position:"absolute",top:1,left:1, -width:100,overflow:"scroll"}).append(h("").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}h.extend(a.oBrowser,m.__browser);a.oScroll.iBarWidth=m.__browser.barWidth}function hb(a,b,c,d,e,f){var g,j=!1;c!==k&&(g=c,j=!0);for(;d!==e;)a.hasOwnProperty(d)&& -(g=j?b(g,a[d],d,a):a[d],j=!0,d+=f);return g}function Ga(a,b){var c=m.defaults.column,d=a.aoColumns.length,c=h.extend({},m.models.oColumn,c,{nTh:b?b:H.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=h.extend({},m.models.oSearch,c[d]);la(a,d,h(b).data())}function la(a,b,c){var b=a.aoColumns[b],d=a.oClasses,e=h(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=e.attr("width")||null;var f= -(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);f&&(b.sWidthOrig=f[1])}c!==k&!==c&&(fb(c),J(m.defaults.column,c),c.mDataProp!==k&&!c.mData&&(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),h.extend(b,c),F(b,c,"sWidth","sWidthOrig"),c.iDataSort!==k&&(b.aDataSort=[c.iDataSort]),F(b,c,"aDataSort"));var g=b.mData,j=Q(g),i=b.mRender?Q(b.mRender):null,c=function(a){return"string"===typeof a&&-1!==a.indexOf("@")};b._bAttrSrc=h.isPlainObject(g)&& -(c(g.sort)||c(g.type)||c(g.filter));b.fnGetData=function(a,b,c){var d=j(a,b,k,c);return i&?i(d,b,a,c):d};b.fnSetData=function(a,b,c){return R(g)(a,b,c)};"number"!==typeof g&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==h.inArray("asc",b.asSorting);c=-1!==h.inArray("desc",b.asSorting);!b.bSortable||!a&&!c?(b.sSortingClass=d.sSortableNone,b.sSortingClassJUI=""):a&&!c?(b.sSortingClass=d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed):!a&?(b.sSortingClass= -d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI)}function U(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Ha(a);for(var c=0,d=b.length;cq[f])d(l.length+q[f],o);else if("string"===typeof q[f]){j=0;for(i=l.length;jb&[e]--; -1!=d&===k&(d,1)}function ea(a,b,c,d){var
[12/16] incubator-airflow git commit: [AIRFLOW-2691] Manage JS dependencies via npm
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static/bootstrap-toggle.min.css -- diff --git a/airflow/www_rbac/static/bootstrap-toggle.min.css b/airflow/www_rbac/static/bootstrap-toggle.min.css deleted file mode 100644 index 0d42ed0..000 --- a/airflow/www_rbac/static/bootstrap-toggle.min.css +++ /dev/null @@ -1,28 +0,0 @@ -/*! - * Bootstrap Toggle: bootstrap-toggle.css v2.2.0 - * http://www.bootstraptoggle.com - * - * Copyright 2014 Min Hur, The New York Times Company - * Licensed under MIT - * */ -.checkbox label .toggle,.checkbox-inline .toggle{margin-left:-20px;margin-right:5px} -.toggle{position:relative;overflow:hidden} -.toggle input[type=checkbox]{display:none} -.toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none} -.toggle.off .toggle-group{left:-100%} -.toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0} -.toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0} -.toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px} -.toggle.btn{min-width:59px;min-height:34px} -.toggle-on.btn{padding-right:24px} -.toggle-off.btn{padding-left:24px} -.toggle.btn-lg{min-width:79px;min-height:45px} -.toggle-on.btn-lg{padding-right:31px} -.toggle-off.btn-lg{padding-left:31px} -.toggle-handle.btn-lg{width:40px} -.toggle.btn-sm{min-width:50px;min-height:30px} -.toggle-on.btn-sm{padding-right:20px} -.toggle-off.btn-sm{padding-left:20px} -.toggle.btn-xs{min-width:35px;min-height:22px} -.toggle-on.btn-xs{padding-right:12px} -.toggle-off.btn-xs{padding-left:12px} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static/bootstrap-toggle.min.js -- diff --git a/airflow/www_rbac/static/bootstrap-toggle.min.js b/airflow/www_rbac/static/bootstrap-toggle.min.js deleted file mode 100644 index 3711320..000 --- a/airflow/www_rbac/static/bootstrap-toggle.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/*! - * Bootstrap Toggle: bootstrap-toggle.js v2.2.0 - * http://www.bootstraptoggle.com - * - * Copyright 2014 Min Hur, The New York Times Company - * Licensed under MIT - * */ -+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.toggle"),f="object"==typeof b&e||d.data("bs.toggle",e=new c(this,f)),"string"==typeof b&[b]&[b]()})}var c=function(b,c){this.$element=a(b),this.options=a.extend({},this.defaults(),c),this.render()};c.VERSION="2.2.0",c.DEFAULTS={on:"On",off:"Off",onstyle:"primary",offstyle:"default",size:"normal",style:"",width:null,height:null},c.prototype.defaults=function(){return{on:this.$element.attr("data-on")||c.DEFAULTS.on,off:this.$element.attr("data-off")||c.DEFAULTS.off,onstyle:this.$element.attr("data-onstyle")||c.DEFAULTS.onstyle,offstyle:this.$element.attr("data-offstyle")||c.DEFAULTS.offstyle,size:this.$element.attr("data-size")||c.DEFAULTS.size,style:this.$element.attr("data-style")||c.DEFAULTS.style,width:this.$element.attr("data-width")||c.DEFAULTS.width,height:this.$element.attr("data-height")||c.DEFAULTS.height}},c.prototype.render=function(){this._onstyle="btn-"+this.options.onst yle,this._offstyle="btn-"+this.options.offstyle;var b="large"===this.options.size?"btn-lg":"small"===this.options.size?"btn-sm":"mini"===this.options.size?"btn-xs":"",c=a('').html(this.options.on).addClass(this._onstyle+" "+b),d=a('').html(this.options.off).addClass(this._offstyle+" "+b+" active"),e=a('').addClass(b),f=a('').append(c,d,e),g=a('').addClass(this.$element.prop("checked")?this._onstyle:this._offstyle+" off").addClass(b).addClass(this.options.style);this.$element.wrap(g),a.extend(this,{$toggle:this.$element.parent(),$toggleOn:c,$toggleOff:d,$toggleGroup:f}),this.$toggle.append(f);var h=this.options.width||Math.max(c.outerWidth(),d.outerWidth())+e.outerWidth()/2,i=this.options.height||Math.max(c.outerHeight(),d.outerHeight());c.addClass("toggle-on"),d.addClass("toggle-off"),this.$toggle.css({width:h,height:i}),this.option
[01/16] incubator-airflow git commit: [AIRFLOW-2691] Manage JS dependencies via npm
Repository: incubator-airflow Updated Branches: refs/heads/master 27fde3840 -> 5a7f0b2e5 http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static/tree.css -- diff --git a/airflow/www_rbac/static/tree.css b/airflow/www_rbac/static/tree.css deleted file mode 100644 index 9304bb1..000 --- a/airflow/www_rbac/static/tree.css +++ /dev/null @@ -1,96 +0,0 @@ -/** -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -#svg_container{ - // overflow: scroll; -} -.node text { - font: 11px sans-serif; - pointer-events: none; -} -path.link { - fill: none; - stroke: #3182bd; - stroke-width: 1.5px; - opacity: 0.5; -} -g.tick line{ - shape-rendering: crispEdges; -} -rect.state { -stroke: black; -shape-rendering: crispEdges; -cursor: pointer; -} -rect.null, rect.scheduled, rect.undefined { -fill: white; -} -rect.success { -fill: green; -} -rect.running { -fill: lime; -} -rect.failed { -fill: red; -} -rect.queued { -fill: gray; -} -rect.shutdown { -fill: blue; -} -rect.upstream_failed { -fill: orange; -} -rect.up_for_retry { -fill: gold; -} -rect.skipped { -fill: pink; -} -.tooltip.in { -opacity: 1; -filter: alpha(opacity=100); -} - -.axis path, .axis line { -fill: none; -stroke: #000; -} -.axis text { -font: 11px sans-serif; -} - -g.parent circle { -cursor: pointer; -} - -g.node.collapsed circle { -stroke: #444; -stroke-width: 4px; -} -circle { -stroke: blue; -fill: white; -stroke-width: 1.5px; -} -g.axis path { -shape-rendering: crispEdges; -} http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static_config.py -- diff --git a/airflow/www_rbac/static_config.py b/airflow/www_rbac/static_config.py new file mode 100644 index 000..278c499 --- /dev/null +++ b/airflow/www_rbac/static_config.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +from __future__ import print_function + +import json +import os + +manifest = dict() + + +def configure_manifest_files(app): +""" +Loads the manifest file and register the `url_for_asset_` template tag. +:param app: +:return: +""" + +def parse_manifest_json(): +# noinspection PyBroadException +try: +global manifest +manifest_file = os.path.join(os.path.dirname(__file__), + 'static/dist/manifest.json') +with open(manifest_file, 'r') as f: +manifest.update(json.load(f)) +except Exception: +print("Please make sure to build the frontend in " + "static/ directory and restart the server") +pass + +def get_asset_url(filename): +if app.debug: +parse_manifest_json() +return '/static/dist/{}'.format(manifest.get(filename, '')) + +parse_manifest_json() + +@app.context_processor +def get_url_for_asset(): +""" +Template tag to return the asset URL. +WebPack renders the assets after minification and modification +under the static/dist folder. +This template tag reads the asset name in manifest.json and returns +the appropriate file. +""" +return dict(url_for_asset=get_asset_url)
[04/16] incubator-airflow git commit: [AIRFLOW-2691] Manage JS dependencies via npm
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static/js/dagre-d3.js -- diff --git a/airflow/www_rbac/static/js/dagre-d3.js b/airflow/www_rbac/static/js/dagre-d3.js new file mode 100644 index 000..2da7cdd --- /dev/null +++ b/airflow/www_rbac/static/js/dagre-d3.js @@ -0,0 +1,5007 @@ +;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&if(!u&)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&for(var o=0;ohttp://james.padolsey.com/javascript/wordwrap-for-javascript/ +function wordwrap (str, width, cut, brk) { + brk = brk || '\n'; + width = width || 75; + cut = cut || false; + + if (!str) { return str; } + + var regex = '.{1,' + width + '}(\\s|$)' + (cut ? '|.{' + width + '}|.+$' : '|\\S+?(\\s|$)'); + + return str.match(new RegExp(regex, 'g')).join(brk); +} + +function findMidPoint(points) { + var midIdx = points.length / 2; + if (points.length % 2) { +return points[Math.floor(midIdx)]; + } else { +var p0 = points[midIdx - 1]; +var p1 = points[midIdx]; +return {x: (p0.x + p1.x) / 2, y: (p0.y + p1.y) / 2}; + } +} + +function intersectRect(rect, point) { + var x = rect.x; + var y = rect.y; + + // Rectangle intersection algorithm from: + // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes + var dx = point.x - x; + var dy = point.y - y; + var w = rect.width / 2; + var h = rect.height / 2; + + var sx, sy; + if (Math.abs(dy) * w > Math.abs(dx) * h) { +// Intersection is top or bottom of rect. +if (dy < 0) { + h = -h; +} +sx = dy === 0 ? 0 : h * dx / dy; +sy = h; + } else { +// Intersection is left or right of rect. +if (dx < 0) { + w = -w; +} +sx = w; +sy = dx === 0 ? 0 : w * dy / dx; + } + + return {x: x + sx, y: y + sy}; +} + +function intersectEllipse(node, ellipseOrCircle, point) { + // Formulae from: http://mathworld.wolfram.com/Ellipse-LineIntersection.html + + var cx = node.x; + var cy = node.y; + var rx, ry; + + if (isCircle(ellipseOrCircle)) { +rx = ry = ellipseOrCircle.r.baseVal.value; + } else { +rx = ellipseOrCircle.rx.baseVal.value; +ry = ellipseOrCircle.ry.baseVal.value; + } + + var px = cx - point.x; + var py = cy - point.y; + + var det = Math.sqrt(rx * rx * py * py + ry * ry * px * px); + + var dx = Math.abs(rx * ry * px / det); + if (point.x < cx) { +dx = -dx; + } + var dy = Math.abs(rx * ry * py / det); + if (point.y < cy) { +dy = -dy; + } + + return {x: cx + dx, y: cy + dy}; +} + +function sameSign(r1, r2) { + return r1 * r2 > 0; +} + +// Add point to the found intersections, but check first that it is unique. +function addPoint(x, y, intersections) { + if (!intersections.some(function (elm) { return elm[0] === x && elm[1] === y; })) { +intersections.push([x, y]); + } +} + +function intersectLine(x1, y1, x2, y2, x3, y3, x4, y4, intersections) { + // Algorithm from J. Avro, (ed.) Graphics Gems, No 2, Morgan Kaufmann, 1994, p7 and p473. + + var a1, a2, b1, b2, c1, c2; + var r1, r2 , r3, r4; + var denom, offset, num; + var x, y; + + // Compute a1, b1, c1, where line joining points 1 and 2 is F(x,y) = a1 x + b1 y + c1 = 0. + a1 = y2 - y1; + b1 = x1 - x2; + c1 = (x2 * y1) - (x1 * y2); + + // Compute r3 and r4. + r3 = ((a1 * x3) + (b1 * y3) + c1); + r4 = ((a1 * x4) + (b1 * y4) + c1); + + // Check signs of r3 and r4. If both point 3 and point 4 lie on + // same side of line 1, the line segments do not intersect. + if ((r3 !== 0) && (r4 !== 0) && sameSign(r3, r4)) { +return /*DONT_INTERSECT*/; + } + + // Compute a2, b2, c2 where line joining points 3 and 4 is G(x,y) = a2 x + b2 y + c2 = 0 + a2 = y4 - y3; + b2 = x3 - x4; + c2 = (x4 * y3) - (x3 * y4); + + // Compute r1 and r2 + r1 = (a2 * x1) + (b2 * y1) + c2; + r2 = (a2 * x2) + (b2 * y2) + c2; + + // Check signs of r1 and r2. If both point 1 and point 2 lie + // on same side of second line segment, the line segments do + // not intersect. + if ((r1 !== 0) && (r2 !== 0) && (sameSign(r1, r2))) { +return /*DONT_INTERSECT*/; + } + + // Line segments intersect: compute intersection point. + denom = (a1 * b2) - (a2 * b1); + if (denom === 0) { +return /*COLLINEAR*/; + } + + offset = Math.abs(denom / 2); + + // The denom/2 is to get rounding instead of truncating. It + // is added or subtracted to the numerator, depending upon the + // sign of the numerator. + num = (b1 * c2) - (b2 * c1); + x = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom); + + num = (a2 * c1) - (a1 * c2); + y = (num < 0) ? ((num - offset) / denom) : ((num + offset) / denom); + + // lines_intersect + addPoint(x, y,
[15/16] incubator-airflow git commit: [AIRFLOW-2691] Manage JS dependencies via npm
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/package-lock.json -- diff --git a/airflow/www_rbac/package-lock.json b/airflow/www_rbac/package-lock.json new file mode 100644 index 000..90d94cd --- /dev/null +++ b/airflow/www_rbac/package-lock.json @@ -0,0 +1,12408 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { +"@webassemblyjs/ast": { + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.5.13.tgz;, + "integrity": "sha512-49nwvW/Hx9i+OYHg+mRhKZfAlqThr11Dqz8TsrvqGKMhdI2ijy3KBJOun2Z4770TPjrIJhR6KxChQIDaz8clDA==", + "dev": true, + "requires": { +"@webassemblyjs/helper-module-context": "1.5.13", +"@webassemblyjs/helper-wasm-bytecode": "1.5.13", +"@webassemblyjs/wast-parser": "1.5.13", +"debug": "^3.1.0", +"mamacro": "^0.0.3" + }, + "dependencies": { +"debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz;, + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { +"ms": "2.0.0" + } +} + } +}, +"@webassemblyjs/floating-point-hex-parser": { + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.5.13.tgz;, + "integrity": "sha512-vrvvB18Kh4uyghSKb0NTv+2WZx871WL2NzwMj61jcq2bXkyhRC+8Q0oD7JGVf0+5i/fKQYQSBCNMMsDMRVAMqA==", + "dev": true +}, +"@webassemblyjs/helper-api-error": { + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.5.13.tgz;, + "integrity": "sha512-dBh2CWYqjaDlvMmRP/kudxpdh30uXjIbpkLj9HQe+qtYlwvYjPRjdQXrq1cTAAOUSMTtzqbXIxEdEZmyKfcwsg==", + "dev": true +}, +"@webassemblyjs/helper-buffer": { + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.5.13.tgz;, + "integrity": "sha512-v7igWf1mHcpJNbn4m7e77XOAWXCDT76Xe7Is1VQFXc4K5jRcFrl9D0NrqM4XifQ0bXiuTSkTKMYqDxu5MhNljA==", + "dev": true, + "requires": { +"debug": "^3.1.0" + }, + "dependencies": { +"debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz;, + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { +"ms": "2.0.0" + } +} + } +}, +"@webassemblyjs/helper-code-frame": { + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.5.13.tgz;, + "integrity": "sha512-yN6ScQQDFCiAXnVctdVO/J5NQRbwyTbQzsGzEgXsAnrxhjp0xihh+nNHQTMrq5UhOqTb5LykpJAvEv9AT0jnAQ==", + "dev": true, + "requires": { +"@webassemblyjs/wast-printer": "1.5.13" + } +}, +"@webassemblyjs/helper-fsm": { + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.5.13.tgz;, + "integrity": "sha512-hSIKzbXjVMRvy3Jzhgu+vDd/aswJ+UMEnLRCkZDdknZO3Z9e6rp1DAs0tdLItjCFqkz9+0BeOPK/mk3eYvVzZg==", + "dev": true +}, +"@webassemblyjs/helper-module-context": { + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.5.13.tgz;, + "integrity": "sha512-zxJXULGPLB7r+k+wIlvGlXpT4CYppRz8fLUM/xobGHc9Z3T6qlmJD9ySJ2jknuktuuiR9AjnNpKYDECyaiX+QQ==", + "dev": true, + "requires": { +"debug": "^3.1.0", +"mamacro": "^0.0.3" + }, + "dependencies": { +"debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz;, + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { +"ms": "2.0.0" + } +} + } +}, +"@webassemblyjs/helper-wasm-bytecode": { + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.5.13.tgz;, + "integrity": "sha512-0n3SoNGLvbJIZPhtMFq0XmmnA/YmQBXaZKQZcW8maGKwLpVcgjNrxpFZHEOLKjXJYVN5Il8vSfG7nRX50Zn+aw==", + "dev": true +}, +"@webassemblyjs/helper-wasm-section": { + "version": "1.5.13", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.5.13.tgz;, + "integrity":
[06/16] incubator-airflow git commit: [AIRFLOW-2691] Manage JS dependencies via npm
http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/5a7f0b2e/airflow/www_rbac/static/jquery.dataTables.css -- diff --git a/airflow/www_rbac/static/jquery.dataTables.css b/airflow/www_rbac/static/jquery.dataTables.css deleted file mode 100644 index 6a2e88d..000 --- a/airflow/www_rbac/static/jquery.dataTables.css +++ /dev/null @@ -1,495 +0,0 @@ -/** -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -/* - * Table styles - */ -table.dataTable { - width: 100%; - margin: 0 auto; - clear: both; - border-collapse: separate; - border-spacing: 0; - /* - * Header and footer styles - */ - /* - * Body styles - */ -} -table.dataTable thead th, -table.dataTable tfoot th { - font-weight: bold; -} -table.dataTable thead th, -table.dataTable thead td { - padding: 10px 18px; - border-bottom: 1px solid #11; -} -table.dataTable thead th:active, -table.dataTable thead td:active { - outline: none; -} -table.dataTable tfoot th, -table.dataTable tfoot td { - padding: 10px 18px 6px 18px; - border-top: 1px solid #11; -} -table.dataTable thead .sorting_asc, -table.dataTable thead .sorting_desc, -table.dataTable thead .sorting { - cursor: pointer; - *cursor: hand; -} -table.dataTable thead .sorting { - background: url("../images/sort_both.png") no-repeat center right; -} -table.dataTable thead .sorting_asc { - background: url("../images/sort_asc.png") no-repeat center right; -} -table.dataTable thead .sorting_desc { - background: url("../images/sort_desc.png") no-repeat center right; -} -table.dataTable thead .sorting_asc_disabled { - background: url("../images/sort_asc_disabled.png") no-repeat center right; -} -table.dataTable thead .sorting_desc_disabled { - background: url("../images/sort_desc_disabled.png") no-repeat center right; -} -table.dataTable tbody tr { - background-color: white; -} -table.dataTable tbody tr.selected { - background-color: #b0bed9; -} -table.dataTable tbody th, -table.dataTable tbody td { - padding: 8px 10px; -} -table.dataTable.row-border tbody th, table.dataTable.row-border tbody td, table.dataTable.display tbody th, table.dataTable.display tbody td { - border-top: 1px solid #dd; -} -table.dataTable.row-border tbody tr:first-child th, -table.dataTable.row-border tbody tr:first-child td, table.dataTable.display tbody tr:first-child th, -table.dataTable.display tbody tr:first-child td { - border-top: none; -} -table.dataTable.cell-border tbody th, table.dataTable.cell-border tbody td { - border-top: 1px solid #dd; - border-right: 1px solid #dd; -} -table.dataTable.cell-border tbody tr th:first-child, -table.dataTable.cell-border tbody tr td:first-child { - border-left: 1px solid #dd; -} -table.dataTable.cell-border tbody tr:first-child th, -table.dataTable.cell-border tbody tr:first-child td { - border-top: none; -} -table.dataTable.stripe tbody tr.odd, table.dataTable.display tbody tr.odd { - background-color: #f9f9f9; -} -table.dataTable.stripe tbody tr.odd.selected, table.dataTable.display tbody tr.odd.selected { - background-color: #abb9d3; -} -table.dataTable.hover tbody tr:hover, -table.dataTable.hover tbody tr.odd:hover, -table.dataTable.hover tbody tr.even:hover, table.dataTable.display tbody tr:hover, -table.dataTable.display tbody tr.odd:hover, -table.dataTable.display tbody tr.even:hover { - background-color: whitesmoke; -} -table.dataTable.hover tbody tr:hover.selected, -table.dataTable.hover tbody tr.odd:hover.selected, -table.dataTable.hover tbody tr.even:hover.selected, table.dataTable.display tbody tr:hover.selected, -table.dataTable.display tbody tr.odd:hover.selected, -table.dataTable.display tbody tr.even:hover.selected { - background-color: #a9b7d1; -} -table.dataTable.order-column tbody tr > .sorting_1, -table.dataTable.order-column tbody tr > .sorting_2, -table.dataTable.order-column tbody tr > .sorting_3, table.dataTable.display tbody tr > .sorting_1, -table.dataTable.display tbody tr > .sorting_2, -table.dataTable.display tbody tr > .sorting_3 { - background-color: #f9f9f9; -} -table.dataTable.order-column tbody tr.selected > .sorting_1, -table.dataTable.order-column tbody tr.selected >