Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
digdag-Introduction
Search
Masatoshi Shimada
August 19, 2016
Programming
1
1.3k
digdag-Introduction
Digdagを本番導入したので社内勉強会で発表した資料です。
Masatoshi Shimada
August 19, 2016
Tweet
Share
More Decks by Masatoshi Shimada
See All by Masatoshi Shimada
Delta Lakeを用いた LLM処理基盤 / Delta Lake with LLM on Dataplatform
smdmts
3
6.1k
Lakehouseプラットフォームを 採用するまでの話/Lakehouse Platform Adoption
smdmts
1
810
Sparkから利用するAirframe/Spark-With-Airframe
smdmts
0
1.5k
Redashで何をみるのか/What Do You Wanna See Redash?
smdmts
1
1.5k
DatabricksとSparkではじめる [ビッグデータETL処理/データ可視化] 実践入門 / Databricks and Spark with ETL and Visualization
smdmts
0
1.6k
DatabricksとSparkではじめる [データ分析/機械学習] 実践入門 / Databrick and Spark with Data Analyze and ML for newbie.
smdmts
5
2.2k
作らない分析基板のススメ/DWH For Startup With YAGNI
smdmts
1
720
エンジニアのためのドメイン駆動設計実践入門 / DDD for Engineer newbie
smdmts
18
3.5k
How to growth the delish kitchen team to data-driven team
smdmts
1
1.1k
Other Decks in Programming
See All in Programming
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
270
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
2
390
Exploring: Partial and Independent Composables
blackbracken
0
100
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
210
Go の GC の不得意な部分を克服したい
taiyow
3
790
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
100
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
160
Kaigi on Railsに初参加したら、その日にLT登壇が決定した件について
tama50505
0
100
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
2
110
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Docker and Python
trallard
42
3.1k
Building Applications with DynamoDB
mza
91
6.1k
Scaling GitHub
holman
458
140k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
The Language of Interfaces
destraynor
154
24k
Faster Mobile Websites
deanohume
305
30k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Agile that works and the tools we love
rasmusluckow
328
21k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Transcript
Introduction of Digdag.
Who am I. • Twitter/GitHub Account • @smdmts • Main
Fields • Scala & Java8 & React.js & Python • DDD CleanArchitecture @ akka-http • Workflow • Hive/Presto
Agenda • Digdag = Workflow automation system.
ϫʔΫϑϩʔΤϯδϯͷओͳཁ݅ • ఆظతͳλεΫͷ࣮ߦ • λεΫͷॱ࣮࣍ߦ • γεςϜؒͷσʔλࣗಈ࿈ܞ • όονʹΑΔσʔλूܭͷࣗಈԽ •
όονδϣϒྃޙͷϝʔϧ/SlackͳͲ௨ • ϦτϥΠ࣌ʹ͓͚Δႈੑ
Digdagͱ • DAGʢDirected acyclic graph)Λ࣮ݱ͢ΔϫʔΫϑ ϩʔΤϯδϯ • YAMLͰDAGΛදݱ͢ΔͨΊఆٛମGitཧՄೳ ʢWorkflow as
Codeʣ • LocalϞʔυͰ։ൃ͠ɺClient/ServerϞʔυͰຊ൪ ͰՔಇͤ͞Δ • Python/Ruby/Bash/DockerͳͲͰαϒλεΫ͕࣮ ߦՄೳ
DigdagͱʢClient/ServerϞʔυʣ • PostgreSQLͰQueueΛ࣮ݱ͍ͯ͠Δ • αϒλεΫຖͰQueueԽ͞Ε͓ͯΓαʔόෳ Ͱ࣮ߦڥ͕εέʔϧՄೳ • Workflowͷ࣮ମPostgreSQLʹӬଓԽ͞ΕΔ • Client͕ίϚϯυͰWorkflowΛpush͢Δ
• Workflowੈཧ͞ΕΔ • ࠶ىಈෆཁͰδϣϒొʗ࠶࣮ߦՄೳ
DAG (Directed acyclic graph)ͱ • DAGʢ༗ඇ८ճάϥϑʣͱ ʢwikipedia) άϥϑཧʹ͓͚Δด࿏ͷͳ͍༗άϥϑͷࣄ ༗άϥϑͱ༗ลʢํΛࣔ͢ҹ͖ ͷลʣ͔ΒͳΓɺลಉ࢜Λͭͳ͙͕ɺ͋Δ
v ͔Βग़ൃ͠ɺลΛͨͲΓɺ v ʹͬͯ ͜ͳ͍ͷ͕༗ඇ८ճάϥϑͰ͋Δɻ
DAG (Directed acyclic graph)ͱ • DAGʢ༗ඇ८ճάϥϑʣͱ • తʹݴ͏ͱऴ͕ଘࡏ͠։࢝ʹͬͯ͜ͳ ͍άϥϑ
DigdagͰͷදݱํ๏ • YAMLͰΦϖϨʔλΛఆٛ timezone: UTC _export: mail: ..... # Definition
of mail +step1_input: py>: tasks.load _error: mail>: body.txt subject: input error! to: [
[email protected]
] +step2_process: sh>: echo process. +step2_report: sh>: echo report.
δϣϒϑϩʔߏུ֓ਤ
δϣϒϑϩʔߏུ֓ਤʹ͓͚Δఆٛ timezone: UTC +prepare_load_aws_env: py>: tasks.load_aws_env +step1_produce_tasks: # Generate SQL
Queries for Redshift. !include : 'child_tasks/produce_tasks/bootstrap.dig' +step2_create_redshift_buffer: # Internal S3 or TreasureData to Redshift temporary buffer. !include : 'child_tasks/create_redshift_buffer/bootstrap.dig' +step3_create_publisher_s3: # Create Redshift buffer to publisher s3 bucket. !include : 'child_tasks/create_publisher_s3/bootstrap.dig'
։ൃ/ӡ༻ͯ͠Έͨײ • Workflow͕ίʔυͰදݱ͞Ε σόοά༰қ ͳ ͷͰ ී௨ͷ։ൃͷϊϦ Ͱॱ൪ͱΤϥʔϋϯυϦ ϯάΛҙࣝͨ͠δϣϒΛΧδϡΞϧʹ࡞Εͨ •
Πϯετʔϧͷ؆қੑɺ࠶ىಈෆཁͷδϣϒ࠶ ొʗ࣮ߦՄೳͳͲɺಋೖ/։ൃ/ӡ༻ָ͕ʹͳΔ ͜ͱ͕ҙࣝͯ͠ઃܭ͞Ε͍ͯΔҹ • ࣮ߦॱংɺฒྻԽɺΤϥʔϋϯυϦϯάͷ੍ޚ͕ ඇৗʹ༰қͳҝɺશόονܥΛDigdagʹҠ͢Δ ࣄΛܾఆ
։ൃ࣌ʹൃੜͨ͠/՝ • py operatorར༻࣌ʹগ͠ϋϚͬͨ • ςετίʔυΛॻͨ͘Ίʹimport digdagͷ ϞοΫίʔυ͕ඞཁ • !includeͰผσΟϨΫτϦʹdigΛஔ͘ͱ
PythonεΫϦϓτؒͷґଘղܾͷ࣮͕ඞཁ • λεΫؒͷม࿈ܞdigdag.env.storeͰɺ શλεΫԣஅͰΩʔͷ໊લΛҰҙʹ͢Δඞཁ͋ ΓʢಉҰ໊শͰ্ॻ͖͕ൃੜ͢Δ߹༗Γʣ
։ൃ࣌ʹൃੜͨ͠/՝ʢิʣ • rb operatorར༻ͯ͠·ͤΜ
ӡ༻࣌ʹൃੜͨ͠/՝ • ӡ༻Ͱཉ͍͠ػೳ͕͋Δঢ়گʢ։ൃதʁʣ • ֬ೝը໘ (ίϚϯυͰճආத) • ਐߦঢ়گɾ࣮ߦ݁ՌɾΤϥʔͳͲ • ϩάͷS3ӬଓԽ
(S3FSͰճආத)
·ͱΊ • ࣗಈԽਖ਼ٛʂ