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 x Dockerでモダンなバッチ処理環境を構築
Search
morizyun
June 09, 2017
Programming
3
26k
Digdag x Dockerでモダンなバッチ処理環境を構築
http://morizyun.github.io/digdag/
に入門記事を書きましたのでよければこちらも読んでみてください!
morizyun
June 09, 2017
Tweet
Share
More Decks by morizyun
See All by morizyun
履歴書サービスでのLLMを使った機能の事例
morizyun
0
260
個人開発におすすめの Next.js 技術スタック
morizyun
1
1.3k
継続的個人開発のコツ
morizyun
1
55k
GitLab CI x Docker のススメ
morizyun
15
5.2k
Mini-Heroku "Dokku"
morizyun
0
360
Overcommit & Pronto Introduction
morizyun
0
920
I Enjoyed First English LT @ RedDotRubyConf
morizyun
0
1.9k
Learning Through Blogging: Ruby Blogging Benefits
morizyun
0
950
英語で広がるRubyの世界
morizyun
4
2.3k
Other Decks in Programming
See All in Programming
(Extension DC 2025) Actor境界を越える技術
teamhimeh
1
230
Signals & Resource API in Angular: 3 Effective Rules for Your Architecture @BASTA 2025 in Mainz
manfredsteyer
PRO
0
100
複雑化したリポジトリをなんとかした話 pipenvからuvによるモノレポ構成への移行
satoshi256kbyte
1
790
10年もののAPIサーバーにおけるCI/CDの改善の奮闘
mbook
0
780
プログラマのための作曲入門
cheebow
0
540
ポスターセッション: 「まっすぐ行って、右!」って言ってラズパイカーを動かしたい 〜生成AI × Raspberry Pi Pico × Gradioの試作メモ〜
komofr
0
970
止められない医療アプリ、そっと Swift 6 へ
medley
1
120
タスクの特性や不確実性に応じた最適な作業スタイルの選択(ペアプロ・モブプロ・ソロプロ)と実践 / Optimal Work Style Selection: Pair, Mob, or Solo Programming.
honyanya
3
140
ネイティブ製ガントチャートUIを作って学ぶUICollectionViewLayoutの威力
jrsaruo
0
130
非同期jobをtransaction内で 呼ぶなよ!絶対に呼ぶなよ!
alstrocrack
0
540
CSC509 Lecture 01
javiergs
PRO
1
430
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
150
Featured
See All Featured
The Cult of Friendly URLs
andyhume
79
6.6k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.5k
KATA
mclloyd
32
15k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Thoughts on Productivity
jonyablonski
70
4.9k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
850
How STYLIGHT went responsive
nonsquared
100
5.8k
How to train your dragon (web standard)
notwaldorf
96
6.3k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
Transcript
Digdag x Dockerでモダンな バッチ処理理環境を構築 twitter: @zyunnosuke blog: http://morizyun.github.io
今⽇日⾔言いたいこと • Treasure DataのOSS「Digdag」の紹介 • DigdagとDockerを組み合わせてバッチ環境を構築 • 感想は環境構築はちょっと苦労。けど使いこなせば便便利利
Digdagって何? • Digdag = ワークフローエンジン • ワークフローエンジン = 順番に予め定義した処 理理を実⾏行行していく仕組み
Digdagの概要 • タスクをYAML(.dig) ベースで定義 • 依存関係のあるタスクや、並列列でのタスク実⾏行行を定 義できる(バッチ間の依存を可視化) • Dockerベースでタスクを実⾏行行できる •
gitでバージョン管理理やコードレビューできるので ソフトウェア開発のプラクティスが使える
ワークフローの定義(YAML) _export: foo: 1 !include : 'config/mysql.dig' _error: sh>: tasks/runs_when_workflow_failed.sh
+step1: sh>: tasks/shell_sample.sh +step2: rb>: MyWorkflow.step2 ← Linuxのexportみたいなの ← エラー時の通知 ← タスク ← Rubyのコードを実⾏行行(要require)
柔軟なタスクの定義 • `if>:` 条件を満たす場合のみ実⾏行行 • `s3_wait>:` AWS S3にファイルが設置されるのを待 つ •
`pg>:` PostgreSQLでSQLを実⾏行行します • `bq>:` BigQueryでクエリを実⾏行行して結果をテーブル に保持
スケジュール実⾏行行もできる timezone: Asia/Tokyo schedule: minutes_interval>: 1 +current_date: sh>: echo `date`
← cron形式も可能 ← タイムゾーン
Docker ベースで実⾏行行できる • Dockerベースでお望みの環境で処理理を実⾏行行できる _export: docker: image: ubuntu:14.04 +step1: py>:
tasks.MyWorkflow.step1 ← Dockerイメージ を指定
グループごとにタスクをまとめる • Topレベルで prepare => analyze => evaluate • `call>:
another_workflow.dig`で他のタスク(dig)を呼び出す
Digdag Server • `digdag push`でサーバにprojectを登録 • 複数台のAgentが必要なタイミングでタスクを実⾏行行
タスクの実⾏行行状況をWeb画⾯面で確認 • 画⾯面からログの確認や、タスク再実⾏行行とかできる
感想 • ワークフローでやりたいことは⼀一通りで きる • 環境構築のコストがそれなりにかかった • 最新バージョン 0.9.12なので、まだまだ PRのチャンス!!
宣伝 • ⼊入⾨門のブログ記事書きました! • http://morizyun.github.io/digdag/
Appendix
デプロイフロー masterにマージ digdag push (タスク実⾏行行) docker run スクリプト郡 Digdagリポジトリ docker
push