Deploy your Rust project in 20 minutes

  Рет қаралды 44,937

Let's Get Rusty

Let's Get Rusty

Күн бұрын

Deployment shouldn't be difficult. In this video you'll be guided through deploying your Rust project using 3 popular deployment technologies. You'll also learn how to leverage caching to deploy your code changes in near real time.
FREE Rust training: letsgetrusty.com/bootcamp
Code: github.com/letsgetrusty/api-d...
Chapters:
0:00 Overview
2:16 Docker
8:36 Digital Ocean & Github Actions
16:58 Caching

Пікірлер: 90
@letsgetrusty
@letsgetrusty 11 ай бұрын
📝Get your *FREE Rust training* : letsgetrusty.com/bootcamp
@gustav_spin
@gustav_spin 11 ай бұрын
There is no better video on youtube of how to make a deploy! Thank you so much for the video, simply the best explanation I've ever found.
@TheOriginalJohnDoe
@TheOriginalJohnDoe 11 ай бұрын
I feel honored that you used my credentials in your video.
@leifelliott1500
@leifelliott1500 11 ай бұрын
Very practical tutorial. I'm reading through Zero2Prod in Rust right now, very happy about the state of using Rust to build web microservices. I would love to see a full Axum framework tutorial.
@haydn.murray
@haydn.murray 11 ай бұрын
I’m reading zero2prod too!
@attilluss
@attilluss 10 ай бұрын
Also reading it..or going back to it after few months
@ludwig8841
@ludwig8841 11 ай бұрын
I would love a full tutorial on the Axum framework!
@lapppse2764
@lapppse2764 11 ай бұрын
Thank you for your videos! They help a lot!
@CamembertDave
@CamembertDave 11 ай бұрын
Being able to use the scratch base image is really cool. Did a quick test. It took an 18.6 MB (6.7 MB compressed) alpine-based image down to 11.3 MB (3.4 MB compressed).
@sustainablewww6715
@sustainablewww6715 11 ай бұрын
Fantastic video 😊 more of these please.
@MadTofan
@MadTofan 11 ай бұрын
I was pulling my hair and spent a week to do what this video display for my microservice axum and tonic project last month. I haven't tried the caching yet, but since my server is an on prem machine, it is not a major issue. 😊
@iva1389
@iva1389 Ай бұрын
Fantastic tutorial! Excellent explanation! Thank you!
@lukevanaardt8675
@lukevanaardt8675 10 ай бұрын
I'd love a full Axum tutorial! Thanks for the great videos!
@j.enriqueortegasilvera6570
@j.enriqueortegasilvera6570 11 ай бұрын
Great video , super useful , in my personal project.
@cedwards1080
@cedwards1080 11 ай бұрын
Your videos are very well done!
@rmnilin
@rmnilin 11 ай бұрын
Thank you for the engaging content! I'd like to share my opinion regarding the axum tutorial. I find the topic of refactoring a project from the state shown in the video to a minimal production-ready state, including migrations, binding DTOs with models, error handling, etc., more intriguing. There are plenty of resources about building a pet-project-like API based on axum, but content covering the topic I described would be, in my opinion, significantly more valuable and rare.
@rmnilin
@rmnilin 11 ай бұрын
Ah, it is mentioned at the end of the video that the topic of real-world applications will be covered within the bootcamp. Thank you!
@kevz3351
@kevz3351 11 ай бұрын
Thanks for the tutorial!
@min2sia
@min2sia 11 ай бұрын
Shuttle is another nice alternative. Exploring it right now.
@scotty3024
@scotty3024 11 ай бұрын
One of the most useful videos on this channel!
@letsgetrusty
@letsgetrusty 11 ай бұрын
Thank you!
@HunterRoMike
@HunterRoMike 8 ай бұрын
Please make a video series on the Axum framework. Awesoe video, btw!
@jonas6386
@jonas6386 10 ай бұрын
Great to see a video that provides the full picture of writing and deploying a rust web app! Maybe I missed something, but at 6:55 we define a volume for the database. Will this volume be a directory on the droplet? If that is the case, I guess in a production scenario, we would also like to have a mechanism to take backups of that directory in case it contains valuable user data.
@irlshrek
@irlshrek 11 ай бұрын
thanks for this!
@Light_Akira
@Light_Akira 11 ай бұрын
very nice tutorial!
@lll_Death_lll
@lll_Death_lll 11 ай бұрын
Would love to see an Axum tutorial! Btw, I think link to code in the description doesn't work
@letsgetrusty
@letsgetrusty 11 ай бұрын
Fixed the link!
@adrianscarlett
@adrianscarlett 6 ай бұрын
I'd love to see a comparison of frameworks, it would be interesting to see how easy (or hard...) it is to change to a different one.
@jamaicandisciples7207
@jamaicandisciples7207 4 ай бұрын
Well done. Please create tutorial on Axum. Thanks
@legionfalls
@legionfalls 11 ай бұрын
Would love to see an Axum tutorial!
@digitalfriday
@digitalfriday 11 ай бұрын
excellent
@SyamaMishra
@SyamaMishra 11 ай бұрын
Yes please for an Axum tutorial.
@aperson4051
@aperson4051 11 ай бұрын
This was great. Could you do something similar with kubernetes?
@CalifornianViking
@CalifornianViking 11 ай бұрын
What are your thoughts about deploying something stateful like Postgres in a container? Is it recommended? What are the pros and cons?
@thehard-coder9398
@thehard-coder9398 11 ай бұрын
@letsgetrusty - thanks for creating such a great video. Will this content will be covered in the Bootcamp?
@letsgetrusty
@letsgetrusty 11 ай бұрын
Yes it will!
@thehard-coder9398
@thehard-coder9398 11 ай бұрын
@@letsgetrusty - I'm already a student of your Bootcamp. However, I don't see the content in the bootcamp. Would you mind sharing? Thank you
@dmitriidemenev5258
@dmitriidemenev5258 11 ай бұрын
It would be amazing if you mentioned Shuttle.
@aftalavera
@aftalavera 10 ай бұрын
The boot camp is just starting to sound like the release of Jai!
@UweStrempel
@UweStrempel 11 ай бұрын
Axum tutorial would be nice.
@rHino122295
@rHino122295 10 ай бұрын
This is an amazing video. Saving for later
@mygamesm
@mygamesm 11 ай бұрын
may i know what extension gives you the in editor debug errors?
@DJenriqez
@DJenriqez 11 ай бұрын
Personally (not saying its good) its easier and faster (for me) to build rust under linux WSL and then in Docker file only copy build result. Docker container is then smaller, and build with deployment are faster.
@oriyadid
@oriyadid 11 ай бұрын
I already replied to this earlier but seems KZbin hid the comment. A better way to do this is a Multi-Stage Build. It's a native docker feature and it lets you build inside one image, then copy the binary to a new one, which will be the final product. This way the entire process is in docker, and you don't need to depend on WSL.
@DJenriqez
@DJenriqez 11 ай бұрын
@@oriyadid this is too big overkill for project types, budgets and people I work with,… docker is evil for me I have to handle somehow,… but I agree.
@sighupcmd
@sighupcmd 11 ай бұрын
One of the main killer features of rust for me is ability to avoid docker completely. So all I need to do is create .sevice file, and just scp my binary. Of course containers are great for scale, but I will use scp/ansistrano as long as possible. So, you can deploy rust in 5 minutes for the first time, and in 1 second all the others :)
@yollotltamayo2685
@yollotltamayo2685 10 ай бұрын
Hi can you elaborate on this ? thanks in advance
@daviidon
@daviidon 8 ай бұрын
Awesome but this needs to be more robust for real production services. You should only shutdown old containers after the new one is up and healthy which would need a proxy and the database container should be kept separately. You wouldn't want to restart your database every time your api changes.
@redhawk3385
@redhawk3385 11 ай бұрын
I love you videos, however actions-rs/toolchain is long dead. It should not be used since it is not maintained anymore. I would love to see a video on rust ci for building on all os's, then testing audit and clippy on just linux.
@penguin_brian
@penguin_brian 11 ай бұрын
Is there something else we should be using instead?
@badtrapify
@badtrapify 19 күн бұрын
@@penguin_brian I'm currently trying it with dtolnay/rust-toolchain@stable
@priyankgupta
@priyankgupta 10 ай бұрын
Hey dude, I have a thing for technical writing. Can I use this video to write a technical blog post that will basically trace this video? Asking for permission, will obviously credit appropriately.
@MrPielover19
@MrPielover19 11 ай бұрын
why axum instead of rocket? personal preference or is there a specific reason?
@user-vj9hb3gy6d
@user-vj9hb3gy6d 11 ай бұрын
Maybe because Axum is developed by the Tokio team. Rocket is mostly developed by a single developer. A lot could go wrong if he abandoned the project.
@hos7012
@hos7012 11 ай бұрын
axum plz
@flyaruu
@flyaruu 11 ай бұрын
The caching part of the video was kinda rushed, that part deserves its own in depth video
@badtrapify
@badtrapify 19 күн бұрын
I'm kinda new to rust and i try to do what is described here (Had to change a few actions / versions) but in general: The github action is not able to compile my code, because sqlx needs a database running when using the query! macro and there is no database at compile time. Even if i provide a .env file with DATABASE_URL being set, i get compile time errors, that DATABSE_URL needs to be set. (I don't think this would change anything, as there... is no database on the action runner). Is there any special sqlx compile time magic i'm missing out? Second thing i notice: There is a github action secret being set for the DO API token. But it seems to never being used actually (Why should it be? You just ssh / scp into an existing droplet. No need for digital ocean API calls?!)
@badtrapify
@badtrapify 19 күн бұрын
Ok. I could answer the first question mysqlf by checking the sqlx docs. And if another newbie stubles accross, this one is for you: I had to set up an accessable db (or postgres container) and then: sqlx database create sqlx migrate run to apply the db-migrations in the migrations folder and then cargo sqlx prepare To prepare everything for SQLX Offline compilation mode.
@clayratliff7727
@clayratliff7727 11 ай бұрын
Good video but the link to the repo is broken
@letsgetrusty
@letsgetrusty 11 ай бұрын
Fixed the link!
@kombi1697
@kombi1697 7 ай бұрын
Did anyone experience issue connecting to their droplet IP?...my droplet IP refused to connect and I don't really know why despite taking the same steps.
@ac130kz
@ac130kz 11 ай бұрын
passwords aren't good, there should be a key instead
@Alex-hr2df
@Alex-hr2df 11 ай бұрын
But you're running Postgres locally in the Deoplet. Not good! Data will be lost even if you have volume in place. You should separate it. And by doing so, you don't need docker-compose anymore. Jusaying.
@ishaanmalhotra3008
@ishaanmalhotra3008 11 ай бұрын
Yeah I was very confused by that. How does the database actually write on the disk, or does it just store in memory
@CalifornianViking
@CalifornianViking 11 ай бұрын
I asked the same question. Containers are stateless.
@lostphysicist
@lostphysicist 11 ай бұрын
The github link is broken
@letsgetrusty
@letsgetrusty 11 ай бұрын
Fixed the link!
@primozpadar
@primozpadar 11 ай бұрын
You could use docker swarm or dokku instead of docker-compose (which us not really meant for producion). Otherwise, really great video!
@barreltitor1419
@barreltitor1419 8 ай бұрын
I'd replace docker with podman
@tekipeps
@tekipeps 11 ай бұрын
Doesn't this cause downtime?
@logeshkumarrajkumar861
@logeshkumarrajkumar861 11 ай бұрын
Hi Thanks for the video. The githib link is broken.
@letsgetrusty
@letsgetrusty 11 ай бұрын
Fixed the link!
@logeshkumarrajkumar861
@logeshkumarrajkumar861 11 ай бұрын
@@letsgetrusty Awesome. You are the best. Looking forward for the Axum video
@coffee-is-power
@coffee-is-power 11 ай бұрын
1:44 postman... that's forbidden, must use insomnia..
@coffeefingies
@coffeefingies 11 ай бұрын
Repo link is a 404
@letsgetrusty
@letsgetrusty 11 ай бұрын
Fixed the link!
@curio78
@curio78 26 күн бұрын
rust needs an minimum IDE like dev-C++. somone just modify that to support Rust. Then Rust will take off. Until then, without any basic IDE support for debugging what's the point? FIrst rule of programing language build tools to debug.
@semenivanoff8615
@semenivanoff8615 7 ай бұрын
Why to deploy to virt machine instead of deploying to container services?!! Containers are 10-20 times cheaper than VMs...
@skeam_tv
@skeam_tv 11 ай бұрын
action-rs toolchain github action is an unmaintained project btw
@janisozols2055
@janisozols2055 11 ай бұрын
Your repository is private.
@letsgetrusty
@letsgetrusty 11 ай бұрын
Fixed!
@tcurdt
@tcurdt 11 ай бұрын
Please don't use root and password auth this way. 😞
@haliszekeriyaozkok4851
@haliszekeriyaozkok4851 11 ай бұрын
deploying rust with docker is pointless. When you write rust apps you expect maximum performance from them. But docker is actually written with more slower languages than rust, it slows down rust very significantly. Because of that rust app's shouldn't be dockerized. If you should dockerize something, than you should write go or more slower and easier language instead. Depending on that, i love to see how to deploy rust apps on a vps and cloud. And i want to learn axum framework. I start to learn rocket in this times.
@tcurdt
@tcurdt 11 ай бұрын
> But docker is actually written with more slower languages than rust, it slows down rust very significantly You probably should do your homework on that one.
@int32_
@int32_ 11 ай бұрын
docker performance is near to native, with noticeable overhead only if you don't use host networking
@ybergik
@ybergik 11 ай бұрын
I've never understood why anyone would favour bloated deployment options to the simple 1) stop service, 2) replace binary, 3) start service.
@Notoriousjunior374
@Notoriousjunior374 11 ай бұрын
What are you even saying?
@ac130kz
@ac130kz 11 ай бұрын
good luck paying the bills with all those downtimes
@DJenriqez
@DJenriqez 11 ай бұрын
You are right but only for some types of projects,… when you have small VM infrastructure this is cheapest and easiest option. I have customer, fifty years old company where this is the only way.
@hendrykhoza4782
@hendrykhoza4782 10 ай бұрын
Your bootcamp is so expensive, I am disappointed
All Rust string types explained
22:13
Let's Get Rusty
Рет қаралды 149 М.
8 deadly mistakes beginner Rust developers make
14:14
Let's Get Rusty
Рет қаралды 156 М.
Super gymnastics 😍🫣
00:15
Lexa_Merin
Рет қаралды 99 МЛН
UFC Vegas 93 : Алмабаев VS Джонсон
02:01
Setanta Sports UFC
Рет қаралды 190 М.
Hot Ball ASMR #asmr #asmrsounds #satisfying #relaxing #satisfyingvideo
00:19
Oddly Satisfying
Рет қаралды 46 МЛН
cute puppy dance
0:09
Santosh Kumar Ujjain
Рет қаралды 10 М.
Rust & Wasm
9:38
No Boilerplate
Рет қаралды 186 М.
SQLx is my favorite PostgreSQL driver to use with Rust.
9:47
Dreams of Code
Рет қаралды 47 М.
100+ Docker Concepts you Need to Know
8:28
Fireship
Рет қаралды 812 М.
The Best Way To Deploy In 2024 (feat. Docker, Rust, and Language Models)
18:33
Setting up CI and property testing for a Rust crate
2:46:41
Jon Gjengset
Рет қаралды 25 М.
The magic of Rust's type system
9:01
Let's Get Rusty
Рет қаралды 70 М.
why rust libraries may never exist.
7:26
Low Level Learning
Рет қаралды 221 М.
Rust's Most Important Containers 📦 10 Useful Patterns
17:11
Code to the Moon
Рет қаралды 113 М.
I spent six months rewriting everything in Rust
15:11
chris biscardi
Рет қаралды 405 М.
One To Three USB Convert
0:42
Edit Zone 1.8M views
Рет қаралды 440 М.
5 НЕЛЕГАЛЬНЫХ гаджетов, за которые вас посадят
0:59
Кибер Андерсон
Рет қаралды 1,6 МЛН
Samsung S24 Ultra professional shooting kit #shorts
0:12
Photographer Army
Рет қаралды 22 МЛН