{"id":291799,"date":"2019-07-08T15:02:57","date_gmt":"2019-07-08T15:02:57","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=291799"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=291799","title":{"rendered":"\u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 Airflow \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f Spark-\u0434\u0436\u043e\u0431\u0430\u043c\u0438 \u0432 ivi: \u043d\u0430\u0434\u0435\u0436\u0434\u044b \u0438 \u043a\u043e\u0441\u0442\u044b\u043b\u0438"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u0417\u0430\u0434\u0430\u0447\u0430 \u0434\u0435\u043f\u043b\u043e\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d \u2014 \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u043e\u043b\u044c \u0438 \u0441\u0442\u0440\u0430\u0434\u0430\u043d\u0438\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u043e \u0432\u044b\u043b\u0435\u0437\u0430\u0442\u044c \u0438\u0437 \u0443\u044e\u0442\u043d\u043e\u0433\u043e jupyter notebook \u0432 \u043c\u0438\u0440 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0438 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438.<\/p>\n<p>  \u041c\u044b \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b\u0438 \u043f\u0440\u043e <a href=\"https:\/\/habr.com\/ru\/company\/ivi\/blog\/351176\/\">\u043f\u0435\u0440\u0432\u0443\u044e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430<\/a> \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0438\u043d\u043e\u0442\u0435\u0430\u0442\u0440\u0430 ivi. \u0417\u0430 \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0439 \u0433\u043e\u0434 \u043c\u044b \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0434\u043e\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u0437\u0434 \u0441 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 python 2.7 \u0438 python 3.4 \u043d\u0430 \u00ab\u0441\u0432\u0435\u0436\u0438\u0439\u00bb python 3.6), \u0437\u0430\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u0445 ML \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u0441\u0440\u0430\u0437\u0443 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u043d\u0430\u0448 \u043e\u043f\u044b\u0442 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043a\u0430\u043a Apache Airflow: \u043f\u043e\u0447\u0435\u043c\u0443 \u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u044d\u0442\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c, \u0447\u0435\u043c \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u0430\u043a\u0438\u0435 \u043a\u043e\u0441\u0442\u044b\u043b\u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0438\u043b\u0438\u0442\u044c \u043f\u043e \u0434\u043e\u0440\u043e\u0433\u0435 \u0438 \u0447\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>  \u2192 \u0412\u0438\u0434\u0435\u043e-\u0432\u0435\u0440\u0441\u0438\u044e \u0434\u043e\u043a\u043b\u0430\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u044e\u0442\u0443\u0431\u0435 (\u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 03:00:00) <a href=\"https:\/\/youtu.be\/LQBVJ9iukG4?t=10815\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/company\/ivi\/blog\/456630\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qc\/bw\/tt\/qcbwttjzivyzuedihk88u6nwn5o.png\"><\/div>\n<p><\/a><br \/>  <a name=\"habracut\"><\/a><\/p>\n<h2><font color=\"#fd004c\">\u041a\u043e\u043c\u0430\u043d\u0434\u0430 Hydra<\/font><\/h2>\n<p>  \u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0435: ivi \u2014 \u044d\u0442\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u0442\u044b\u0441\u044f\u0447 \u0435\u0434\u0438\u043d\u0438\u0446 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430, \u0443 \u043d\u0430\u0441 \u043e\u0434\u0438\u043d \u0438\u0437 \u043a\u0440\u0443\u043f\u043d\u0435\u0439\u0448\u0438\u0445 \u043b\u0435\u0433\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \u0432 \u0440\u0443\u043d\u0435\u0442\u0435. \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 web-\u0432\u0435\u0440\u0441\u0438\u0438 ivi \u2014 \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043d\u0430\u0440\u0435\u0437\u043a\u0430 \u0438\u0437 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u0437\u0432\u0430\u043d\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0441\u0430\u043c\u044b\u0439 \u0441\u043e\u0447\u043d\u044b\u0439, \u0441\u0430\u043c\u044b\u0439 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0435\u043d\u0442, \u043e\u0441\u043d\u043e\u0432\u044b\u0432\u0430\u044f\u0441\u044c \u043d\u0430 \u0435\u0433\u043e \u0444\u0438\u0434\u0431\u044d\u043a\u0435 (\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430\u0445, \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430\u0445 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435).<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vj\/-g\/nh\/vj-gnheaviq-z7tibuzawo-qdqs.png\"><\/div>\n<p>  \u041e\u043d\u043b\u0430\u0439\u043d-\u0447\u0430\u0441\u0442\u044c \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0431\u044d\u043a\u0435\u043d\u0434\u043e\u0432\u043e\u0435 Flask-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u0434\u043e 600 RPS. \u0412 \u043e\u0444\u0444\u043b\u0430\u0439\u043d\u0435 \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0431\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043c \u043d\u0430 250 \u043c\u0438\u043b\u043b\u0438\u043e\u043d\u0430\u0445 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430\u0445 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0437\u0430 \u043c\u0435\u0441\u044f\u0446. \u041f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043d\u0430 Spark, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u043e\u0432\u0435\u0440\u0445 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 Hive.<\/p>\n<p>  \u0412 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u0441\u0435\u0439\u0447\u0430\u0441 7 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u0435\u0439, \u0442\u0430\u043a \u0438 \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435\u043c \u0438\u0445 \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d \u2014 \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<h2><font color=\"#fd004c\">\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043e\u0444\u0444\u043b\u0430\u0439\u043d-\u0447\u0430\u0441\u0442\u0438<\/font><\/h2>\n<p>  \u041d\u0438\u0436\u0435 \u0432\u044b \u0432\u0438\u0434\u0438\u0442\u0435 \u0441\u0445\u0435\u043c\u0443 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b. <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xs\/10\/nv\/xs10nvc8r3mz9bd8osjrn6sqn3u.png\"><\/div>\n<p>  \u0422\u0443\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044b \u0434\u0432\u0430 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 Hive \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0444\u0438\u0434\u0431\u044d\u043a\u0430 (\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u044b, \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0438) \u0438 Postgres \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0439 \u0431\u0438\u0437\u043d\u0435\u0441-\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 (\u0442\u0438\u043f\u044b \u043c\u043e\u043d\u0435\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430 \u0438 \u043f\u0440\u043e\u0447\u0435\u0435), \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430\u043b\u0430\u0436\u0435\u043d\u0430 \u043f\u0435\u0440\u0435\u043b\u0438\u043b\u0438\u0432\u043a\u0430 \u0438\u0437 Postgres \u0432 Hive. \u041f\u0430\u0447\u043a\u0430 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0432\u044b\u0441\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 Hive: \u0438 \u043e\u0431\u0443\u0447\u0430\u0435\u0442 \u043d\u0430 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430\u0448\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 (ALS \u0434\u043b\u044f \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0446\u0438\u0439, \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043a\u043e\u043b\u043b\u0430\u0431\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0435 \u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u0445\u043e\u0436\u0435\u0441\u0442\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430).<\/p>\n<p>  Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u043b\u0438\u0441\u044c \u0441 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c hydra-updater \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0432\u044f\u0437\u043a\u0438 cron+shell-\u0441\u043a\u0440\u0438\u043f\u0442. \u042d\u0442\u0430 \u0441\u0432\u044f\u0437\u043a\u0430 \u0431\u044b\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0432 \u043e\u0442\u0434\u0435\u043b\u0435 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 ivi \u0432 \u043d\u0435\u0437\u0430\u043f\u0430\u043c\u044f\u0442\u043d\u044b\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0430 \u0438 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430. Shell-\u0441\u043a\u0440\u0438\u043f\u0442 \u044f\u0432\u043b\u044f\u043b\u0441\u044f \u0435\u0434\u0438\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 \u0432\u0445\u043e\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u2014 \u0442\u043e \u0435\u0441\u0442\u044c \u043a\u0430\u0436\u0434\u0430\u044f \u043d\u043e\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u043b\u0430 \u043a\u0440\u0443\u0442\u0438\u0442\u044c\u0441\u044f \u0432 \u043f\u0440\u043e\u0434\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0430\u0434\u043c\u0438\u043d\u044b \u0434\u043e\u043f\u0438\u043b\u044f\u0442 \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442.<\/p>\n<p>  \u0427\u0430\u0441\u0442\u044c \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 HDFS \u043d\u0430 \u0432\u0435\u0447\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 (\u0438 \u0436\u0434\u0451\u0442, \u043f\u043e\u043a\u0430 \u0438\u0445 \u043e\u0442\u0442\u0443\u0434\u0430 \u043a\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0441\u043a\u0430\u0447\u0430\u0435\u0442 \u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0451\u0442 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0433\u0434\u0435 \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u043e\u043d\u043b\u0430\u0439\u043d-\u0447\u0430\u0441\u0442\u044c) \u0430 \u0447\u0430\u0441\u0442\u044c \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u0438\u0437 Spark-\u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0432 \u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 Redis, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u0430\u043a \u043e\u0431\u0449\u0443\u044e \u043f\u0430\u043c\u044f\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 python-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u043e\u043d\u043b\u0430\u0439\u043d-\u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>  \u0423 \u0442\u0430\u043a\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043d\u0430\u043a\u043e\u043f\u0438\u043b\u0441\u044f \u0440\u044f\u0434 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432:<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ri\/x2\/b0\/rix2b0qjxi1qa0igp-bpl23bn04.png\"><\/div>\n<p>  \u041d\u0430 \u0441\u0445\u0435\u043c\u0435 \u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u0442\u043e\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u043c\u0435\u044e\u0442 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0438 \u0437\u0430\u043f\u0443\u0442\u0430\u043d\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u2014 \u0431\u0435\u0437 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u0442\u0438\u043c \u0434\u043e\u0431\u0440\u043e\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0438 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u044f \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u044f\u0442\u0441\u044f \u0432 \u0443\u0436\u0430\u0441, \u0442\u043b\u0435\u043d \u0438 \u0441\u0442\u0440\u0430\u0434\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438, \u0430\u0434\u043c\u0438\u043d\u0441\u043a\u0438\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u0435\u043b\u0430\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439: \u0440\u0435\u0441\u0442\u0430\u0440\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0430 \u0431\u043e\u044e, \u0434\u0430\u043c\u043f Redis \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0448\u0442\u0443\u043a\u0438. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0437\u0430 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0435\u0440\u0438\u043e\u0434 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u0441\u043a\u0440\u0438\u043f\u0442 \u043e\u0431\u0440\u043e\u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u043a\u0430\u0436\u0434\u0430\u044f \u043d\u043e\u0432\u0430\u044f \u043d\u0430\u0448\u0430 \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u043e\u0440\u043e\u0436\u0434\u0430\u043b\u0430 \u043f\u0430\u0440\u0443 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u0432 \u043d\u0435\u043c. \u0421\u043a\u0440\u0438\u043f\u0442 \u0441\u0442\u0430\u043b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u043c \u043f\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u043a\u0443\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0447\u0430\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438. \u0414\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u043c\u044b \u0438 \u0440\u0435\u0448\u0438\u043b\u0438 \u0437\u0430\u044e\u0437\u0430\u0442\u044c Airflow. <\/p>\n<h2><font color=\"#fd004c\">\u041a\u043e\u0441\u0442\u044b\u043b\u0438 \u0434\u043b\u044f Airflow<\/font><\/h2>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u044d\u0442\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u043e \u0434\u043e\u0440\u043e\u0433\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u0435\u0431\u0435 \u043d\u043e\u0432\u044b\u0445 \u2014 \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0435 Airflow \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u043e\u043c \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u044b\u043c.<\/p>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0442\u0440\u0443\u0434\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0441\u044e \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u043d\u0430\u0441 \u0431\u044b \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u044b\u0432\u0430\u0442\u044c \u043d\u0438\u043a\u0442\u043e \u043d\u0435 \u0441\u0442\u0430\u043b, \u0442.\u043a. devops-\u0440\u0435\u0441\u0443\u0440\u0441 \u2014 \u0448\u0442\u0443\u043a\u0430 \u0434\u0435\u0444\u0438\u0446\u0438\u0442\u043d\u0430\u044f. \u041f\u043e \u044d\u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c Airflow, \u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u0447\u0442\u043e \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0437\u0430\u043f\u0438\u043b\u0438\u0432\u0430\u043d\u0438\u044f \u201c\u0441 \u043d\u0443\u043b\u044f\u201d.<\/p>\n<p>  \u042f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u0431\u043e\u043b\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f, \u0438 \u043a\u043e\u0441\u0442\u044b\u043b\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0438\u043b\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0437\u0430\u0432\u0435\u0441\u0442\u0438 Airflow. <\/p>\n<p>  <b>\u041f\u0435\u0440\u0432\u0430\u044f \u0438 \u0433\u043b\u0430\u0432\u043d\u0430\u044f \u0431\u043e\u043b\u044c<\/b>: \u043a\u0430\u043a \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c Airflow \u0432 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 shell-\u0441\u043a\u0440\u0438\u043f\u0442 \u043e\u0442\u0434\u0435\u043b\u0430 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u0422\u0443\u0442 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0441\u0430\u043c\u043e\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435 \u2014 \u043c\u044b \u0441\u0442\u0430\u043b\u0438 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0438\u0442\u044c \u0433\u0440\u0430\u0444\u044b \u043f\u0440\u044f\u043c\u043e \u0438\u0437 shell-\u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0438\u043d\u0430\u0440\u043d\u0438\u043a\u0430 airflow c \u043a\u043b\u044e\u0447\u043e\u043c trigger_dag. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043c\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0448\u0435\u0434\u0443\u043b\u0435\u0440 Airflow \u0438 \u043f\u043e \u0441\u0443\u0442\u0438 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0451 \u0442\u0435\u043c \u0436\u0435 \u043a\u0440\u043e\u043d\u043e\u043c \u2014 \u044d\u0442\u043e \u0440\u0435\u043b\u0438\u0433\u0438\u043e\u0437\u043d\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. \u0417\u0430\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0431\u0435\u0441\u0448\u043e\u0432\u043d\u0443\u044e \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044e \u0441 \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c. \u0412\u043e\u0442 \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0442\u0430\u0440\u0442 \u0438\u0437 shell-\u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u0433\u043b\u0430\u0432\u043d\u043e\u0433\u043e Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u0442\u043e\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f hydramatrices.<\/p>\n<pre><code class=\"bash\">    log \"$FUNCNAME started\"     local RETVAL=0      export AIRFLOW_CONFIG=\/opt\/airflow\/airflow.cfg     AIRFLOW_API=api\/dag_last_run\/hydramatrices\/all     log \"run \/var\/www\/airflow\/bin\/airflow trigger_dag hydramatrices\"     \/var\/www\/airflow\/bin\/airflow trigger_dag hydramatrices 2&gt;&amp;1 | tee -a $LOGFILE <\/code><\/pre>\n<p>  <b>\u0411\u043e\u043b\u044c:<\/b> Shell-\u0441\u043a\u0440\u0438\u043f\u0442 \u043e\u0442\u0434\u0435\u043b\u0430 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u0434\u043e\u043b\u0436\u0435\u043d \u043a\u0430\u043a-\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 Airflow-\u0433\u0440\u0430\u0444\u0430, \u0447\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043f\u043e\u0442\u043e\u043a\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u041a\u043e\u0441\u0442\u044b\u043b\u044c: \u043c\u044b \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043b\u0438 Airflow REST API \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u043e\u043c \u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 DAG \u043f\u0440\u044f\u043c\u043e \u0432\u043d\u0443\u0442\u0440\u0438 shell-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432. \u0422\u0435\u043f\u0435\u0440\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0433\u0440\u0430\u0444 \u0438\u043c\u0435\u0435\u0442 \u0442\u0440\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f: RUNNING, SUCCEED, FAILED.<\/p>\n<p>  \u041f\u043e \u0441\u0443\u0442\u0438 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0432 Airflow \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e \u043e\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u0431\u0435\u0433\u0443\u0449\u0438\u0439 \u0433\u0440\u0430\u0444: \u043f\u0443\u043b\u044f\u0435\u043c GET-\u0437\u0430\u043f\u0440\u043e\u0441, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0441\u044f DAG, \u0438\u043b\u0438 \u043d\u0435\u0442. \u041a\u043e\u0433\u0434\u0430 \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u043e\u0431 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0438 \u0433\u0440\u0430\u0444\u0430, shell-\u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430.<br \/>  \u0425\u043e\u0447\u0435\u0442\u0441\u044f \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e Airflow REST API \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0433\u043d\u0435\u043d\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0433\u0438\u0431\u043a\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u043b\u043e\u0432\u0430\u0442\u044c \u0432\u0430\u0448\u0438 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0433\u0440\u0430\u0444\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u043a\u0438\u0434\u044b\u0432\u0430\u0442\u044c POST-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b.<\/p>\n<p>  \u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 API Airflow \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u0438\u0439 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">import json import os  from airflow import settings from airflow.models import DagBag, DagRun from flask import Blueprint, request, Response  airflow_api_blueprint = Blueprint('airflow_api', __name__, url_prefix='\/api') AIRFLOW_DAGS = '{}\/dags'.format(     os.path.dirname(os.path.dirname(os.path.abspath(__file__))) )   class ApiResponse:     \"\"\"\u041a\u043b\u0430\u0441\u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043d\u0430 GET \u0437\u0430\u043f\u0440\u043e\u0441\u044b\"\"\"      STATUS_OK = 200     STATUS_NOT_FOUND = 404      def __init__(self):         pass      @staticmethod     def standard_response(status: int, payload: dict) -&gt; Response:         json_data = json.dumps(payload)         resp = Response(json_data, status=status, mimetype='application\/json')         return resp      def success(self, payload: dict) -&gt; Response:         return self.standard_response(self.STATUS_OK, payload)      def error(self, status: int, message: str) -&gt; Response:         return self.standard_response(status, {'error': message})      def not_found(self, message: str = 'Resource not found') -&gt; Response:         return self.error(self.STATUS_NOT_FOUND, message) <\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c API \u0432 shell-\u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u2014 \u043e\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442 \u043a\u0430\u0436\u0434\u044b\u0435 10 \u043c\u0438\u043d\u0443\u0442:<\/p>\n<pre><code class=\"bash\">    TRIGGER=$?     [ \"$TRIGGER\" -eq \"0\" ] &amp;&amp; log \"trigger airflow DAG succeeded\" || { log \"trigger airflow DAG failed\"; return 1; }      CMD=\"curl -s http:\/\/$HYDRA_SERVER\/$AIRFLOW_API | jq .dag_last_run.state\"     STATE=$(eval $CMD)      while [ $STATE == \\\"running\\\" ]; do         log \"Generating matrices in progress...\"         sleep 600         STATE=$(eval $CMD)     done      [ $STATE == \\\"success\\\" ] &amp;&amp; RETVAL=0 || RETVAL=1     [ $RETVAL -eq 0 ] &amp;&amp; log \"$FUNCNAME succeeded\" || log \"$FUNCNAME failed\"     return $RETVAL <\/code><\/pre>\n<p>  <b>\u0411\u043e\u043b\u044c<\/b>: \u0435\u0441\u043b\u0438 \u0432\u044b \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u043b\u0438 Spark-\u0434\u0436\u043e\u0431\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e spark-submit \u0432 cluster-\u0440\u0435\u0436\u0438\u043c\u0435, \u0442\u043e \u0432\u044b \u0437\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e \u043b\u043e\u0433\u0438 \u0432 STDOUT \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0435\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u0443\u044e \u043f\u0440\u043e\u0441\u0442\u044b\u043d\u044e \u0441\u043e \u0441\u0442\u0440\u043e\u0447\u043a\u0430\u043c\u0438 \u201cSPARK APPLICATION_ID IS RUNNING\u201d. \u041b\u043e\u0433\u0438 \u0441\u0430\u043c\u043e\u0433\u043e Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b yarn logs. \u0412 shell-\u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0440\u0435\u0448\u0430\u043b\u0430\u0441\u044c \u043f\u0440\u043e\u0441\u0442\u043e: \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u043b\u0441\u044f SSH-\u0442\u0443\u043d\u043d\u0435\u043b\u044c \u0434\u043e \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043c\u0430\u0448\u0438\u043d \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 spark-submit \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0441\u044f \u0432 client-\u0440\u0435\u0436\u0438\u043c\u0435 \u044d\u0442\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432 STDOUT \u0431\u0443\u0434\u0443\u0442 \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0435 \u0438 \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0435 \u043b\u043e\u0433\u0438. \u0412 Airflow \u043c\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c cluster-\u0440\u0435\u0448\u0438\u043c \u0438 \u0442\u0430\u043a\u043e\u0439 \u043d\u043e\u043c\u0435\u0440 \u0443\u0436\u0435 \u043d\u0435 \u043f\u0440\u043e\u0439\u0434\u0451\u0442.<\/p>\n<p>  \u041a\u043e\u0441\u0442\u044b\u043b\u044c: \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a spark-submit \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0442\u044f\u043d\u0435\u043c \u043b\u043e\u0433\u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u0430 \u0438\u0437 HDFS \u043f\u043e application_id \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 Airflow \u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0435\u0440\u0435\u0437 \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u0438\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 print(). \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043c\u0438\u043d\u0443\u0441 \u2014 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 Airflow \u043b\u043e\u0433\u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a spark-submit \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0441\u043b\u0435\u0434\u0438\u0442\u044c \u0437\u0430 \u0434\u0436\u043e\u0431\u043e\u0439 \u0440\u0435\u0430\u043b\u0442\u0430\u0439\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u0445 \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u0435\u0431-\u043c\u043e\u0440\u0434\u0435 YARN.<\/p>\n<pre><code class=\"python\">def get_logs(config: BaseConfig, app_id: str) -&gt; None:     \"\"\"\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u043e\u0433\u0438 \u0441\u043f\u0430\u0440\u043a\u0430      :param config:     :param app_id:     \"\"\"     hdfs = HDFSInteractor(config)      logs_path = '\/tmp\/logs\/{username}\/logs\/{app_id}'.format(username=config.CURRENT_USERNAME, app_id=app_id)     logs_files = hdfs.files_in_folder(logs_path)      logs_files = [file for file in logs_files if file[-4:] != '.tmp']      for file in logs_files:         with hdfs.hdfs_client.read(os.path.join(logs_path, file), encoding='utf-8', delimiter='\\n') as reader:             print_line = False             for line in reader:                 if re.search('stdout', line) and len(line) &gt; 30:                     print_line = True                  if re.search('stderr', line):                     print_line = False                  if print_line:                     print(line) <\/code><\/pre>\n<p>  <b>\u0411\u043e\u043b\u044c<\/b>: \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u043e\u0432 \u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u043e-\u0445\u043e\u0440\u043e\u0448\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0430\u0432\u0435\u0441\u0442\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u043d\u0434 Airflow, \u043d\u043e \u043c\u044b \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043c devops \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u043b\u0433\u043e \u0434\u0443\u043c\u0430\u043b\u0438 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0441\u0440\u0435\u0434\u0443.<\/p>\n<p>  \u041a\u043e\u0441\u0442\u044b\u043b\u044c: \u043c\u044b \u0443\u043f\u0430\u043a\u043e\u0432\u0430\u043b\u0438 Airflow \u0432 \u0434\u043e\u043a\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0430 Dockerfile \u043f\u043e\u043b\u043e\u0436\u0438\u043b\u0438 \u043f\u0440\u044f\u043c\u043e \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0441\u043e \u0441\u043f\u0430\u0440\u043a-\u0434\u0436\u043e\u0431\u0430\u043c\u0438. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u0438\u043b\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 Airflow \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435. \u0412 \u0441\u0438\u043b\u0443 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0432 cluster-mode, \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0434\u043b\u044f \u0434\u043e\u043a\u0435\u0440\u0430 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>  \u0415\u0449\u0435 \u0432\u043d\u0443\u0442\u0440\u044c \u0434\u043e\u043a\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441\u043f\u0440\u044f\u0442\u0430\u043b\u0430\u0441\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0430\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u043f\u0430\u0440\u043a\u0430 \u0438 \u0432\u0441\u044f \u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u2014 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u043e\u0432 \u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f. \u041d\u0438\u0436\u0435 \u044f \u043f\u0440\u0438\u0432\u0435\u043b \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u043c \u0434\u043e\u043a\u0435\u0440\u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0441 Airflow, \u0433\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f Airflow c \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0441\u0440\u0435\u0434\u044b:<\/p>\n<pre><code class=\"bash\">FROM ubuntu:16.04  ARG AIRFLOW_VERSION=1.9.0 ARG AIRFLOW_HOME ARG USERNAME=airflow ARG USER_ID ARG GROUP_ID ARG LOCALHOST ARG AIRFLOW_PORT ARG PIPENV_PATH ARG PROJECT_HYDRAMATRICES_DOCKER_PATH  RUN  apt-get update \\     &amp;&amp; apt-get install -y \\         python3.6 \\         python3.6-dev \\     &amp;&amp; update-alternatives --install \/usr\/bin\/python3 python3.6 \/usr\/bin\/python3.6 0 \\     &amp;&amp; apt-get -y install python3-pip  RUN mv \/root\/.pydistutils.cf \/root\/.pydistutils.cfg RUN pip3 install pandas==0.20.3 \\         apache-airflow==$AIRFLOW_VERSION \\         psycopg2==2.7.5 \\         ldap3==2.5.1 \\         cryptography  # \u0414\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0432\u0441\u0435\u043c\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438 ENV PROJECT_HYDRAMATRICES_DOCKER_PATH=${PROJECT_HYDRAMATRICES_DOCKER_PATH} ENV PIPENV_PATH=${PIPENV_PATH} ENV SPARK_HOME=\/usr\/lib\/spark2 ENV HADOOP_CONF_DIR=$PROJECT_HYDRAMATRICES_DOCKER_PATH\/etc\/hadoop-conf-preprod ENV PYTHONPATH=${SPARK_HOME}\/python\/lib\/py4j-0.10.4-src.zip:${SPARK_HOME}\/python\/lib\/pyspark.zip:${SPARK_HOME}\/python\/lib ENV PIP_NO_BINARY=numpy ENV AIRFLOW_HOME=${AIRFLOW_HOME} ENV AIRFLOW_DAGS=${AIRFLOW_HOME}\/dags ENV AIRFLOW_LOGS=${AIRFLOW_HOME}\/logs ENV AIRFLOW_PLUGINS=${AIRFLOW_HOME}\/plugins  # \u0414\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0433\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u043e\u0432 \u0432 Airflow (log url) BASE_URL=\"http:\/\/${AIRFLOW_CURRENT_HOST}:${AIRFLOW_PORT}\" ;  # \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0430 Airflow ENV AIRFLOW__WEBSERVER__BASE_URL=${BASE_URL} ENV AIRFLOW__WEBSERVER__ENDPOINT_URL=${BASE_URL} ENV AIRFLOW__CORE__AIRFLOW_HOME=${AIRFLOW_HOME} ENV AIRFLOW__CORE__DAGS_FOLDER=${AIRFLOW_DAGS} ENV AIRFLOW__CORE__BASE_LOG_FOLDER=${AIRFLOW_LOGS} ENV AIRFLOW__CORE__PLUGINS_FOLDER=${AIRFLOW_PLUGINS} ENV AIRFLOW__SCHEDULER__CHILD_PROCESS_LOG_DIRECTORY=${AIRFLOW_LOGS}\/scheduler <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f Airflow \u043c\u044b \u0434\u043e\u0441\u0442\u0438\u0433\u043b\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432:<\/p>\n<ul>\n<li>\u0421\u043e\u043a\u0440\u0430\u0442\u0438\u043b\u0438 \u0440\u0435\u043b\u0438\u0437\u043d\u044b\u0439 \u0446\u0438\u043a\u043b: \u0432\u044b\u043a\u0430\u0442\u043a\u0430 \u043d\u043e\u0432\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 (\u0438\u043b\u0438 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445) \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043d\u043e\u0432\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430 Airflow, \u0441\u0430\u043c\u0438 \u0433\u0440\u0430\u0444\u044b \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 \u0438 \u0434\u0435\u043f\u043b\u043e\u044f\u0442\u0441\u044f \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043a\u043e\u0434\u043e\u043c. \u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u0440\u0443\u043a\u0430\u0445 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430. \u0410\u0434\u043c\u0438\u043d\u044b \u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432\u044b, \u043c\u044b \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u0434\u0451\u0440\u0433\u0430\u0435\u043c \u0438\u0445 \u043f\u043e \u043c\u0435\u043b\u043e\u0447\u0430\u043c.<\/li>\n<li>\u041b\u043e\u0433\u0438 Spark-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u043d\u044c\u0448\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u043b\u0438 \u043f\u0440\u044f\u043c\u0438\u043a\u043e\u043c \u0432 \u0430\u0434 \u0442\u0435\u043f\u0435\u0440\u044c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0432 Aiflow \u0441 \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043b\u043e\u0433\u0438 \u0437\u0430 \u043b\u044e\u0431\u043e\u0439 \u0434\u0435\u043d\u044c \u0431\u0435\u0437 \u043a\u043e\u0432\u044b\u0440\u044f\u043d\u0438\u044f \u0432 HDFS-\u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f\u0445.<\/li>\n<li>\u0417\u0430\u0432\u0430\u043b\u0438\u0432\u0448\u0438\u0439\u0441\u044f \u0440\u0430\u0441\u0447\u0451\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0434\u043d\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435, \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e, \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0434\u0430\u0436\u0435 \u0434\u0436\u0443\u043d. <\/li>\n<li>\u041c\u043e\u0436\u043d\u043e \u043f\u0443\u043b\u044f\u0442\u044c \u0441\u043f\u0430\u0440\u043a-\u0434\u0436\u043e\u0431\u044b \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430, \u043d\u0435 \u0443\u043f\u0430\u0440\u044b\u0432\u0430\u044f\u0441\u044c \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 Spark \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0438 \u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432\u044b \u2014 \u0432\u0441\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b spark-submit \u0443\u0436\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u044b \u0432 Dockerfile<\/li>\n<li>\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u043f\u043b\u044e\u0448\u043a\u0438 Aiflow \u2014 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u044f, \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u0443\u043f\u0430\u0432\u0448\u0438\u0445 \u0434\u0436\u043e\u0431\u043e\u0432, \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0435 \u0433\u0440\u0430\u0444\u0438\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u0438 \u043d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u0432).<\/li>\n<\/ul>\n<p>  \u041a\u0443\u0434\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435? \u0421\u0435\u0439\u0447\u0430\u0441 \u0443 \u043d\u0430\u0441 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438 \u0441\u0442\u043e\u043a\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0438\u0441\u043b\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0442\u0438. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043b\u044e\u0431\u043e\u043c \u043a\u043b\u0430\u0441\u0441\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f hydramatrices \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043a\u0440\u0430\u0448\u0443 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0435 (\u0438\u043b\u0438 \u0434\u0430\u0436\u0435 \u0432 \u043e\u043d\u043b\u0430\u0439\u043d-\u0447\u0430\u0441\u0442\u0438):<\/p>\n<ul>\n<li>\u043f\u0435\u0440\u0435\u043b\u0438\u0432\u043a\u0438 Clickhouse \u2192 Hive<\/li>\n<li>\u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0438\u043d\u0433 \u0434\u0430\u043d\u043d\u044b\u0445: Hive \u2192 Hive<\/li>\n<li>\u0434\u0435\u043f\u043b\u043e\u0439 c2c \u043c\u043e\u0434\u0435\u043b\u0435\u0439: Hive \u2192 Redis<\/li>\n<li>\u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u043e\u0432 (\u0432\u0440\u043e\u0434\u0435 \u0442\u0438\u043f\u0430 \u043c\u043e\u043d\u0435\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u043d\u0442\u0435\u043d\u0442\u0430): Postgres \u2192 Redis<\/li>\n<li>\u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0435\u0439: Local FS \u2192 HDFS<\/li>\n<\/ul>\n<p>  \u0412 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u043d\u0430\u043c \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0441\u0442\u0435\u043d\u0434 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u043e\u0432 \u0432 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442 \u0437\u0430\u0442\u0440\u0430\u0442\u044b \u043d\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438, \u0443\u0441\u043a\u043e\u0440\u0438\u0442 \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d \u0438 \u0440\u0435\u0437\u043a\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u044d\u043d\u0434\u043e\u0440\u0444\u0438\u043d\u043e\u0432 \u0443 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u043e\u0432. \u0410 \u0432\u0435\u0434\u044c \u0431\u0435\u0437 Airflow \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0442\u0435\u043d\u0434 \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0430\u0432\u0442\u043e\u0442\u0435\u0441\u0442\u043e\u0432 \u0431\u044b\u043b\u043e \u0431\u044b \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e!<\/p>\n<p>  \u042d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e \u043d\u0430\u0448 \u043e\u043f\u044b\u0442 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f Airflow, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c \u0434\u0440\u0443\u0433\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c \u0432 \u043f\u043e\u0445\u043e\u0436\u0435\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u2014 \u0443 \u0432\u0430\u0441 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u0430 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043d\u043e\u0432\u043e\u0435, \u043c\u043e\u0434\u043d\u043e\u0435 \u0438 \u043c\u043e\u043b\u043e\u0434\u0451\u0436\u043d\u043e\u0435. \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u043e\u044f\u0442\u044c\u0441\u044f \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u2014 \u0442\u0430\u043a\u0438\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u044e\u0442 \u043d\u043e\u0432\u044b\u0435 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u044b \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f.<\/p><\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/ivi\/blog\/456630\/\"> https:\/\/habr.com\/ru\/company\/ivi\/blog\/456630\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\u0417\u0430\u0434\u0430\u0447\u0430 \u0434\u0435\u043f\u043b\u043e\u044f \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d \u2014 \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u043e\u043b\u044c \u0438 \u0441\u0442\u0440\u0430\u0434\u0430\u043d\u0438\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u043e \u0432\u044b\u043b\u0435\u0437\u0430\u0442\u044c \u0438\u0437 \u0443\u044e\u0442\u043d\u043e\u0433\u043e jupyter notebook \u0432 \u043c\u0438\u0440 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0438 \u043e\u0442\u043a\u0430\u0437\u043e\u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u043e\u0441\u0442\u0438.<\/p>\n<p>  \u041c\u044b \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b\u0438 \u043f\u0440\u043e <a href=\"https:\/\/habr.com\/ru\/company\/ivi\/blog\/351176\/\">\u043f\u0435\u0440\u0432\u0443\u044e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430<\/a> \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e\u043d\u043b\u0430\u0439\u043d-\u043a\u0438\u043d\u043e\u0442\u0435\u0430\u0442\u0440\u0430 ivi. \u0417\u0430 \u043f\u0440\u043e\u0448\u0435\u0434\u0448\u0438\u0439 \u0433\u043e\u0434 \u043c\u044b \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0434\u043e\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043b\u0438 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0438\u0437 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0435\u0440\u0435\u0437\u0434 \u0441 \u0443\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0445 python 2.7 \u0438 python 3.4 \u043d\u0430 \u00ab\u0441\u0432\u0435\u0436\u0438\u0439\u00bb python 3.6), \u0437\u0430\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u043e\u0432\u044b\u0445 ML \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0438 \u0441\u0440\u0430\u0437\u0443 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439 \u0432\u044b\u043a\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u043d. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043f\u0440\u043e \u043d\u0430\u0448 \u043e\u043f\u044b\u0442 \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0442\u043e\u043a\u0430\u043c\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447 \u043a\u0430\u043a Apache Airflow: \u043f\u043e\u0447\u0435\u043c\u0443 \u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u044d\u0442\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c, \u0447\u0435\u043c \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u043b\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u0430\u043a\u0438\u0435 \u043a\u043e\u0441\u0442\u044b\u043b\u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u0438\u043b\u0438\u0442\u044c \u043f\u043e \u0434\u043e\u0440\u043e\u0433\u0435 \u0438 \u0447\u0442\u043e \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c.<\/p>\n<p>  \u2192 \u0412\u0438\u0434\u0435\u043e-\u0432\u0435\u0440\u0441\u0438\u044e \u0434\u043e\u043a\u043b\u0430\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u044e\u0442\u0443\u0431\u0435 (\u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 03:00:00) <a href=\"https:\/\/youtu.be\/LQBVJ9iukG4?t=10815\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  <a href=\"https:\/\/habr.com\/ru\/company\/ivi\/blog\/456630\/\"><\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/qc\/bw\/tt\/qcbwttjzivyzuedihk88u6nwn5o.png\"><\/div>\n<p><\/a>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-291799","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=291799"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/291799\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=291799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=291799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=291799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}