Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Japan.R 2018 LT
Search
chengvt
December 01, 2018
Technology
0
610
Japan.R 2018 LT
chengvt
December 01, 2018
Tweet
Share
Other Decks in Technology
See All in Technology
[Data & AI Summit '25 Fall] AIでデータ活用を進化させる!Google Cloudで作るデータ活用の未来
kirimaru
0
3.7k
202512_AIoT.pdf
iotcomjpadmin
0
140
20251218_AIを活用した開発生産性向上の全社的な取り組みの進め方について / How to proceed with company-wide initiatives to improve development productivity using AI
yayoi_dd
0
650
ESXi のAIOps だ!2025冬
unnowataru
0
340
アラフォーおじさん、はじめてre:Inventに行く / A 40-Something Guy’s First re:Invent Adventure
kaminashi
0
130
日本Rubyの会: これまでとこれから
snoozer05
PRO
5
230
Identity Management for Agentic AI 解説
fujie
0
450
Next.js 16の新機能 Cache Components について
sutetotanuki
0
170
M&Aで拡大し続けるGENDAのデータ活用を促すためのDatabricks権限管理 / AEON TECH HUB #22
genda
0
230
ハッカソンから社内プロダクトへ AIエージェント「ko☆shi」開発で学んだ4つの重要要素
sonoda_mj
6
1.6k
なぜ あなたはそんなに re:Invent に行くのか?
miu_crescent
PRO
0
200
Strands AgentsとNova 2 SonicでS2Sを実践してみた
yama3133
1
1.8k
Featured
See All Featured
Amusing Abliteration
ianozsvald
0
69
The Language of Interfaces
destraynor
162
25k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
Faster Mobile Websites
deanohume
310
31k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
94
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
120
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
130
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.1k
Ruling the World: When Life Gets Gamed
codingconduct
0
100
End of SEO as We Know It (SMX Advanced Version)
ipullrank
2
3.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をバッチで回す例を紹介した