Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Digdag x Dockerでモダンなバッチ処理環境を構築
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
morizyun
June 09, 2017
Programming
27k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Digdag x Dockerでモダンなバッチ処理環境を構築
http://morizyun.github.io/digdag/
に入門記事を書きましたのでよければこちらも読んでみてください!
morizyun
June 09, 2017
More Decks by morizyun
See All by morizyun
履歴書サービスでのLLMを使った機能の事例
morizyun
0
330
個人開発におすすめの Next.js 技術スタック
morizyun
1
1.4k
継続的個人開発のコツ
morizyun
1
61k
GitLab CI x Docker のススメ
morizyun
15
5.3k
Mini-Heroku "Dokku"
morizyun
0
410
Overcommit & Pronto Introduction
morizyun
0
1k
I Enjoyed First English LT @ RedDotRubyConf
morizyun
0
2.1k
Learning Through Blogging: Ruby Blogging Benefits
morizyun
0
1k
英語で広がるRubyの世界
morizyun
4
2.4k
Other Decks in Programming
See All in Programming
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
240
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
350
WebAssembly in Android Apps 〜 WASMはJNIの夢を見るか
keiji
1
100
AIエージェント時代のコードレビューを設計する
nogu66
6
2.7k
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
1
560
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
140
マイコン向けの軽量Ruby「PicoRuby」で各種デバイスを制御するネイティブアプリの実現手法
bash0c7
0
410
速習iPhone Duo対応
yuukiw00w
1
510
Intent as Code
shoppingjaws
6
1k
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
3
180
Security issues being discussed on Web Platforms
petamoriken
0
950
変化を抱擁するドキュメントの作り方 - ビジネスルール駆動開発がもたらす、コードとの新しい関係
ioki
2
210
Featured
See All Featured
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
330
Typedesign – Prime Four
hannesfritz
42
3.2k
Bash Introduction
62gerente
615
220k
Google's AI Overviews - The New Search
badams
0
1.6k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
380
YesSQL, Process and Tooling at Scale
rocio
174
15k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
So, you think you're a good person
axbom
PRO
2
2.2k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
430
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.1k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.2k
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