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
Shuttle で Rust アプリケーションを爆速デプロイ
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
codemountains
December 19, 2023
Programming
290
1
Share
Shuttle で Rust アプリケーションを爆速デプロイ
UV Study : Rust LT会(2023.12.19)での登壇資料「Shuttle で Rust アプリケーションを爆速デプロイ」です。
codemountains
December 19, 2023
More Decks by codemountains
See All by codemountains
API ファーストな CMS の世界
codemountains
0
65
Rust | axum でモック用の API サーバーを起動できる CLI ツール作ってみた
codemountains
0
60
Rust.Nagoya #1
codemountains
0
450
Momento Deep Dive - 真のサーバーレスとは?
codemountains
0
820
Rust 製エディタ Zed を布教したい
codemountains
0
870
kintone Night Nagoya vol.12 - kintone x Collaboflow で評価日報
codemountains
0
57
LINE WORKS と 生成 AI ~Claude 3 と LangChain~
codemountains
0
1k
Amazon S3 Express One Zone & AWS re:Invent 2023 現地体験談
codemountains
0
1.6k
Postman CLI で Integration Test
codemountains
2
1.1k
Other Decks in Programming
See All in Programming
Building on Bluesky's AT Protocol with Ruby
mackuba
0
110
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
170
属人化しないコード品質の作り方_2026.04.07.pdf
muraaano
0
320
Making the RBS Parser Faster
soutaro
0
670
ふにゃっとしない名前の付け方 〜哲学で茹で上げる、コシのあるソフトウェア設計〜
shimomura
0
110
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
330
サークル参加から学ぶ、小さな事業の回し方
yuzneri
0
150
My daily life on Ruby
a_matsuda
3
190
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
5
1.6k
Firefoxにコントリビューションして得られた学び
ken7253
2
160
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
190
From Formal Specification to Property Based Test
ohbarye
0
2.3k
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
160
Into the Great Unknown - MozCon
thekraken
41
2.5k
Why Our Code Smells
bkeepers
PRO
340
58k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
740
Color Theory Basics | Prateek | Gurzu
gurzu
0
310
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
180
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.2k
Accessibility Awareness
sabderemane
1
110
Become a Pro
speakerdeck
PRO
31
5.9k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.9k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
33
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
Transcript
で Rust アプリケーションを爆速デプロイ 2023.12.19 UV Study : Rust LT会 Kazuno
Fukuda
目次 自己紹介 1. Shuttle について 2. Axum アプリを Shuttle に移行してみた話
3. まとめ 4.
自己紹介 Kazuno Fukuda Kazuno Fukuda
について インフラストラクチャを管理しながらアプリをデプロイできる Rust ネイティブのクラウド開発プラットフォーム Community プランなら無料で利用可能 主要なWebフレームワークに対応 Axum Actix Web
Rocket などなど Rust に特化!
について Infrastructure from Code DBなどのリソースはコードで定義
について Infrastructure from Code アプリケーションの構築とデプロイを簡単にすること を目標としている
にアプリをデプロイ Render と MongoDB Atlas で構築した Axum アプリを Shuttle に移行してみた
cargo-shuttle をインストール cargo install cargo-shuttle cargo shuttle login CLI ツールでデプロイできる
アプリやリソースの管理もできる
Shuttle 用に main.rs を修正していく shuttle-runtime shuttle-axum shuttle-secrets 必要なクレート
Shuttle 用に main.rs を修正していく ほぼ main.rs の修正で完結しました
Shuttle 用に main.rs を修正していく 環境変数を secret_store で管理するように MongoDB をプロビジョニング Axum
なので ShuttleAxum を定義
Shuttle 用に main.rs を修正していく Shuttle のシークレット情報を環境変数に書き込む
Secrets から環境変数へ Axum の State や Layer に追加することで、 シークレット情報を扱う方が良さそう? 環境変数への書き込みは、
ドキュメントでは回避策として紹介されていた
mountix-shuttle ├── mountix-adapter └── mountix-driver MongoDB の Database の参照可能に MongoDB
の Database を参照できるように
ロギングは tracing が使える デフォルト機能として提供 初期化などは不要
ローカル環境でデバッグする MongoDB は Docker で起動 `cargo run` した場合、ヒントが出力される [HINT]: Run
shuttle with `cargo shuttle run` cargo shuttle run cargo watch -x ‘shuttle run’ watch も使える!
設定は toml で管理 Shuttle.toml : 基本情報(プロジェクト名) Secrets.toml : シークレット情報 開発環境では
Secrets.dev.toml を使う
デプロイはコマンドで簡単にできる cargo shuttle project start cargo shuttle deploy
デプロイはコマンドで簡単にできる ログを確認できる
デプロイはコマンドで簡単にできる キーが参照できる (編集は削除からCLIで再作成)
工夫したところ 起動時にマスタデータをインサートできるようにした src 直下に main.rs が必要だった src/bin/bootstrap.rs に main 関数を定義
していたら、起動できなかった
のブログが良い
Shuttle Next !? Shuttle-next is a brand new WASM web-framework
based on Axum and Hyper. Shuttle 製の Web フレームワーク 気になるので使ってみたい!
まとめ Rust 特化のプラットフォーム Infrastructure from Code が面白い 開発体験が良い 無料で色々試せる
None