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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
chengvt
December 01, 2018
Technology
650
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Japan.R 2018 LT
chengvt
December 01, 2018
Other Decks in Technology
See All in Technology
Adding Right-to-Left support to your web application with CSS logical properties — Lessons from Redmine
vividtone
0
140
2027年のMetricKit
kantacky
0
110
なぜ Temporal の大小比較には compare しかないのか / Why Does Temporal Only Have compare() for Comparisons
kazukihayase
1
180
【CEDEC2026】Creative Approaches to Localizing the Dialects and Unique Speech of Umamusume: Pretty Derby Characters in English
cygames
PRO
3
25k
トークンマネジメントでAIにとって働きやすい環境を実現する
hikaruegashira
0
110
My broken English still works: speaking at global OSS events
naruoga
0
120
カートの信頼性を担保するWireMockを使ったe2eテスト
ykagano
0
570
ホームラボ紹介
y_sera15
0
210
FDEの心得
noriakioji
5
6.3k
自宅NWにISR4331を導入してみた話
okaits
0
110
20分でわかるセキュアAPI
nwiizo
2
310
攻撃と防御で学ぶAI時代のプロダクトセキュリティ演習
recruitengineers
PRO
9
3.1k
Featured
See All Featured
WENDY [Excerpt]
tessaabrams
11
39k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
A Soul's Torment
seathinner
6
3.5k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Producing Creativity
orderedlist
PRO
348
40k
How to train your dragon (web standard)
notwaldorf
97
6.8k
Scaling GitHub
holman
464
140k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
170
Game over? The fight for quality and originality in the time of robots
wayneb77
1
250
The Spectacular Lies of Maps
axbom
PRO
1
930
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をバッチで回す例を紹介した