From 679191ef5c395db4502da9e801b92c9e1314139d Mon Sep 17 00:00:00 2001 From: David Mateo Date: Thu, 15 Apr 2021 10:10:41 +0200 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20Fix=20broken=20feat?= =?UTF-8?q?ures=20of=20last=20release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ๐Ÿ”ƒ Update missing vars in cfg (v2) template - ๐Ÿ”ƒ Update conditionally vars missing or unnecesary in cfg (v2) template - ๐Ÿ› ๏ธ Fix environment template PATH - ๐Ÿ› ๏ธ Fix wrong typed and escaped log options in airflow-cfg.yaml group_vars - ๐Ÿงน Clean airflow-cfg.yml with bad format values and unnecesary quotation - โž• tags for config files related --- Pipfile.lock | 181 ++++++++++++++++---------- defaults/main/airflow-cfg.yml | 61 +++++---- tasks/config.yml | 18 ++- templates/airflow-environment-file.j2 | 2 +- templates/airflow2.cfg.j2 | 10 +- 5 files changed, 158 insertions(+), 114 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 30147f1..7842859 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,11 +1,11 @@ { "_meta": { "hash": { - "sha256": "3b1830187ce6d7d5296835882968e728c774d799303d0646367caf20ecbf3e9f" + "sha256": "7e72e72badb6e46480fded13334a26f54157e8fdcf39dab3553b0230d64ab12e" }, "pipfile-spec": 6, "requires": { - "python_version": "3.8" + "python_version": "3.7" }, "sources": [ { @@ -33,10 +33,10 @@ }, "arrow": { "hashes": [ - "sha256:e098abbd9af3665aea81bdd6c869e93af4feb078e98468dd351c383af187aac5", - "sha256:ff08d10cda1d36c68657d6ad20d74fbea493d980f8b2d45344e00d6ed2bf6ed4" + "sha256:3515630f11a15c61dcb4cdd245883270dd334c83f3e639824e65a4b79cc48543", + "sha256:399c9c8ae732270e1aa58ead835a79a40d7be8aa109c579898eb41029b5a231d" ], - "version": "==0.17.0" + "version": "==1.0.3" }, "bcrypt": { "hashes": [ @@ -59,9 +59,10 @@ }, "cerberus": { "hashes": [ - "sha256:302e6694f206dd85cb63f13fd5025b31ab6d38c99c50c6d769f8fa0b0f299589" + "sha256:7aff49bc793e58a88ac14bffc3eca0f67e077881d3c62c621679a621294dd174", + "sha256:eec10585c33044fb7c69650bc5b68018dac0443753337e2b07684ee0f3c83329" ], - "version": "==1.3.2" + "version": "==1.3.3" }, "certifi": { "hashes": [ @@ -72,45 +73,45 @@ }, "cffi": { "hashes": [ - "sha256:00a1ba5e2e95684448de9b89888ccd02c98d512064b4cb987d48f4b40aa0421e", - "sha256:00e28066507bfc3fe865a31f325c8391a1ac2916219340f87dfad602c3e48e5d", - "sha256:045d792900a75e8b1e1b0ab6787dd733a8190ffcf80e8c8ceb2fb10a29ff238a", - "sha256:0638c3ae1a0edfb77c6765d487fee624d2b1ee1bdfeffc1f0b58c64d149e7eec", - "sha256:105abaf8a6075dc96c1fe5ae7aae073f4696f2905fde6aeada4c9d2926752362", - "sha256:155136b51fd733fa94e1c2ea5211dcd4c8879869008fc811648f16541bf99668", - "sha256:1a465cbe98a7fd391d47dce4b8f7e5b921e6cd805ef421d04f5f66ba8f06086c", - "sha256:1d2c4994f515e5b485fd6d3a73d05526aa0fcf248eb135996b088d25dfa1865b", - "sha256:2c24d61263f511551f740d1a065eb0212db1dbbbbd241db758f5244281590c06", - "sha256:51a8b381b16ddd370178a65360ebe15fbc1c71cf6f584613a7ea08bfad946698", - "sha256:594234691ac0e9b770aee9fcdb8fa02c22e43e5c619456efd0d6c2bf276f3eb2", - "sha256:5cf4be6c304ad0b6602f5c4e90e2f59b47653ac1ed9c662ed379fe48a8f26b0c", - "sha256:64081b3f8f6f3c3de6191ec89d7dc6c86a8a43911f7ecb422c60e90c70be41c7", - "sha256:6bc25fc545a6b3d57b5f8618e59fc13d3a3a68431e8ca5fd4c13241cd70d0009", - "sha256:798caa2a2384b1cbe8a2a139d80734c9db54f9cc155c99d7cc92441a23871c03", - "sha256:7c6b1dece89874d9541fc974917b631406233ea0440d0bdfbb8e03bf39a49b3b", - "sha256:7ef7d4ced6b325e92eb4d3502946c78c5367bc416398d387b39591532536734e", - "sha256:840793c68105fe031f34d6a086eaea153a0cd5c491cde82a74b420edd0a2b909", - "sha256:8d6603078baf4e11edc4168a514c5ce5b3ba6e3e9c374298cb88437957960a53", - "sha256:9cc46bc107224ff5b6d04369e7c595acb700c3613ad7bcf2e2012f62ece80c35", - "sha256:9f7a31251289b2ab6d4012f6e83e58bc3b96bd151f5b5262467f4bb6b34a7c26", - "sha256:9ffb888f19d54a4d4dfd4b3f29bc2c16aa4972f1c2ab9c4ab09b8ab8685b9c2b", - "sha256:a5ed8c05548b54b998b9498753fb9cadbfd92ee88e884641377d8a8b291bcc01", - "sha256:a7711edca4dcef1a75257b50a2fbfe92a65187c47dab5a0f1b9b332c5919a3fb", - "sha256:af5c59122a011049aad5dd87424b8e65a80e4a6477419c0c1015f73fb5ea0293", - "sha256:b18e0a9ef57d2b41f5c68beefa32317d286c3d6ac0484efd10d6e07491bb95dd", - "sha256:b4e248d1087abf9f4c10f3c398896c87ce82a9856494a7155823eb45a892395d", - "sha256:ba4e9e0ae13fc41c6b23299545e5ef73055213e466bd107953e4a013a5ddd7e3", - "sha256:c6332685306b6417a91b1ff9fae889b3ba65c2292d64bd9245c093b1b284809d", - "sha256:d5ff0621c88ce83a28a10d2ce719b2ee85635e85c515f12bac99a95306da4b2e", - "sha256:d9efd8b7a3ef378dd61a1e77367f1924375befc2eba06168b6ebfa903a5e59ca", - "sha256:df5169c4396adc04f9b0a05f13c074df878b6052430e03f50e68adf3a57aa28d", - "sha256:ebb253464a5d0482b191274f1c8bf00e33f7e0b9c66405fbffc61ed2c839c775", - "sha256:ec80dc47f54e6e9a78181ce05feb71a0353854cc26999db963695f950b5fb375", - "sha256:f032b34669220030f905152045dfa27741ce1a6db3324a5bc0b96b6c7420c87b", - "sha256:f60567825f791c6f8a592f3c6e3bd93dd2934e3f9dac189308426bd76b00ef3b", - "sha256:f803eaa94c2fcda012c047e62bc7a51b0bdabda1cad7a92a522694ea2d76e49f" - ], - "version": "==1.14.4" + "sha256:005a36f41773e148deac64b08f233873a4d0c18b053d37da83f6af4d9087b813", + "sha256:0857f0ae312d855239a55c81ef453ee8fd24136eaba8e87a2eceba644c0d4c06", + "sha256:1071534bbbf8cbb31b498d5d9db0f274f2f7a865adca4ae429e147ba40f73dea", + "sha256:158d0d15119b4b7ff6b926536763dc0714313aa59e320ddf787502c70c4d4bee", + "sha256:1f436816fc868b098b0d63b8920de7d208c90a67212546d02f84fe78a9c26396", + "sha256:2894f2df484ff56d717bead0a5c2abb6b9d2bf26d6960c4604d5c48bbc30ee73", + "sha256:29314480e958fd8aab22e4a58b355b629c59bf5f2ac2492b61e3dc06d8c7a315", + "sha256:34eff4b97f3d982fb93e2831e6750127d1355a923ebaeeb565407b3d2f8d41a1", + "sha256:35f27e6eb43380fa080dccf676dece30bef72e4a67617ffda586641cd4508d49", + "sha256:3d3dd4c9e559eb172ecf00a2a7517e97d1e96de2a5e610bd9b68cea3925b4892", + "sha256:43e0b9d9e2c9e5d152946b9c5fe062c151614b262fda2e7b201204de0b99e482", + "sha256:48e1c69bbacfc3d932221851b39d49e81567a4d4aac3b21258d9c24578280058", + "sha256:51182f8927c5af975fece87b1b369f722c570fe169f9880764b1ee3bca8347b5", + "sha256:58e3f59d583d413809d60779492342801d6e82fefb89c86a38e040c16883be53", + "sha256:5de7970188bb46b7bf9858eb6890aad302577a5f6f75091fd7cdd3ef13ef3045", + "sha256:65fa59693c62cf06e45ddbb822165394a288edce9e276647f0046e1ec26920f3", + "sha256:69e395c24fc60aad6bb4fa7e583698ea6cc684648e1ffb7fe85e3c1ca131a7d5", + "sha256:6c97d7350133666fbb5cf4abdc1178c812cb205dc6f41d174a7b0f18fb93337e", + "sha256:6e4714cc64f474e4d6e37cfff31a814b509a35cb17de4fb1999907575684479c", + "sha256:72d8d3ef52c208ee1c7b2e341f7d71c6fd3157138abf1a95166e6165dd5d4369", + "sha256:8ae6299f6c68de06f136f1f9e69458eae58f1dacf10af5c17353eae03aa0d827", + "sha256:8b198cec6c72df5289c05b05b8b0969819783f9418e0409865dac47288d2a053", + "sha256:99cd03ae7988a93dd00bcd9d0b75e1f6c426063d6f03d2f90b89e29b25b82dfa", + "sha256:9cf8022fb8d07a97c178b02327b284521c7708d7c71a9c9c355c178ac4bbd3d4", + "sha256:9de2e279153a443c656f2defd67769e6d1e4163952b3c622dcea5b08a6405322", + "sha256:9e93e79c2551ff263400e1e4be085a1210e12073a31c2011dbbda14bda0c6132", + "sha256:9ff227395193126d82e60319a673a037d5de84633f11279e336f9c0f189ecc62", + "sha256:a465da611f6fa124963b91bf432d960a555563efe4ed1cc403ba5077b15370aa", + "sha256:ad17025d226ee5beec591b52800c11680fca3df50b8b29fe51d882576e039ee0", + "sha256:afb29c1ba2e5a3736f1c301d9d0abe3ec8b86957d04ddfa9d7a6a42b9367e396", + "sha256:b85eb46a81787c50650f2392b9b4ef23e1f126313b9e0e9013b35c15e4288e2e", + "sha256:bb89f306e5da99f4d922728ddcd6f7fcebb3241fc40edebcb7284d7514741991", + "sha256:cbde590d4faaa07c72bf979734738f328d239913ba3e043b1e98fe9a39f8b2b6", + "sha256:cd2868886d547469123fadc46eac7ea5253ea7fcb139f12e1dfc2bbd406427d1", + "sha256:d42b11d692e11b6634f7613ad8df5d6d5f8875f5d48939520d351007b3c13406", + "sha256:f2d45f97ab6bb54753eab54fffe75aaf3de4ff2341c9daee1987ee1837636f1d", + "sha256:fd78e5fee591709f32ef6edb9a015b4aa1a5022598e36227500c8f4e02328d9c" + ], + "version": "==1.14.5" }, "chardet": { "hashes": [ @@ -155,15 +156,20 @@ }, "cryptography": { "hashes": [ - "sha256:287032b6a7d86abc98e8e977b20138c53fea40e5b24e29090d5a675a973dcd10", - "sha256:288c65eea20bd89b11102c47b118bc1e0749386b0a0dfebba414076c5d4c8188", - "sha256:7eed937ad9b53280a5f53570d3a7dc93cb4412b6a3d58d4c6bb78cc26319c729", - "sha256:dab437c2e84628703e3358f0f06555a6259bc5039209d51aa3b05af667ff4fd0", - "sha256:ee5e19f0856b6fbbdbab15c2787ca65d203801d2d65d0b8de6218f424206c848", - "sha256:f21be9ec6b44c223b2024bbe59d394fadc7be320d18a8d595419afadb6cd5620", - "sha256:f6ea140d2736b7e1f0de4f988c43f76b0b3f3d365080e091715429ba218dce28" - ], - "version": "==3.4.4" + "sha256:0f1212a66329c80d68aeeb39b8a16d54ef57071bf22ff4e521657b27372e327d", + "sha256:1e056c28420c072c5e3cb36e2b23ee55e260cb04eee08f702e0edfec3fb51959", + "sha256:240f5c21aef0b73f40bb9f78d2caff73186700bf1bc6b94285699aff98cc16c6", + "sha256:26965837447f9c82f1855e0bc8bc4fb910240b6e0d16a664bb722df3b5b06873", + "sha256:37340614f8a5d2fb9aeea67fd159bfe4f5f4ed535b1090ce8ec428b2f15a11f2", + "sha256:3d10de8116d25649631977cb37da6cbdd2d6fa0e0281d014a5b7d337255ca713", + "sha256:3d8427734c781ea5f1b41d6589c293089704d4759e34597dce91014ac125aad1", + "sha256:7ec5d3b029f5fa2b179325908b9cd93db28ab7b85bb6c1db56b10e0b54235177", + "sha256:8e56e16617872b0957d1c9742a3f94b43533447fd78321514abbe7db216aa250", + "sha256:de4e5f7f68220d92b7637fc99847475b59154b7a1b3868fb7385337af54ac9ca", + "sha256:eb8cc2afe8b05acbd84a43905832ec78e7b3873fb124ca190f574dca7389a87d", + "sha256:ee77aa129f481be46f8d92a1a7db57269a2f23052d5f2433b4621bb457081cc9" + ], + "version": "==3.4.7" }, "distro": { "hashes": [ @@ -194,6 +200,14 @@ ], "version": "==2.10" }, + "importlib-metadata": { + "hashes": [ + "sha256:2ec0faae539743ae6aaa84b49a169670a465f7f5d64e6add98388cc29fd1f2f6", + "sha256:c9356b657de65c53744046fa8f7358afe0714a1af7d570c00c3835c2d724a7c1" + ], + "markers": "python_version < '3.8'", + "version": "==3.10.1" + }, "jinja2": { "hashes": [ "sha256:03e47ad063331dd6a3f04a43eddca8a966a26ba0c5b7207a9a9e4e08f1b29419", @@ -378,15 +392,23 @@ "sha256:5accb17103e43963b80e6f837831f38d314a0495500067cb25afab2e8d7a4018", "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e", "sha256:6c78645d400265a062508ae399b60b8c167bf003db364ecb26dcab2bda048253", + "sha256:72a01f726a9c7851ca9bfad6fd09ca4e090a023c00945ea05ba1638c09dc3347", "sha256:74c1485f7707cf707a7aef42ef6322b8f97921bd89be2ab6317fd782c2d53183", + "sha256:895f61ef02e8fed38159bb70f7e100e00f471eae2bc838cd0f4ebb21e28f8541", "sha256:8c1be557ee92a20f184922c7b6424e8ab6691788e6d86137c5d93c1a6ec1b8fb", "sha256:bb4191dfc9306777bc594117aee052446b3fa88737cd13b7188d0e7aa8162185", + "sha256:bfb51918d4ff3d77c1c856a9699f8492c612cde32fd3bcd344af9be34999bfdc", "sha256:c20cfa2d49991c8b4147af39859b167664f2ad4561704ee74c1de03318e898db", + "sha256:cb333c16912324fd5f769fff6bc5de372e9e7a202247b48870bc251ed40239aa", "sha256:d2d9808ea7b4af864f35ea216be506ecec180628aced0704e34aca0b040ffe46", + "sha256:d483ad4e639292c90170eb6f7783ad19490e7a8defb3e46f97dfe4bacae89122", "sha256:dd5de0646207f053eb0d6c74ae45ba98c3395a571a2891858e87df7c9b9bd51b", "sha256:e1d4970ea66be07ae37a3c2e48b5ec63f7ba6804bdddfdbd3cfd954d25a82e63", "sha256:e4fac90784481d221a8e4b1162afa7c47ed953be40d31ab4629ae917510051df", - "sha256:fa5ae20527d8e831e8230cbffd9f8fe952815b2b7dae6ffec25318803a7528fc" + "sha256:fa5ae20527d8e831e8230cbffd9f8fe952815b2b7dae6ffec25318803a7528fc", + "sha256:fd7f6999a8070df521b6384004ef42833b9bd62cfee11a09bda1079b4b704247", + "sha256:fdc842473cd33f45ff6bce46aea678a54e3d21f1b61a7750ce3c498eedfe25d6", + "sha256:fe69978f3f768926cfa37b867e3843918e012cf83f680806599ddce33c2c68b0" ], "version": "==5.4.1" }, @@ -399,11 +421,11 @@ }, "ruamel.yaml": { "hashes": [ - "sha256:012b9470a0ea06e4e44e99e7920277edf6b46eee0232a04487ea73a7386340a5", - "sha256:076cc0bc34f1966d920a49f18b52b6ad559fbe656a0748e3535cf7b3f29ebf9e" + "sha256:44bc6b54fddd45e4bc0619059196679f9e8b79c027f4131bb072e6a22f4d5e28", + "sha256:ac79fb25f5476e8e9ed1c53b8a2286d2c3f5dde49eb37dbcee5c7eb6a8415a22" ], "markers": "python_version >= '3.7'", - "version": "==0.16.12" + "version": "==0.17.4" }, "ruamel.yaml.clib": { "hashes": [ @@ -439,7 +461,7 @@ "sha256:e9f7d1d8c26a6a12c23421061f9022bb62704e38211fe375c645485f38df34a2", "sha256:f6061a31880c1ed6b6ce341215336e2f3d0c1deccd84957b6fa8ca474b41e89f" ], - "markers": "platform_python_implementation == 'CPython' and python_version < '3.9'", + "markers": "platform_python_implementation == 'CPython' and python_version < '3.10'", "version": "==0.2.2" }, "selinux": { @@ -473,10 +495,10 @@ }, "tabulate": { "hashes": [ - "sha256:ac64cb76d53b1231d364babcd72abbb16855adac7de6665122f97b593f1eb2ba", - "sha256:db2723a20d04bcda8522165c73eea7c300eda74e0ce852d9022e0159d7895007" + "sha256:d7c013fe7abbc5e491394e10fa845f8f32fe54f8dc60c6622c6cf482d25d47e4", + "sha256:eb1d13f25760052e8931f2ef80aaf6045a6cceb47514db8beab24cded16f13a7" ], - "version": "==0.8.7" + "version": "==0.8.9" }, "text-unidecode": { "hashes": [ @@ -492,26 +514,41 @@ ], "version": "==0.1.2" }, + "typing-extensions": { + "hashes": [ + "sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918", + "sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c", + "sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f" + ], + "markers": "python_version < '3.8'", + "version": "==3.7.4.3" + }, "urllib3": { "hashes": [ - "sha256:1b465e494e3e0d8939b50680403e3aedaa2bc434b7d5af64dfd3c958d7f5ae80", - "sha256:de3eedaad74a2683334e282005cd8d7f22f4d55fa690a2a1020a416cb0a47e73" + "sha256:2f4da4594db7e1e110a944bb1b551fdf4e6c136ad42e4234131391e21eb5b0df", + "sha256:e7b021f7241115872f92f43c6508082facffbd1c048e3c6e2bb9c2a157e28937" ], - "version": "==1.26.3" + "version": "==1.26.4" }, "websocket-client": { "hashes": [ - "sha256:0fc45c961324d79c781bab301359d5a1b00b13ad1b10415a4780229ef71a5549", - "sha256:d735b91d6d1692a6a181f2a8c9e0238e5f6373356f561bb9dc4c7af36f452010" + "sha256:44b5df8f08c74c3d82d28100fdc81f4536809ce98a17f0757557813275fbb663", + "sha256:63509b41d158ae5b7f67eb4ad20fecbb4eee99434e73e140354dc3ff8e09716f" ], - "version": "==0.57.0" + "version": "==0.58.0" }, "yamllint": { "hashes": [ - "sha256:8a5f8e442f49309eaf3e9d7232ce76f2fc8026f5c0c0b164b83f33fed1399637", - "sha256:b0e4c89985c7f5f8451c2eb8c67d804d10ac13a4abe031cbf49bdf3465d01087" + "sha256:87d9462b3ed7e9dfa19caa177f7a77cd9888b3dc4044447d6ae0ab233bcd1324" + ], + "version": "==1.26.1" + }, + "zipp": { + "hashes": [ + "sha256:3607921face881ba3e026887d8150cca609d517579abe052ac81fc5aeffdbd76", + "sha256:51cb66cc54621609dd593d1787f286ee42a5c0adbb4b29abea5a63edc3e03098" ], - "version": "==1.26.0" + "version": "==3.4.1" } }, "develop": {} diff --git a/defaults/main/airflow-cfg.yml b/defaults/main/airflow-cfg.yml index 4c4f615..5798d76 100644 --- a/defaults/main/airflow-cfg.yml +++ b/defaults/main/airflow-cfg.yml @@ -3,9 +3,9 @@ # ------------------------------------------------------------------------------ # [core] airflow_dags_folder: "{{ airflow_app_home }}/dags" -airflow_hostname_callable: "socket:getfqdn" -airflow_hostname_callable_v2: "socket.getfqdn" -airflow_default_timezone: "utc" +airflow_hostname_callable: socket:getfqdn +airflow_hostname_callable_v2: socket.getfqdn +airflow_default_timezone: utc # The executor class that airflow should use. Choices include # SequentialExecutor, LocalExecutor, CeleryExecutor, DaskExecutor airflow_executor: SequentialExecutor @@ -21,25 +21,25 @@ airflow_database_schema: airflow_database_connect_args: airflow_parallelism: 32 airflow_dag_concurrency: 16 -airflow_dags_are_paused_at_creation: true +airflow_dags_are_paused_at_creation: True airflow_max_active_runs_per_dag: 16 airflow_load_examples: False airflow_load_default_connections: False airflow_plugins_folder: "{{ airflow_app_home }}/plugins" airflow_execute_tasks_new_python_interpreter: False airflow_fernet_key: -airflow_donot_pickle: false +airflow_donot_pickle: False airflow_dagbag_import_timeout: 30 airflow_dagbag_import_error_tracebacks: True airflow_dagbag_import_error_traceback_depth: 2 airflow_dag_file_processor_timeout: 50 -airflow_task_runner: BashTaskRunner +airflow_task_runner: StandardTaskRunner airflow_default_impersonation: airflow_security: -airflow_unit_test_mode: false -airflow_enable_xcom_pickling: "True" +airflow_unit_test_mode: False +airflow_enable_xcom_pickling: True airflow_killed_task_cleanup_time: 60 -airflow_dag_run_conf_overrides_params: False +airflow_dag_run_conf_overrides_params: True airflow_dag_discovery_safe_mode: True airflow_default_task_retries: 0 airflow_min_serialized_dag_update_interval: 30 @@ -60,27 +60,26 @@ airflow_remote_logging: False airflow_remote_log_conn_id: airflow_google_key_path: airflow_remote_base_log_folder: -airflow_encrypt_s3_logs: false -airflow_logging_level: "INFO" -airflow_fab_logging_level: "WARN" +airflow_encrypt_s3_logs: False +airflow_logging_level: INFO +airflow_fab_logging_level: WARN airflow_logging_config_class: airflow_colored_console_log: True -colored_log_format: "[%%(blue)s%%(asctime)s%%(reset)s] {{ '{{' }}%%(blue)s%%(filename)s:%%(reset)s%%(lineno)d{{ '}}' }} %%(log_color)s%%(levelname)s%%(reset)s - %%(log_color)s%%(message)s%%(reset)s" -colored_formatter_class: airflow.utils.log.colored_log.CustomTTYColoredFormatter -airflow_log_format: > - "[%%(asctime)s] {{ '{' }}%%(filename)s:%%(lineno)d} %%(levelname)s - %%(message)s" -airflow_simple_log_format: "%%(asctime)s %%(levelname)s - %%(message)s" +airflow_colored_log_format: "[%%(blue)s%%(asctime)s%%(reset)s] {{ '{' }}%%(blue)s%%(filename)s:%%(reset)s%%(lineno)d{{ '}' }} %%(log_color)s%%(levelname)s%%(reset)s - %%(log_color)s%%(message)s%%(reset)s" +airflow_colored_formatter_class: airflow.utils.log.colored_log.CustomTTYColoredFormatter +airflow_log_format: "[%%(asctime)s] {{ '{' }}%%(filename)s:%%(lineno)d{{ '}' }} %%(levelname)s - %%(message)s" +airflow_simple_log_format: > + %%(asctime)s %%(levelname)s - %%(message)s airflow_task_log_prefix_template: -airflow_log_filename_template: > - "{{ '{{' }} ti.dag_id {{ '}}' }}/{{ '{{' }} ti.task_id {{ '}}' }}/{{ '{{' }} ts {{ '}}' }}/{{ '{{' }} try_number {{ '}}' }}.log" +airflow_log_filename_template: "{{ '{{' }} ti.dag_id {{ '}}' }}/{{ '{{' }} ti.task_id {{ '}}' }}/{{ '{{' }} ts {{ '}}' }}/{{ '{{' }} try_number {{ '}}' }}.log" airflow_log_processor_filename_template: "{{ '{{' }} filename {{ '}}' }}.log" airflow_dag_processor_manager_log_location: "{{ airflow_logs_folder }}/dag_processor_manager/dag_processor_manager.log" -airflow_task_log_reader: "task" +airflow_task_log_reader: task airflow_extra_loggers: # [metrics] # STASTD -airflow_statsd_on: false +airflow_statsd_on: False airflow_statsd_host: localhost airflow_statsd_port: 8125 airflow_statsd_prefix: airflow @@ -200,7 +199,7 @@ airflow_smtp_user: airflow_smtp_passwd: # [sentry] -airflow_sentry_on: false +airflow_sentry_on: False airflow_sentry_dsn: # [celery_kubernetes_executor] @@ -298,9 +297,8 @@ airflow_admin_connections: [] # [elasticsearch] airflow_elasticsearch_host: -airflow_elasticsearch_log_id_template: > - "{dag_id}-{task_id}-{execution_date}-{try_number}" -airflow_elasticsearch_end_of_log_mark: "end_of_log" +airflow_elasticsearch_log_id_template: "{{ '{' }}dag_id{{ '}' }}-{{ '{' }}task_id{{ '}' }}-{{ '{' }}execution_date{{ '}' }}-{{ '{' }}try_number{{ '}' }}" +airflow_elasticsearch_end_of_log_mark: end_of_log airflow_elasticsearch_frontend: airflow_elasticsearch_write_stdout: False airflow_elasticsearch_json_format: False @@ -339,10 +337,9 @@ airflow_kubernetes_git_branch: airflow_kubernetes_git_user: airflow_kubernetes_git_password: airflow_kubernetes_git_subpath: -airflow_kubernetes_git_sync_container_repository: > - "gcr.io/google-containers/git-sync-amd64" -airflow_kubernetes_git_sync_container_tag: "v2.0.5" -airflow_kubernetes_git_sync_init_container_name: "git-sync-clone" +airflow_kubernetes_git_sync_container_repository: gcr.io/google-containers/git-sync-amd64 +airflow_kubernetes_git_sync_container_tag: v2.0.5 +airflow_kubernetes_git_sync_init_container_name: git-sync-clone airflow_kubernetes_worker_service_account_name: airflow_kubernetes_image_pull_secrets: airflow_kubernetes_gcp_service_account_keys: @@ -361,7 +358,7 @@ airflow_sensors_enabled: NamedHivePartitionSensor # - airflow.contrib.auth.backends.ldap_auth # - airflow.contrib.auth.backends.github_enterprise_auth # - others? :) -airflow_webserver_authenticate: false +airflow_webserver_authenticate: False airflow_webserver_auth_backend: # [LDAP] (only applies if airflow_webserver_auth_backend == "airflow.contrib.auth.backends.ldap_auth") @@ -382,8 +379,8 @@ airflow_mesos_master_host: localhost:5050 airflow_mesos_framework_name: Airflow airflow_mesos_task_cpu: 1 airflow_mesos_task_memory: 256 -airflow_mesos_checkpoint: false -airflow_mesos_authenticate: false +airflow_mesos_checkpoint: False +airflow_mesos_authenticate: False # DEPRECATED airflow_s3_log_folder: diff --git a/tasks/config.yml b/tasks/config.yml index bfe5ccf..6fe2522 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -19,6 +19,7 @@ mode: 0644 owner: root group: root + tags: airflow-gunicorn-logrotate - name: Airflow | Copy webserver_config.py file template: @@ -34,6 +35,7 @@ - restart airflow-scheduler - restart airflow-worker - restart airflow-flower + tags: airflow-webserver-config-py - name: Airflow | Copy basic airflow config file (< 2.0) template: @@ -49,6 +51,7 @@ - restart airflow-scheduler - restart airflow-worker - restart airflow-flower + tags: airflow-cfg - name: Airflow | Copy basic airflow config file (>= 2.0) template: @@ -64,13 +67,12 @@ - restart airflow-scheduler - restart airflow-worker - restart airflow-flower + tags: airflow-cfg - name: Airflow | Initializing DB < 2.0 command: "{{ airflow_executable }} initdb" become: true become_user: "{{ airflow_user }}" - tags: - skip_ansible_lint when: - airflow_version is version( '2.0.0', '<') - (airflow_install.changed or airflow_config.changed) @@ -79,6 +81,9 @@ - restart airflow-scheduler - restart airflow-worker - restart airflow-flower + tags: + - airflow-db-init + - skip_ansible_lint - name: Airflow | Initializing DB > 2.0 command: "{{ airflow_executable }} db init" @@ -92,6 +97,7 @@ - restart airflow-scheduler - restart airflow-worker - restart airflow-flower + tags: airflow-db-init - name: Airflow | Copy extra airflow config files (provided by playbooks) copy: @@ -107,6 +113,7 @@ - restart airflow-scheduler - restart airflow-worker - restart airflow-flower + tags: airflow-extra-config - name: Airflow | Copy extra airflow config templates (provided by playbooks) template: @@ -122,6 +129,7 @@ - restart airflow-scheduler - restart airflow-worker - restart airflow-flower + tags: airflow-extra-config - name: Airflow | Add variables from configuration file command: "{{ airflow_executable }} variables -s {{ item.key }} {{ item.value }}" @@ -129,7 +137,8 @@ become_user: "{{ airflow_user }}" with_items: "{{ airflow_admin_variables }}" tags: - skip_ansible_lint + - skip_ansible_lint + - airflow-extra-vars-file - name: Airflow | Add connections from configuration file command: "{{ airflow_executable }} connections -a \ @@ -139,4 +148,5 @@ become_user: "{{ airflow_user }}" with_items: "{{ airflow_admin_connections }}" tags: - skip_ansible_lint + - skip_ansible_lint + - airflow-extra-conn-file diff --git a/templates/airflow-environment-file.j2 b/templates/airflow-environment-file.j2 index 63c3deb..4ac9265 100644 --- a/templates/airflow-environment-file.j2 +++ b/templates/airflow-environment-file.j2 @@ -23,7 +23,7 @@ SCHEDULER_RUNS={{ airflow_scheduler_runs }} AIRFLOW_HOME={{ airflow_app_home }} AIRFLOW_CONFIG={{ airflow_conf_path }}/airflow.cfg -PATH=$PATH:{{ airflow_app_home }}/bin +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:{{ airflow_app_home }}/bin HOSTALIASES=/etc/host.aliases diff --git a/templates/airflow2.cfg.j2 b/templates/airflow2.cfg.j2 index 7b14c05..be974c4 100644 --- a/templates/airflow2.cfg.j2 +++ b/templates/airflow2.cfg.j2 @@ -254,8 +254,8 @@ logging_config_class = {{ airflow_logging_config_class }} colored_console_log = {{ airflow_colored_console_log }} # Log format for when Colored logs is enabled -colored_log_format = {{ colored_log_format }} -colored_formatter_class = {{ colored_formatter_class }} +colored_log_format = {{ airflow_colored_log_format }} +colored_formatter_class = {{ airflow_colored_formatter_class }} # Format of Log line log_format = {{ airflow_log_format }} @@ -312,7 +312,7 @@ statsd_datadog_tags = {{ airflow_statsd_datadog_tags }} # If you want to utilise your own custom Statsd client set the relevant # module path below. # Note: The module path must exist on your PYTHONPATH for Airflow to pick it up -statsd_custom_client_path = {{ airflow_statsd_custom_client_path }} +{% if airflow_statsd_custom_client_path %}statsd_custom_client_path = {{ airflow_statsd_custom_client_path }}{% endif %} [secrets] # Full class name of secrets backend to enable (will precede env vars and metastore in search path) @@ -408,7 +408,7 @@ default_hive_mapred_queue = {{ airflow_default_hive_mapred_queue }} # Template for mapred_job_name in HiveOperator, supports the following named parameters # hostname, dag_id, task_id, execution_date -mapred_job_name_template = {{ airflow_mapred_job_name_template }} +{% if airflow_mapred_job_name_template %}mapred_job_name_template = {{ airflow_mapred_job_name_template }}{% endif %} [webserver] # The base url of your website as airflow cannot guess what domain or @@ -474,7 +474,7 @@ error_logfile = {{ airflow_webserver_error_logfile }} # Access log format for gunicorn webserver. # default format is %%(h)s %%(l)s %%(u)s %%(t)s "%%(r)s" %%(s)s %%(b)s "%%(f)s" "%%(a)s" # documentation - https://docs.gunicorn.org/en/stable/settings.html#access-log-format -access_logformat = {{ airflow_webserver_access_logformat }} +access_logformat = {% if airflow_webserver_access_logformat %}{{ airflow_webserver_access_logformat }}{% endif %} # Expose the configuration file in the web server expose_config = {{ airflow_webserver_expose_config }} From 2b16e19ffddf1ea63dc909585846c52d5dbc9221 Mon Sep 17 00:00:00 2001 From: David Mateo Date: Thu, 15 Apr 2021 10:46:39 +0200 Subject: [PATCH 2/3] Update CHANGELOG --- CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9bd77a..9c4fe67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,23 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch ## [Unreleased](https://github.com/idealista/airflow-role/tree/develop) +[Full Changelog](https://github.com/idealista/airflow-role/compare/2.0.0...bugfix/broken-features-release-2.0.0) + +### Changed + +- :arrows_clockwise: Update missing vars in cfg (v2) template +- :arrows_clockwise: Update conditionally vars missing or unnecesary in cfg (v2) template + +### Fixed + +- :hammer_and_wrench: Fix environment template PATH +- :hammer_and_wrench: Fix wrong typed and escaped log options in airflow-cfg.yaml group_vars + +### Added + +- :heavy_plus_sign: tags for config files related +- :broom: Clean airflow-cfg.yml with bad format values and unnecesary quotation + ## [2.0.0](https://github.com/idealista/airflow-role/tree/2.0.0) [Full Changelog](https://github.com/idealista/airflow-role/compare/1.8.4...2.0.0) From 81ad4971f7c38d4fe3273db6e006f2ab3f1cc016 Mon Sep 17 00:00:00 2001 From: David Mateo Date: Thu, 15 Apr 2021 12:08:54 +0200 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c4fe67..cc66856 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a changelog](https://github.com/olivierlacan/keep-a-changelog). ## [Unreleased](https://github.com/idealista/airflow-role/tree/develop) + -[Full Changelog](https://github.com/idealista/airflow-role/compare/2.0.0...bugfix/broken-features-release-2.0.0) +## [2.0.1](https://github.com/idealista/airflow-role/tree/2.0.1) + +[Full Changelog](https://github.com/idealista/airflow-role/compare/2.0.0...2.0.1) ### Changed @@ -14,8 +17,8 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a ch ### Fixed -- :hammer_and_wrench: Fix environment template PATH -- :hammer_and_wrench: Fix wrong typed and escaped log options in airflow-cfg.yaml group_vars +- :hammer_and_wrench: Fix environment template PATH โžก๏ธ [#96](https://github.com/idealista/airflow-role/issues/96) [BUG] Servie PATH environment not working as expected +- :hammer_and_wrench: Fix wrong typed and escaped log options in airflow-cfg.yaml group_vars โžก๏ธ [#95](https://github.com/idealista/airflow-role/issues/95) [BUG] Tasks Log view is broken ### Added