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
Nim + Cloud Run + TerraformでGCPにNimのサーバーレス環境を作る
Search
regonn
May 04, 2021
Programming
1
660
Nim + Cloud Run + TerraformでGCPにNimのサーバーレス環境を作る
2021/05/04
@nim(ゆるい) LTイベント
regonn
May 04, 2021
Tweet
Share
More Decks by regonn
See All by regonn
Submission with Numerai Compute using GCP Batch
regonn
0
590
HelloMoon x Orca=HelloOrca
regonn
0
140
The Challenge of Automatically Configuring Numerai Compute Environment
regonn
0
97
Federated Learning 連合学習
regonn
4
1.7k
PLATEAUをデータベースに取り込んでみた
regonn
0
1.8k
古参Numerai参加者の戯言
regonn
1
2.5k
S+ Camera Basicと似た環境をラズパイから構築してみる
regonn
0
530
衛星画像のゴルフ場写り込み判定AIモデルを作る
regonn
0
800
データラーニングギルド での活動と今後
regonn
0
170
Other Decks in Programming
See All in Programming
What’s Fair is FAIR: A Decentralised Future for WordPress Distribution
rmccue
0
150
歴史から学ぶ「Why PHP?」 PHPを書く理由を改めて理解する / Learning from History: “Why PHP?” Rediscovering the Reasons for Writing PHP
seike460
PRO
0
140
AI駆動開発ライフサイクル(AI-DLC)のホワイトペーパーを解説
swxhariu5
0
450
alien-signals と自作 OSS で実現する フレームワーク非依存な ロジック共通化の探求 / Exploring Framework-Agnostic Logic Sharing with alien-signals and Custom OSS
aoseyuu
3
5.9k
Flutterアプリ運用の現場で役立った監視Tips 5選
ostk0069
1
240
Private APIの呼び出し方
kishikawakatsumi
2
810
Researchlyの開発で参考にしたデザイン
adsholoko
0
120
Kotlinで実装するCPU/GPU 「協調的」パフォーマンス管理
matuyuhi
0
330
Temporal Knowledge Graphで作る! 時間変化するナレッジを扱うAI Agentの世界
po3rin
5
1.3k
Tangible Code
chobishiba
3
510
ボトムアップの生成AI活用を推進する社内AIエージェント開発
aku11i
0
1.6k
Vueのバリデーション、結局どれを選べばいい? ― 自作バリデーションの限界と、脱却までの道のり ― / Which Vue Validation Library Should We Really Use? The Limits of Self-Made Validation and How I Finally Moved On
neginasu
3
1.8k
Featured
See All Featured
Code Review Best Practice
trishagee
72
19k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
Being A Developer After 40
akosma
91
590k
Embracing the Ebb and Flow
colly
88
4.9k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.8k
Code Reviewing Like a Champion
maltzj
527
40k
Music & Morning Musume
bryan
46
6.9k
Transcript
れごん 2021/05/04 @nim(ゆるい) LTイベント Nim + Cloud Run + Terraform
で GCP に Nim の サーバーレス環境を作る
Who am I? • れごん(@regonn_haizine) • 2018年に島根県にIターンで移住 • 機械学習系のPodcast ”Regonn&Curry.fm”
やってます
Nimとの出会い Slantという海外のテック系比較 サイトでBest programming languagesで1位になっていた。 (当時はまだ1系リリース前)
今日紹介すること • Nim でサーバーレス環境構築 • Nim • CPU実行時間の従量課金のため処理速度が重要 • Cloud
Run(GCP) • Dockerをデプロイすることで好きな言語で実行可能 • Terraform • インフラ構築がコードで管理可能(Infrastructure as Code)
構成図: 毎日決まった時間に気象庁APIから天気予報を取得してDiscordに投稿 GCP内のインフラ構築はTerraformで管理 天気予報API Container Registry Cloud Run Cloud Scheduler
コード解説 https://github.com/regonn/weather-discord-bot-cloud-run-terraform
コードの応用 • 今回のAPI取得の部分を切り替えることで色々と応用可能 • 普段は仮想通貨の自動売買とかやってます • 自動売買系も高頻度取引の場合等には処理速度が重要 • Nim言語で仮想通貨取引所APIを叩くコードまとめ記事 •
https://note.com/regonn314/n/n62d5adf25308
None