Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Tech x Marketing #4 Airflowでもサブワークフロー単位で分割開発したい!

Tech x Marketing #4 Airflowでもサブワークフロー単位で分割開発したい!

Naoki Matsuda

August 27, 2020
Tweet

More Decks by Naoki Matsuda

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ - ໊લɿদా ௚थ (·ͭͩ ͳ͓͖) - ॴଐɿגࣜձࣾ ి௨σδλϧ (2018೥ೖࣾ)

    - ۀ຿ɿόοΫΤϯυαʔϏεAPI࣮૷ ETLߏஙͳͲ (࢖༻ݴޠɿGo / Python) - ֶੜ࣌୅ɿےܹࢗ࣌ͷΤωϧΪʔফඅ/࢈ੜͷݚڀ AirflowͷTalk & Blogࣥචɿ - ৽ถPythonista͕ଃΔAirflowೖ໳&׆༻ࣄྫ঺հ(PyConJP2019) - AirflowͷλεΫ࣮ߦ؀ڥΛ෼཭͢Δ(DentsuDigital Tech Blog)
  2. Apache Airflowͱ͸ - DAGɿTaskͷ࣮ߦॱংΛܾఆ͢Δάϥϑ - OperatorɿςϯϓϨʔτԽ͞Ε࣮ͨߦ୯Ґ - Taskɿύϥϝʔλ͕༩͑ΒΕͨOperator Operators (Python,

    HTTP, MySQL, KubernetesPod…) A B C D https://www.slideshare.net/potix2_jp/airflow-224004058 DAG - Taskґଘؔ܎ɿ >> Ͱఆٛ ྫ) A >> [B, C] >> D Task
  3. ·ͱΊ - ػೳͷҟͳΔϑϩʔͰߏ੒͞ΕΔDAG͸઀ଓઌ΋༷ʑͳͷͰ1ਓͰ͸େมͳ ৔߹͕͋ͬͨ - λεΫΛ࡞Δؔ਺Λ༻͍ͯαϒϫʔΫϑϩʔ୯ҐͰϑΝΠϧ෼ׂͰ͖։ൃ͕ ָʹͳΓ·ͨ͠ - αϒϫʔΫϑϩʔͷ࠷ॳͱ࠷ޙͷλεΫΛ͔ͭͬͯґଘؔ܎ఆٛ -

    αϒϫʔΫϑϩʔؒґଘؔ܎ఆٛͰ͸αϒϫʔΫϑϩʔͷத਎͸ϒϥοΫϘοΫεʹͰ͖Δ - UIͷGraph viewͰDAGશମΛݟΔͱ͖ʹগ͠ݟ௨͕͠ѱ͍͔΋ʁ - SubDagͰ͋Ε͹·ͱΊͯදࣔͯ͘͠ΕΔ
  4. TriggerDagRunOperator / ExternalTaskSensor Α͍఺ - Trigger΍SensorͰґଘؔ܎ΛఆٛՄೳ - (ผͷDAGͱͯ͠)ϑΝΠϧΛ෼཭Մೳ Α͘ͳ͍఺ -

    DAGؒͷґଘؔ܎͕UI্ͰՄࢹԽ͞Εͳ͍ - αϒϫʔΫϑϩʔ͝ͱʹDAG࡞੒ʹͳΔ task 1-1 sensor task 2-1 task 2-2 DAG 1 DAG 2 DAG 1 DAG 2 trigger