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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
chengvt
December 01, 2018
Technology
630
0
Share
Japan.R 2018 LT
chengvt
December 01, 2018
Other Decks in Technology
See All in Technology
AI駆動開発で生産性を追いかけたら、行き着いたのは品質とシフトレフトだった
littlehands
0
250
GitHub Copilot CLI と VS Code Agent Mode の使い分け
tomokusaba
0
130
自動テストだけで リリース判断できるチームへ - 鍵はテストの量ではなくリリース判断基準の再設計にあった / Redesigning Release Criteria for Lightweight Releases
ewa
5
3k
20260423_ハドソンのエロゲを追え_レトロゲーム
poropinai1966
0
100
Chasing Real-Time Observability for CRuby
whitegreen
0
700
FessのAI検索モード:検索システムとLLMへの取り組み
marevol
0
170
AIはハッカーを減らすのか、増やすのか?──現役ホワイトハッカーから見るAI時代のリアル【MEGU-Meet】
cscengineer
PRO
0
250
大学職員のための生成AI最前線 :最前線を、AIガバナンスとして読み直すためのTips
gmoriki
1
2.9k
国内外の生成AIセキュリティの最新動向 & AIガードレール製品「chakoshi」のご紹介 / Latest Trends in Generative AI Security (Domestic & International) & Introduction to AI Guardrail Product "chakoshi"
nttcom
4
1.7k
M5Stack CoreS3とZephyr(RTOS)で Edge AIっぽいことしてみた
iotengineer22
0
410
[Oracle TechNight#99] 生成AI時代のAI/ML入門 ~ AIとオラクルデータベースの関係 (後半)
oracle4engineer
PRO
2
180
「SaaSの次の時代」に重要性を増すステークホルダーマネジメントの要諦 ~解像度を圧倒的に高めPdMの価値を最大化させる方法~
kakehashi
PRO
3
3.5k
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.7k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.4k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
We Have a Design System, Now What?
morganepeng
55
8.1k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
290
How to Think Like a Performance Engineer
csswizardry
28
2.6k
Leo the Paperboy
mayatellez
7
1.7k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
270
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をバッチで回す例を紹介した