Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Digdag x Dockerでモダンなバッチ処理環境を構築
Search
morizyun
June 09, 2017
Programming
3
27k
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
270
個人開発におすすめの Next.js 技術スタック
morizyun
1
1.3k
継続的個人開発のコツ
morizyun
1
56k
GitLab CI x Docker のススメ
morizyun
15
5.2k
Mini-Heroku "Dokku"
morizyun
0
370
Overcommit & Pronto Introduction
morizyun
0
940
I Enjoyed First English LT @ RedDotRubyConf
morizyun
0
2k
Learning Through Blogging: Ruby Blogging Benefits
morizyun
0
960
英語で広がるRubyの世界
morizyun
4
2.3k
Other Decks in Programming
See All in Programming
AIコーディングエージェント(Gemini)
kondai24
0
150
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
380
これだけで丸わかり!LangChain v1.0 アップデートまとめ
os1ma
6
1.3k
俺流レスポンシブコーディング 2025
tak_dcxi
13
7.8k
認証・認可の基本を学ぼう前編
kouyuume
0
160
バックエンドエンジニアによる Amebaブログ K8s 基盤への CronJobの導入・運用経験
sunabig
0
130
Herb to ReActionView: A New Foundation for the View Layer @ San Francisco Ruby Conference 2025
marcoroth
0
240
WebRTC と Rust と8K 60fps
tnoho
2
1.9k
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
210
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
140
CSC509 Lecture 14
javiergs
PRO
0
220
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
400
Featured
See All Featured
Embracing the Ebb and Flow
colly
88
4.9k
How GitHub (no longer) Works
holman
316
140k
Rails Girls Zürich Keynote
gr2m
95
14k
Become a Pro
speakerdeck
PRO
30
5.7k
Git: the NoSQL Database
bkeepers
PRO
432
66k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
What's in a price? How to price your products and services
michaelherold
246
12k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
960
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Side Projects
sachag
455
43k
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