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
Japan.R 2018 LT
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
chengvt
December 01, 2018
Technology
0
630
Japan.R 2018 LT
chengvt
December 01, 2018
Tweet
Share
Other Decks in Technology
See All in Technology
Agent Skill 是什麼?對軟體產業帶來的變化
appleboy
0
230
20260321_エンベディングってなに?RAGってなに?エンベディングの説明とGemini Embedding 2 の紹介
tsho
0
160
VSCode中心だった自分がターミナル沼に入門した話
sanogemaru
0
600
GitHub Copilot CLI で Azure Portal to Bicep
tsubakimoto_s
0
190
やさしいとこから始めるGitHubリポジトリのセキュリティ
tsubakimoto_s
0
460
スピンアウト講座04_ルーティン処理
overflowinc
0
1.2k
品質を経営にどう語るか #jassttokyo / Communicating the Strategic Value of Quality to Executive Leadership
kyonmm
PRO
3
1.2k
BFCacheを活用して無限スクロールのUX を改善した話
apple_yagi
0
120
Why we keep our community?
kawaguti
PRO
0
220
FlutterでPiP再生を実装した話
s9a17
0
160
QA組織のAI戦略とAIテスト設計システムAITASの実践
sansantech
PRO
1
140
JEDAI認定プログラム JEDAI Order 2026 受賞者一覧 / JEDAI Order 2026 Winners
databricksjapan
0
330
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
6k
The Limits of Empathy - UXLibs8
cassininazir
1
270
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
120
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
450
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.5k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
300
Context Engineering - Making Every Token Count
addyosmani
9
770
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Transcript
でRをバッチで回す Japan.R 2018 LT 2018.12.01 @chengvt り
自己紹介 nickname: チェン job: メディア系会社で二年目のアナリスト hobby:登山 R package: chengvt/MovingBubbles
Motivation • アドホック分析用データ作成+モデルを周期的に回すため、定型処理 をバッチ化したくなる • 手元のサーバで以前cron使いましたが、digdagというワークフロー エンジンに乗り換えました • 本日はdigdagでR処理を回す例を紹介
デモ やりたいこと 今年8月に生まれたパンダちゃんの 最新体重の推移を知りたい (名前投票受付中らしい)
パンダちゃんの体重はツイッター で毎日公開されています @aws_official
Rスクリプトを用意する • get_panda.R – twitterから最新情報を取得し、ファイルに保存 • plot_panda.R – 体重推移をプロットし、ファイルに保存
定形処理をバッチ化 で楽な作業に! スクリプトがあっても定期的 に実行するのは大変
digdagをサーバにインストール 詳細:https://www.digdag.io/
digファイルを書く 日本時間を使ってね 毎日17時に回してね これらのRスクリプト回 してね
ワークフローの登録 * セークレット利用やもっとカスタマイズする場合はdigdag schedulerではなくて、digdag server + digdag pushが良さそう * 「nohup
コマンド &」で端末を閉じてもログアウトしても処理を続ける digdag scheduler -n 1234 -b 127.0.0.1 Runs a workflow scheduler that runs schedules periodically. This picks up all workflow definition files named with .dig suffix at the current directory. ポート アドレス ワーキングフォルダー で実行して完了
UIがあって、Webブラウザで見れるよ 設定したアドレスとポートでアクセス 例: http://127.0.0.0:1234
便利なプラグインもあるよ • digdag-slack https://github.com/szyn/digdag-slack
まとめ • digdagでRをバッチで回す例を紹介した