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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
290
個人開発におすすめの Next.js 技術スタック
morizyun
1
1.3k
継続的個人開発のコツ
morizyun
1
58k
GitLab CI x Docker のススメ
morizyun
15
5.2k
Mini-Heroku "Dokku"
morizyun
0
390
Overcommit & Pronto Introduction
morizyun
0
970
I Enjoyed First English LT @ RedDotRubyConf
morizyun
0
2k
Learning Through Blogging: Ruby Blogging Benefits
morizyun
0
980
英語で広がるRubyの世界
morizyun
4
2.3k
Other Decks in Programming
See All in Programming
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
540
AWS×クラウドネイティブソフトウェア設計 / AWS x Cloud-Native Software Design
nrslib
15
3k
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
7.9k
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
820
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
370
Goの型安全性で実現する複数プロダクトの権限管理
ishikawa_pro
1
210
Fundamentals of Software Engineering In the Age of AI
therealdanvega
1
240
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
430
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
170
Ruby and LLM Ecosystem 2nd
koic
1
520
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
360
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
230
Featured
See All Featured
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.1k
How GitHub (no longer) Works
holman
316
140k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
How to train your dragon (web standard)
notwaldorf
97
6.6k
Documentation Writing (for coders)
carmenintech
77
5.3k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.1k
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
330
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Abbi's Birthday
coloredviolet
2
5.3k
The Cult of Friendly URLs
andyhume
79
6.8k
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