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
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
ESXi のAIOps だ!2025冬
unnowataru
0
480
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
17k
Master Dataグループ紹介資料
sansan33
PRO
1
4.2k
モノタロウ x クリエーションラインで実現する チームトポロジーにおける プラットフォームチーム・ ストリームアラインドチームの 効果的なコラボレーション
creationline
0
530
「駆動」って言葉、なんかカッコイイ_Mitz
comucal
PRO
0
140
松尾研LLM講座2025 応用編Day3「軽量化」 講義資料
aratako
15
4.9k
ECS_EKS以外の選択肢_ROSA入門_.pdf
masakiokuda
1
120
AWSと生成AIで学ぶ!実行計画の読み解き方とSQLチューニングの実践
yakumo
2
290
_第4回__AIxIoTビジネス共創ラボ紹介資料_20251203.pdf
iotcomjpadmin
0
180
【Agentforce Hackathon Tokyo 2025 発表資料】みらいシフト:あなた働き方を、みらいへシフト。
kuratani
0
100
Keynoteから見るAWSの頭の中
nrinetcom
PRO
1
170
国井さんにPurview の話を聞く会
sophiakunii
1
330
Featured
See All Featured
The Invisible Side of Design
smashingmag
302
51k
Ruling the World: When Life Gets Gamed
codingconduct
0
120
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.5k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
160
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
94
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
31
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
420
Code Review Best Practice
trishagee
74
19k
Exploring anti-patterns in Rails
aemeredith
2
220
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をバッチで回す例を紹介した