Граф коммитов

217 Коммитов

Автор SHA1 Сообщение Дата
dstandish 37a342d0e9 [AIRFLOW-5793] add test to detect multiple alembic revision heads (#6449) 2019-10-28 09:52:10 +01:00
Tao Feng 641b8aaf04
[AIRFLOW-5715] Make email, owner context available (#6385) 2019-10-22 12:24:32 -07:00
Martin Winkel 9ec562f88e [AIRFLOW-5640] Document and test `email` parameters of BaseOperator (#6315)
* Refactored get_email_address_list to have a better
  separation between string handling and other iterables.
* Explicitely casting get_email_address_list argument
  to a list in case the argument was an iterable. This
  enables direct support for tuples, sets or the like.
* Fixed type annotation of email parameter of
  BaseOperator to show that iterables are directly
  supported.
* Added docstring entries for email, email_on_retry,
  email_on_failure and queue in BaseOperator.
2019-10-18 14:35:15 +01:00
Kevin Yang cb0dbe309b [AIRFLOW-4797] Use same zombies in all DAG file processors 2019-10-14 15:15:59 -07:00
Kevin Yang 897960736e Revert "[AIRFLOW-4797] Improve performance and behaviour of zombie detection (#5511)"
This reverts commit 2bdb053db6.
2019-10-14 15:15:59 -07:00
Kevin Yang d719e1fd67 [AIRFLOW-5362] Reorder imports (#5944) 2019-10-02 16:30:03 +01:00
Ash Berlin-Taylor 5f9ab7a1d5
[AIRFLOW-774] Fix long-broken DAG parsing Statsd metrics (#6157)
Since we switched to using sub-processes to parse the DAG files sometime
back in 2016(!) the metrics we have been emitting about dag bag size and
parsing have been incorrect.

We have also been emitting metrics from the webserver which is going to
be become wrong as we move towards a stateless webserver.

To fix both of these issues I have stopped emitting the metrics from
models.DagBag and only emit them from inside the
DagFileProcessorManager.

(There was also a bug in the `dag.loading-duration.*` we were emitting
from the DagBag code where the "dag_file" part of that metric was empty.
I have fixed that even though I have now deprecated that metric. The
webserver was emitting the right metric though so many people wouldn't
notice)
2019-09-24 10:23:51 +01:00
Ping Zhang 155adf4242 [AIRFLOW-5528] end_of_log_mark should not be a log record (#6159) 2019-09-20 16:48:58 -07:00
Jarek Potiuk 4780105798 [AIRFLOW-5256] Related pylint changes for common licences in python files (#5786) 2019-09-17 13:16:32 +02:00
Fokko Driesprong dd175fa8db [AIRFLOW-5390] Remove provide context (#5990) 2019-09-10 15:17:03 +02:00
Fokko Driesprong b21be80235
[AIRFLOW-5402] Remove deprecated logger (#6006)
* [AIRFLOW-5402] Remove deprecated logger

* Remove the related test

* Less is more
2019-09-09 15:18:38 +02:00
Kamil Breguła 867cd0f714 [AIRFLOW-5368] Display DAG from the CLI 2019-09-07 18:13:07 +02:00
Hao Liang f497d1d5aa [AIRFLOW-4858] Deprecate "Historical convenience functions" in airflow.configuration (#5495)
1. Issue old conf method deprecation warnings properly and remove current old conf method usages.
2. Unify the way to use conf as `from airflow.configuration import conf`
2019-09-03 17:08:55 +01:00
Tomek 23d104203e [AIRFLOW-5309] Use assert_called_once or has_calls in tests (#5912)
Using mock.assert_call_with method can result in flaky tests
(ex. iterating through dict in python 3.5 which does not
store order of elements). That's why it's better to
use assert_called_once_with or has_calls methods.
2019-08-26 07:03:43 +02:00
Bas Harenslak 5196db38f2 [AIRFLOW-5241] Make all test class names consistent (#5847)
Make all test class names consistent by starting with Test
2019-08-22 14:14:25 +02:00
Qingping Hou cd4ab7be3b [AIRFLOW-5276] remove unused is_in helper function (#5878) 2019-08-21 22:48:09 +02:00
Andrii Soldatenko 2c6629803f [AIRFLOW-5257] ElasticSearch log handler errors when attemping to close logs (#5863) 2019-08-20 13:30:56 +01:00
Andrii Soldatenko 4777c8a307 AIRFLOW-5258 ElasticSearch log handler, has 2 times of hours (%H and %I) in _clean_execution_date instead of %H and %M (#5864) 2019-08-19 19:48:30 -07:00
Daniel Imberman e5726c761d
[AIRFLOW-5139] Allow custom ES configs (#5760)
* AIRFLOW-5139 Allow custom ES configs

While attempting to create a self-signed TLS connection between airflow
and ES, we discovered that airflow does now allow users to modify the
SSL state of the elasticsearchtaskhandler. This commit will allow users
to define ES settings in the airflow.cfg
2019-08-09 16:35:05 -05:00
Kevin Yang e07e30460c [AIRFLOW-4956] Fix LocalTaskJob heartbeat log spamming (#5589) 2019-08-08 08:59:53 +02:00
Ash Berlin-Taylor e78cdefee3
[AIRFLOW-5035] Replace multiprocessing.Manager with golang-"channel" style (#5615)
Under heavy load (and exasperated by having `--run-duration 600`) we
found that the multiprocessing.Manager processes could be left alive.
They would consume no CPU as they were just polling on a socket, but
they would consume memory.

Instead of trying to track down all the places we might have leaked a
process I have just removed manager's from the scheduler entirely, and
re-written the multiprocessing how I would if I was writing this in
golang channels - passing objects/messages over a single channel, and
shutting down when done (so we don't need a "Done" signal, and we can
.poll() on the channel to see if there is anything to receive.
2019-07-29 19:27:55 +01:00
Andrii Soldatenko c779394582 [AIRFLOW-3370] Fix bug in Elasticsearch task log handler (#5667) 2019-07-26 21:55:08 +01:00
Ash Berlin-Taylor 0d499db9b7
[AIRFLOW-4883] Fix tests on Python 3.5 (#5655)
`assert_called` and `assert_called_once` are new in Py 3.6
2019-07-24 21:57:42 +01:00
Ash Berlin-Taylor 7f66d0a6dc [AIRFLOW-4883] Fix tests on Python 3.5 2019-07-24 17:03:38 +01:00
aoen 5d6d029010 [AIRFLOW-4883] Bug-fix for Kill hung file process managers (#5639)
Previous PR (#5605) was missing some code after a rebase. This adds the code
and adds unit tests
2019-07-24 13:57:51 +01:00
Kamil Breguła 96933b0797 [AIRFLOW-4952] Remove unused arguments in tests (#5586) 2019-07-20 11:00:26 +02:00
aoen d2b35e8b0b [AIRFLOW-4883] Kill hung file process managers (#5605) 2019-07-19 20:30:54 +05:30
Jarek Potiuk 2d086d77f1
[AIRFLOW-4117] Travis CI uses multi-stage images to run tests (#4938) 2019-07-17 22:42:43 +02:00
Kamil Breguła b5fb370446 [AIRFLOW-4943] Replace six assertion method with native (#5577) 2019-07-14 07:12:20 +02:00
Kamil Breguła 4f332382da [AIRFLOW-4944] Use new types syntax (#5578) 2019-07-14 07:11:13 +02:00
Kamil Breguła c2f5698eda [AIRFLOW-4947] Remove six types (#5581) 2019-07-14 07:09:19 +02:00
Stefan Seelmann 2bdb053db6 [AIRFLOW-4797] Improve performance and behaviour of zombie detection (#5511)
Moved query to fetch zombies from DagFileProcessorManager to DagBag class. Changed query to only look for DAGs of the current DAG bag. The query now uses index ti_dag_state instead of ti_state. Removed no longer required zombies parameters from many function signatures.

The query is now executed on every call to DagBag.kill_zombies which is called when the DAG file is processed which frequency depends on scheduler_heartbeat_sec and processor_poll_interval (AFAIU). The query is faster than the previous one (see also stats below). It's also negligible IMHO because during DAG file processing many other queries (DAG runs and task instances are created, task instance dependencies are checked) are executed.
2019-07-04 21:49:21 +01:00
Ash Berlin-Taylor 6ae5f2b69a
[AIRFLOW-4864] Remove calls to load_test_config (#5502)
We already set the environment variable in the test runner so that
airflow.configuration will do this -- we don't need to do it again
2019-07-01 16:43:03 +01:00
Tomek 7d904467d6 [AIRFLOW-4782] Make GCP hooks Pylint compatible (#5431) 2019-06-24 17:44:13 +02:00
Kamil Breguła 0d38bf40e5 [AIRFLOW-4837] Fix pylint errors regarding ungrouped imports (#5464) 2019-06-24 00:01:47 +02:00
Jiajie Zhong 75bec88f04 [AIRFLOW-3958] Support list tasks as upstream in chain (#4779) 2019-06-21 23:36:32 +05:30
Kamil Breguła e77d78db9e [AIRFLOW-4817] Remove deprecated methods from tests (#5438) 2019-06-20 04:56:44 +02:00
Andrii Soldatenko 0da976a0e1 [AIRFLOW-3370] Add stdout output options to Elasticsearch task log handler (#5048)
When using potentially larger offets than javascript can handle, they can get parsed incorrectly on the client, resulting in the offset query getting stuck on a certain number. This patch ensures that we return a string to the client to avoid being parsed. When we run the query, we ensure the offset is set as an integer.

Add unnecesary prefix_ in config for elastic search section
2019-06-04 22:50:26 +01:00
Philippe Gagnon d1626d80b5 [AIRFLOW-4573] Import airflow_local_settings after prepare_classpath (#5330)
Moves the airflow_local_settings import code into a dedicated function
in settings.py and adds a call to it in initialize after prepare_syspath
2019-06-04 10:50:45 +01:00
Bas Harenslak 7ecdef7d86 [AIRFLOW-4537] Remove the mkdir_p function in favour of native Python pathlib (#5301) 2019-05-19 19:34:06 +02:00
Chao-Han Tsai 577f893672 [AIRFLOW-4215] Replace mock with unittest.mock (#5292) 2019-05-17 15:40:03 +02:00
cong-zhu 56a038aae7 [AIRFLOW-4084] fix ElasticSearch log download (#5177) 2019-05-13 17:49:07 -07:00
Bas Harenslak e76020c0a0 [AIRFLOW-4197] Remove Python2 CI jobs (#5022) (#5021) 2019-05-06 09:31:50 +02:00
Shubham Parekh e518a1e505 [AIRFLOW-3626] Fixed triggering DAGs contained within zip files (#4439) 2019-04-29 11:39:09 +01:00
Chao-Han Tsai e62ad5333c [AIRFLOW-4204] Update super() calls (#5143)
Replace super(_class, self) by super() for all files
except ones in _vendor.
2019-04-24 08:16:11 +02:00
Ash Berlin-Taylor da024dded4
[AIRFLOW-4342] Use @cached_property instead of re-implementing it each time (#5126)
It's not many lines, but I just find this much clearer
2019-04-18 10:00:30 +01:00
al ec631954b8 [AIRFLOW-4232] Add `none_skipped` trigger rule (#5032)
Downstream tasks should run as long as their parents are in
`success`, `failed`, or `upstream_failed` states.
2019-04-06 09:17:26 +01:00
Joshua Carp 0e30793849 [AIRFLOW-4177] Check types in tests (#4994) 2019-03-29 23:03:34 +01:00
Kamil Breguła 707d6f2a50 [AIRFLOW-3908] Add more Google Cloud Vision operators (#4791) 2019-03-21 10:49:57 +00:00
Ash Berlin-Taylor 6eb2efd4da [AIRFLOW-4100] Correctly JSON escape data for tree/graph views (#4921)
It was possible to end up with invalid JS-in-script if you created
certain structures. This fixes it.

`|tojson|safe` is the method recommended by Flask of dealing with this
sort of case: http://flask.pocoo.org/docs/1.0/templating/#standard-filters

The json_ser function is not used anymore (Flask needs an encoder class)
so it and the tests have been removed. The AirflowJsonEncoder behaves
the same on dates, and has extra behaviour too.
2019-03-16 10:00:23 +08:00
Kamil Breguła cc06fefce6 [AIRFLOW-3980] Unify logger (#4804) 2019-03-10 14:45:36 +01:00
J 30660f2e77 [AIRFLOW-4054] Fix assertEqualIgnoreMultipleSpaces util & add tests (#4886) 2019-03-10 06:33:31 +08:00
Kamil Breguła 6d229b240b [AIRFLOW-3707] Group subpackages/extras by cloud providers (#4524) 2019-02-08 10:23:32 +00:00
Xiaodong 59cf865d84 [AIRFLOW-3761] Decommission User & Chart models & Update doc accordingly (#4577)
In master branch, we have already decommissioned the Flask-Admin UI.

In model definitions, User and Chart are only applicable for the
"old" UI based on Flask-Admin.
Hence we should decommission these two models as well.

Related doc are updated in this commit as well.
2019-01-27 00:44:19 -08:00
Kamil Breguła 304cb9e685 [AIRFLOW-3744] Abandon the use of obsolete aliases of methods (#4568) 2019-01-22 15:45:12 -08:00
Ping Zhang 6f616f0dd9 [AIRFLOW-3623] Support download logs by attempts from UI (#4425) 2019-01-03 20:40:58 -08:00
BasPH c014324be2 [AIRFLOW-3556] Add cross join set dependency function (#4356) 2018-12-26 11:00:08 +01:00
Ping Zhang 1c288dd7cb [AIRFLOW-3506] use match_phrase to query log_id in elasticsearch (#4342) 2018-12-18 14:51:10 -08:00
Kevin Yang ded25e16c1 [AIRFLOW-3414] Fix reload_module in DagFileProcessorAgent (#4253) 2018-12-02 17:45:08 +00:00
rmn36 5955db1c76 [AIRFLOW-3336] Add new TriggerRule for 0 upstream failures (#4182)
Add new TriggerRule that triggers only if all upstream do not fail (success or skipped tasks are allowed)
2018-11-23 18:41:04 +00:00
Kevin Yang 75e2288a3f [Airflow-2760] Decouple DAG parsing loop from scheduler loop (#3873) 2018-10-26 09:37:10 +01:00
Fokko Driesprong 0e8394fd23 [AIRFLOW-3190] Make flake8 compliant (#4035)
Enforce Flake8 over the entire project
2018-10-12 22:22:52 +01:00
Fokko Driesprong cfad9ce1d9 [AIRFLOW-1390] Update Alembic to 0.9 (#3935) 2018-09-29 08:56:52 +01:00
Fokko Driesprong 79f8ee1415 [AIRFLOW-2918] Fix Flake8 violations (#3931) 2018-09-21 15:25:54 +01:00
Kaxil Naik 1411245b17 [AIRFLOW-3012] Fix Bug when passing emails for SLA 2018-09-11 12:01:24 -07:00
John Cheng f7fd78b06b [AIRFLOW-1917] Trim extra newline and trailing whitespace from log (#3862) 2018-09-09 19:00:54 +02:00
Dan Davydov 7142ae0732 [AIRFLOW-2895] Prevent scheduler from spamming heartbeats/logs
Reverts most of AIRFLOW-2027 until the issues with
it can be fixed.

Closes #3747 from
aoen/revert_min_file_parsing_time_commit
2018-08-20 09:14:36 -04:00
bolkedebruin 6fd4e6055e
[AIRFLOW-2859] Implement own UtcDateTime (#3708)
The different UtcDateTime implementations all have issues.
Either they replace tzinfo directly without converting
or they do not convert to UTC at all.

We also ensure all mysql connections are in UTC
in order to keep sanity, as mysql will ignore the
timezone of a field when inserting/updating.
2018-08-08 08:07:08 +02:00
Andy Cooper 012ebfd482 [AIRFLOW-2796] Improve utils helpers code coverage (#3637) 2018-08-04 17:53:22 -07:00
Cameron Moberg 76a99597e2 [AIRFLOW-2796] Expand code coverage for utils/helpers.py (#3686) 2018-08-03 15:28:31 +02:00
Tao feng f3f2eb323f [AIRFLOW-2267] Airflow DAG level access
Make sure you have checked _all_ steps below.

### JIRA
- [x] My PR addresses the following [Airflow JIRA]
(https://issues.apache.org/jira/browse/AIRFLOW/)
issues and references them in the PR title. For
example, "\[AIRFLOW-XXX\] My Airflow PR"
    -
https://issues.apache.org/jira/browse/AIRFLOW-2267
    - In case you are fixing a typo in the
documentation you can prepend your commit with
\[AIRFLOW-XXX\], code changes always need a JIRA
issue.

### Description
- [x] Here are some details about my PR, including
screenshots of any UI changes:
 Provide DAG level access for airflow.  The detail
design could be found at https://docs.google.com/d
ocument/d/1qs26lE9kAuCY0Qa0ga-80EQ7d7m4s-590lhjtMB
jmxw/edit#

### Tests
- [x] My PR adds the following unit tests __OR__
does not need testing for this extremely good
reason:
Unit tests are added.

### Commits
- [x] My commits all reference JIRA issues in
their subject lines, and I have squashed multiple
commits if they address the same issue. In
addition, my commits follow the guidelines from
"[How to write a good git commit
message](http://chris.beams.io/posts/git-
commit/)":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not
"adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

- [x] Passes `git diff upstream/master -u --
"*.py" | flake8 --diff`

Closes #3197 from feng-tao/airflow-2267
2018-07-16 13:13:42 -07:00
Kevin Yang e9babff4eb [AIRFLOW-2463] Make task instance context available for hive queries
[AIRFLOW-2463] Make task instance context
available for hive queries

update UPDATING.md, please squash

Closes #3405 from yrqls21/kevin_yang_add_context
2018-07-11 10:28:06 +02:00
Tao feng 0c2206c7d6 [AIRFLOW-2678] Fix db schema unit test to remove checking fab models 2018-06-26 15:22:19 -07:00
Stefan Seelmann 680651f0ae [AIRFLOW-2606] Fix DB schema and SQLAlchemy model
* Add test that verifies that database schema and SQLAlchemy model are in sync
* Add exception for users.password that doesn't exist in model and tables created by other tests
* Add migration script to merge the two heads
* Add migration script to fix not-null constrains for MySQL that were lost by 0e2a74e0fc9f_add_time_zone_awareness
* Add migration script to fix FK constraint for existing SQLite DBs
* Enable ForeignKey support for SQLite, otherwise 2e82aab8ef20_rename_user_table won't change FK in chart and known_event tables
2018-06-18 23:29:29 +02:00
Gabriel Silk 042c3f2aee [AIRFLOW-2430] Extend query batching to additional slow queries
Closes #3324 from gsilk/batch-inserts
2018-05-13 20:54:00 +02:00
Kevin Yang 19b3901284 [AIRFLOW-2363] Fix return type bug in TaskHandler
Closes #3259 from
yrqls21/kevin_yang_fix_s3_logging
2018-04-30 12:49:20 +02:00
Bolke de Bruin c7a472ed6b [AIRFLOW-2287] Fix incorrect ASF headers
Closes #3219 from bolkedebruin/fix_header
2018-04-14 09:13:23 +02:00
Kevin Yang ec38ba9594 [AIRFLOW-1325] Add ElasticSearch log handler and reader
Closes #3214 from
yrqls21/kevin_yang_add_es_task_handler
2018-04-13 11:09:50 +02:00
Bolke de Bruin 39b7d7d87c [AIRFLOW-1623] Trigger on_kill method in operators
on_kill methods were not triggered, due to
processes
not being properly terminated. This was due to the
fact
the runners use a shell which is then replaced by
the
child pid, which is unknown to Airflow.

Closes #3204 from bolkedebruin/AIRFLOW-1623
2018-04-11 08:05:42 +02:00
Dan Davydov 3c4f1fd9e6 [AIRFLOW-2027] Only trigger sleep in scheduler after all files have parsed
Closes #2986 from aoen/ddavydov--open_source_disab
le_unecessary_sleep_in_scheduler_loop
2018-04-09 10:22:11 +02:00
Jin Hyuk Chang 9dba430b68 [AIRFLOW-2253] Add Airflow CLI instrumentation
Closes #3159 from jinhyukchang/cli-instrumentation
2018-04-02 15:16:25 -07:00
wongwill86 81ec595b6c [AIRFLOW-2203] Cache signature in apply_defaults
Cache inspect.signature for the wrapper closure to avoid calling it at
every decorated invocation. This is separate sig_cache created per
decoration, i.e. each function decorated using apply_defaults will have
a different sig_cache.
2018-03-14 09:11:50 +01:00
wongwill86 16ab314c21 [AIRFLOW-2203] Cache static rules (trigger/weight)
No need to recalculate them everytime just to see if they are valid
2018-03-14 09:11:38 +01:00
Trevor Joynson (trevorj) 6c93460b98 [AIRFLOW-1852] Allow hostname to be overridable.
This allows hostnames to be overridable to
facilitate service discovery
requirements in common production deployments.

Closes #3036 from thekashifmalik/hostnames
2018-02-20 16:56:44 -08:00
niels ffc4a8b41c [AIRFLOW-1976] Fix for missing log/logger attribute FileProcessHandler
Closes #2922 from
NielsZeilemaker/fix_log_file_process_handler
2018-01-10 12:56:25 +01:00
Joy Gao c0dffb57c2 [AIRFLOW-1821] Enhance default logging config by removing extra loggers
Closes #2793 from jgao54/logging-enhancement
2017-12-22 14:07:29 +01:00
Ash Berlin-Taylor 4ce4faaeae [AIRFLOW-1916] Don't upload logs to remote from `run --raw`
In a previous change we removed the
airflow.task.raw handler (which
printed to stdout directly) and replaced it with
one that wrote to the
log file itself. The problem comes that python
automatically calls
`logging.shutdown()` itself on process clean exit.
This ended up
uploading the log file twice: once from the end of
`airflow run --raw`,
and then again from the explicit shutdown() call
at the end of cli's
`run()`

Since logging is automatically shutdown this
change adds and explicit
flag to control if the GC and S3 handlers should
upload the file or not,
and we tell them not to when running with `--raw`

Closes #2880 from ashb/AIRFLOW-1916-dont-upload-
logs-twice
2017-12-19 21:04:18 +01:00
Ash Berlin-Taylor 9731ce6fae [AIRFLOW-1897][AIRFLOW-1873] Task Logs for running instance not visible in WebUI
Due to the change in AIRFLOW-1873 we inadvertently
changed the behaviour
such that task logs for a try wouldn't show up in
the UI until after the
task run had completed.

Closes #2859 from ashb/AIRFLOW-1897-view-logs-for-
running-instance
2017-12-09 17:24:05 +01:00
Ash Berlin-Taylor 4b4e504eea [AIRFLOW-1873] Set TI.try_number to right value depending TI state
Rather than having try_number+1 in various places,
try_number
will now automatically contain the right value for
when the TI
will next be run, and handle the case where
try_number is
accessed when the task is currently running.

This showed up as a bug where the logs from
running operators would
show up in the next log file (2.log for the first
try)

Closes #2832 from ashb/AIRFLOW-1873-task-operator-
log-try-number
2017-12-07 13:31:46 +00:00
Paulius ff0d75f062 [AIRFLOW-1554] Fix wrong DagFileProcessor termination method call
Closes #2821 from
pdambrauskas/fix/wrong_termination_call
2017-12-05 19:39:25 +01:00
Bolke de Bruin 406d738b1c [AIRFLOW-1872] Set context for all handlers including parents
Previously setting the context was not propagated
to the parent
loggers. Unfortnately, in case of a non explicitly
defined logger
the returned logger is shallow, ie. it does not
have handlers
defined. So to set the context it is required to
walk the tree.

Closes #2831 from bolkedebruin/fix_logging
2017-12-02 09:56:13 +01:00
Bolke de Bruin 9624f5f24e [AIRFLOW-1809] Update tests to use timezone aware objects 2017-11-27 15:54:27 +01:00
Bolke de Bruin dcac3e97a4 [AIRFLOW-1806] Use naive datetime for cron scheduling
Converting to naive time is required in order to make sure
to run at exact times for crons.
E.g. if you specify to run at 8:00pm every day you do not
want suddenly to run at 7:00pm due to DST.
2017-11-27 15:54:27 +01:00
Bolke de Bruin a47255fb2d [AIRFLOW-1804] Add time zone configuration options
Time zone defaults to UTC as is the default now in order
to maintain backwards compatibility.
2017-11-27 15:53:03 +01:00
Ash Berlin-Taylor 715602ce6a [AIRFLOW-1756] Fix S3TaskHandler to work with Boto3-based S3Hook
The change from boto2 to boto3 in S3Hook caused
this to break (the
return type of `hook.get_key()` changed. There's a
better method
designed for that we should use anyway.

This wasn't caught by the tests as the mocks
weren't updated. Rather
than mocking the return of the hook I have changed
it to use "moto"
(already in use elsewhere in the tests) to mock at
the S3 layer, not
our hook.

Closes #2773 from ashb/AIRFLOW-1756-s3-logging-
boto3-fix
2017-11-09 21:57:04 +01:00
Kevin Yang 313f5bac4a [AIRFLOW-1787] Fix task instance batch clear and set state bugs
Fixes Batch clear in Task Instances view is not working
for task instances in RUNNING state and all batch
operations in Task instances view cannot work when
manually triggered task instances are selected
because they have a different execution date
format.

Closes #2759 from yrqls21/fix-ti-batch-clear-n
-set-state-bugs
2017-11-07 11:23:00 -08:00
Bolke de Bruin 5b06b66662 [AIRFLOW-1776] Capture stdout and stderr for logging
The new logging framework was not properly
capturing stdout/stderr
output. Redirection the the correct logging
facility is required.

Closes #2745 from bolkedebruin/redirect_std
2017-11-01 23:39:52 +01:00
Andy Hadjigeorgiou 44710d7e9e [AIRFLOW-1763] Fix S3TaskHandler unit tests
Fix breaking S3TaskHandler unit tests, and create
a package so that
tests are identified by CI.

Closes #2732 from andyxhadji/AIRFLOW-1763
2017-10-31 19:32:13 +01:00
Bolke de Bruin 4ee4e474b8 [AIRFLOW-1018] Make processor use logging framework
Until now, the dga processor had its own logging
implementation,
making it hard to adjust for certain use cases
like working
in a container.

This patch moves everything to the standard
logging framework.

Closes #2728 from bolkedebruin/AIRFLOW-1018
2017-10-30 20:40:12 +01:00
fenglu-g 574e1c63d9 [AIRFLOW-1723] Make sendgrid a plugin
Closes #2727 from fenglu-g/master
2017-10-30 10:55:30 -07:00
Niels Zeilemaker cd3ad3f2e2 [AIRFLOW-1520] Boto3 S3Hook, S3Log
Closes #2532 from NielsZeilemaker/AIRFLOW-1520
2017-10-22 20:01:18 +02:00
fenglu-g 7cb818bbac [AIRFLOW-1723] Support sendgrid in email backend
Closes #2695 from fenglu-g/master
2017-10-18 12:27:14 -07:00
Fokko Driesprong 3c3a65a3fe [AIRFLOW-1611] Customize logging
Change the configuration of the logging to make
use of the python
logging and make the configuration easy
configurable. Some of the
settings which are now not needed anymore since
they can easily
be implemented in the config file.

Closes #2631 from Fokko/AIRFLOW-1611-customize-
logging-in-airflow
2017-10-02 17:14:01 +02:00
Bolke de Bruin 3aa05cb227 [AIRFLOW-1650] Fix custom celery config loading
Celery config loading was broken as it was just passing
a string. This fixes it by loading it as a module with an
attribute. Inspired by Django's module loading.
2017-09-27 20:03:56 +02:00
Fokko Driesprong eb2f589099 [AIRFLOW-1604] Rename logger to log
In all the popular languages the variable name log
is the de facto
standard for the logging. Rename LoggingMixin.py
to logging_mixin.py
to comply with the Python standard.

When using the .logger a deprecation warning will
be emitted.

Closes #2604 from Fokko/AIRFLOW-1604-logger-to-log
2017-09-19 10:17:14 +02:00
Fokko Driesprong a7a518902d [AIRFLOW-1582] Improve logging within Airflow
Clean the way of logging within Airflow. Remove
the old logging.py and
move to the airflow.utils.log.* interface. Remove
setting the logging
outside of the settings/configuration code. Move
away from the string
format to logging_function(msg, *args).

Closes #2592 from Fokko/AIRFLOW-1582-Improve-
logging-structure
2017-09-13 09:36:58 +02:00
Niels Zeilemaker 4c674ccffd [AIRFLOW-1564] Use Jinja2 to render logging filename
Still backwards compatible with python format

Closes #2565 from NielsZeilemaker/AIRFLOW-1564
2017-09-06 13:41:20 +02:00
AllisonWang b0669b532a [AIRFLOW-1385] Make Airflow task logging configurable
This PR adds configurable task logging to Airflow.
Please refer to #2422 for previous discussions.
This is the first step of making entire Airflow
logging configurable ([AIRFLOW-1454](https://issue
s.apache.org/jira/browse/AIRFLOW-1454)).

Closes #2464 from AllisonWang/allison--log-
abstraction
2017-08-11 11:38:39 -07:00
Stanislav Kudriashev d9109d6458 [AIRFLOW-1486] Unexpected S3 writing log error
Removed unexpected S3 writing log error and added tests for s3 logging.

Closes #2499 from skudriashev/airflow-1486
2017-08-07 15:52:54 -07:00
AllisonWang b49986c3b2 [Airflow 1332] Split logs based on try number
This PR splits logs based on try number and add
tabs to display different task instance tries.

**Note this PR is a temporary change for
separating task attempts. The code in this PR will
be refactored in the future. Please refer to #2422
for Airflow logging abstractions redesign.**

Testing:
1. Added unit tests.
2. Tested on localhost.
3. Tested on production environment with S3 remote
storage, MySQL database, Redis, one Airflow
scheduler and two airflow workers.

Closes #2383 from AllisonWang/allison--add-task-
attempt
2017-07-20 18:08:18 -07:00
Stanislav Kudriashev cef01b2a86 [AIRFLOW-1245] Fix random failure in test_trigger_dag_for_date
Closes #2325 from skudriashev/airflow-1245
2017-05-29 17:17:30 +02:00
Stanislav Kudriashev d165377d2f [AIRFLOW-1234] Cover utils.operator_helpers with UTs
Closes #2317 from skudriashev/airflow-1234
2017-05-22 11:46:44 +02:00
Stanislav Kudriashev 502410b0d9 [AIRFLOW-1233] Cover utils.json with unit tests
Closes #2316 from skudriashev/airflow-1233
2017-05-21 20:20:23 +02:00
Stanislav Kudriashev 8ac87b2e28 [AIRFLOW-1207] Enable utils.helpers unit tests
Closes #2300 from skudriashev/airflow-1207
2017-05-17 20:52:18 +02:00
Alex Guziel 9bdfb8c700 [AIRFLOW-1109] Use kill signal to kill processes and log results
The kill_process_tree function comments state that
it uses SIGKILL when
it uses SIGTERM. We should update this to be
correct as well as log
results.

Closes #2241 from saguziel/aguziel-kill-processes
2017-04-13 18:52:43 -07:00
Jeremiah Lowin bbfd43df46 [AIRFLOW-863] Example DAGs should have recent start dates
Avoid unnecessary backfills by having start dates
of
just a few days ago. Adds a utility function
airflow.utils.dates.days_ago().

Closes #2068 from jlowin/example-start-date
2017-02-12 15:37:56 -05:00
Krishna Bhupatiraju ad15f5efd6 [AIRFLOW-793] Enable compressed loading in S3ToHiveTransfer
Testing Done:
- Added new unit tests for the S3ToHiveTransfer
module

Closes #2012 from krishnabhupatiraju/S3ToHiveTrans
fer_compress_loading
2017-02-06 16:52:14 -08:00