Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Shuttle で Rust アプリケーションを爆速デプロイ
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
codemountains
December 19, 2023
Programming
310
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Shuttle で Rust アプリケーションを爆速デプロイ
UV Study : Rust LT会(2023.12.19)での登壇資料「Shuttle で Rust アプリケーションを爆速デプロイ」です。
codemountains
December 19, 2023
Transcript
25 slides
で 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
More Decks by codemountains
See All by codemountains
API ファーストな CMS の世界
codemountains
0
80
Rust | axum でモック用の API サーバーを起動できる CLI ツール作ってみた
codemountains
0
75
Rust.Nagoya #1
codemountains
0
500
Momento Deep Dive - 真のサーバーレスとは?
codemountains
0
1k
Rust 製エディタ Zed を布教したい
codemountains
0
930
kintone Night Nagoya vol.12 - kintone x Collaboflow で評価日報
codemountains
0
72
LINE WORKS と 生成 AI ~Claude 3 と LangChain~
codemountains
0
1.1k
Amazon S3 Express One Zone & AWS re:Invent 2023 現地体験談
codemountains
0
1.7k
Postman CLI で Integration Test
codemountains
2
1.2k
Other Decks in Programming
See All in Programming
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
180
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
340
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
250
Coding with AI: How to trust the storyteller (AWS Community Day Adria, Ljubljana 2026)
slobodan
0
140
小さなアプリを作って公開するまで
onozaty
0
170
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
2.1k
プロジェクトコードをキレイキレイしよう!暗黙的な参照を読み解く静的解析
ostk0069
0
210
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
560
Будущее локальных LLM – Алексей Голобурдин, PythoNN
sobolevn
0
120
AI Augmentation Techniques with Liberty
ivargrimstad
1
460
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
210
graphql-ruby を Spinel で速くしようとした話
mtsmfm
0
140
Featured
See All Featured
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.3k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
680
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
330
Leo the Paperboy
mayatellez
11
2.5k
Skip the Path - Find Your Career Trail
mkilby
1
290
Automating Front-end Workflow
addyosmani
1370
210k
A better future with KSS
kneath
240
18k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
350
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
460
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
640