Deploy your Rust project in 20 minutes

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ก.ย. 2024

ความคิดเห็น • 91

  • @letsgetrusty
    @letsgetrusty  ปีที่แล้ว +5

    📝Get your *FREE Rust training* : letsgetrusty.com/bootcamp

  • @leifelliott1500
    @leifelliott1500 ปีที่แล้ว +58

    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 ปีที่แล้ว +3

      I’m reading zero2prod too!

    • @attilluss
      @attilluss ปีที่แล้ว

      Also reading it..or going back to it after few months

  • @lll_Death_lll
    @lll_Death_lll ปีที่แล้ว +17

    Would love to see an Axum tutorial!
    Btw, I think link to code in the description doesn't work

  • @ludwig8841
    @ludwig8841 ปีที่แล้ว +13

    I would love a full tutorial on the Axum framework!

  • @gustav_spin
    @gustav_spin ปีที่แล้ว +9

    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.

  • @Alex-hr2df
    @Alex-hr2df ปีที่แล้ว +2

    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 ปีที่แล้ว +1

      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 ปีที่แล้ว

      I asked the same question.
      Containers are stateless.

  • @redhawk3385
    @redhawk3385 ปีที่แล้ว +6

    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 ปีที่แล้ว +1

      Is there something else we should be using instead?

    • @badtrapify
      @badtrapify 4 หลายเดือนก่อน

      @@penguin_brian I'm currently trying it with dtolnay/rust-toolchain@stable

  • @rmnilin
    @rmnilin ปีที่แล้ว +8

    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 ปีที่แล้ว +2

      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!

  • @ac130kz
    @ac130kz ปีที่แล้ว +2

    passwords aren't good, there should be a key instead

  • @DJenriqez
    @DJenriqez ปีที่แล้ว +4

    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 ปีที่แล้ว +1

      I already replied to this earlier but seems TH-cam 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 ปีที่แล้ว +1

      @@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.

  • @lapppse2764
    @lapppse2764 ปีที่แล้ว +4

    Thank you for your videos! They help a lot!

  • @CamembertDave
    @CamembertDave ปีที่แล้ว +2

    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).

  • @janisozols2055
    @janisozols2055 ปีที่แล้ว +2

    Your repository is private.

  • @bhavyakukkar
    @bhavyakukkar หลายเดือนก่อน

    i have a question, why didn't you use rust's official docker image?

  • @daviidon
    @daviidon ปีที่แล้ว +1

    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.

  • @kombi1697
    @kombi1697 10 หลายเดือนก่อน

    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.

  • @coffeefingies
    @coffeefingies ปีที่แล้ว +2

    Repo link is a 404

  • @hendrykhoza4782
    @hendrykhoza4782 ปีที่แล้ว

    Your bootcamp is so expensive, I am disappointed

  • @CalifornianViking
    @CalifornianViking ปีที่แล้ว +1

    What are your thoughts about deploying something stateful like Postgres in a container? Is it recommended? What are the pros and cons?

  • @jonas6386
    @jonas6386 ปีที่แล้ว +1

    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.

  • @kevz3351
    @kevz3351 ปีที่แล้ว +2

    Thanks for the tutorial!

  • @TheOriginalJohnDoe
    @TheOriginalJohnDoe ปีที่แล้ว +1

    I feel honored that you used my credentials in your video.

  • @badtrapify
    @badtrapify 4 หลายเดือนก่อน

    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 4 หลายเดือนก่อน

      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.

  • @lostphysicist
    @lostphysicist ปีที่แล้ว +3

    The github link is broken

  • @barreltitor1419
    @barreltitor1419 ปีที่แล้ว

    I'd replace docker with podman

  • @AchwaqKhalid
    @AchwaqKhalid 2 หลายเดือนก่อน

    -DigitalOcean- mini-pc 👨🏻‍💻

  • @sustainablewww6715
    @sustainablewww6715 ปีที่แล้ว +1

    Fantastic video 😊 more of these please.

  • @UweStrempel
    @UweStrempel ปีที่แล้ว +1

    Axum tutorial would be nice.

  • @priyankgupta
    @priyankgupta ปีที่แล้ว

    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.

  • @iva1389
    @iva1389 5 หลายเดือนก่อน

    Fantastic tutorial! Excellent explanation! Thank you!

  • @adrianscarlett
    @adrianscarlett 10 หลายเดือนก่อน

    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.

  • @MadTofan
    @MadTofan ปีที่แล้ว

    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. 😊

  • @aperson4051
    @aperson4051 ปีที่แล้ว

    This was great. Could you do something similar with kubernetes?

  • @lukevanaardt8675
    @lukevanaardt8675 ปีที่แล้ว

    I'd love a full Axum tutorial! Thanks for the great videos!

  • @jamaicandisciples7207
    @jamaicandisciples7207 8 หลายเดือนก่อน

    Well done. Please create tutorial on Axum. Thanks

  • @HunterRoMike
    @HunterRoMike ปีที่แล้ว

    Please make a video series on the Axum framework. Awesoe video, btw!

  • @coffee-is-power
    @coffee-is-power ปีที่แล้ว

    1:44 postman... that's forbidden, must use insomnia..

  • @clayratliff7727
    @clayratliff7727 ปีที่แล้ว +1

    Good video but the link to the repo is broken

  • @skeam_tv
    @skeam_tv ปีที่แล้ว

    action-rs toolchain github action is an unmaintained project btw

  • @flyaruu
    @flyaruu ปีที่แล้ว

    The caching part of the video was kinda rushed, that part deserves its own in depth video

  • @aftalavera
    @aftalavera ปีที่แล้ว

    The boot camp is just starting to sound like the release of Jai!

  • @min2sia
    @min2sia ปีที่แล้ว

    Shuttle is another nice alternative. Exploring it right now.

  • @mygamesm
    @mygamesm ปีที่แล้ว

    may i know what extension gives you the in editor debug errors?

  • @dmitriidemenev5258
    @dmitriidemenev5258 ปีที่แล้ว

    It would be amazing if you mentioned Shuttle.

  • @j.enriqueortegasilvera6570
    @j.enriqueortegasilvera6570 ปีที่แล้ว

    Great video , super useful , in my personal project.

  • @tcurdt
    @tcurdt ปีที่แล้ว

    Please don't use root and password auth this way. 😞

  • @semenivanoff8615
    @semenivanoff8615 11 หลายเดือนก่อน

    Why to deploy to virt machine instead of deploying to container services?!!
    Containers are 10-20 times cheaper than VMs...

  • @tekipeps
    @tekipeps ปีที่แล้ว

    Doesn't this cause downtime?

  • @SyamaMishra
    @SyamaMishra ปีที่แล้ว

    Yes please for an Axum tutorial.

  • @legionfalls
    @legionfalls ปีที่แล้ว

    Would love to see an Axum tutorial!

  • @sighupcmd
    @sighupcmd ปีที่แล้ว +2

    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 ปีที่แล้ว +1

      Hi can you elaborate on this ? thanks in advance

  • @MrPielover19
    @MrPielover19 ปีที่แล้ว

    why axum instead of rocket? personal preference or is there a specific reason?

    • @தமிழோன்
      @தமிழோன் ปีที่แล้ว +2

      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.

  • @thehard-coder9398
    @thehard-coder9398 ปีที่แล้ว

    @letsgetrusty - thanks for creating such a great video. Will this content will be covered in the Bootcamp?

    • @letsgetrusty
      @letsgetrusty  ปีที่แล้ว

      Yes it will!

    • @thehard-coder9398
      @thehard-coder9398 ปีที่แล้ว

      @@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

  • @Light_Akira
    @Light_Akira ปีที่แล้ว

    very nice tutorial!

  • @cedwards1080
    @cedwards1080 ปีที่แล้ว

    Your videos are very well done!

  • @irlshrek
    @irlshrek ปีที่แล้ว

    thanks for this!

  • @digitalfriday
    @digitalfriday ปีที่แล้ว

    excellent

  • @scotty3024
    @scotty3024 ปีที่แล้ว

    One of the most useful videos on this channel!

  • @logeshkumarrajkumar861
    @logeshkumarrajkumar861 ปีที่แล้ว

    Hi Thanks for the video. The githib link is broken.

    • @letsgetrusty
      @letsgetrusty  ปีที่แล้ว +1

      Fixed the link!

    • @logeshkumarrajkumar861
      @logeshkumarrajkumar861 ปีที่แล้ว

      @@letsgetrusty Awesome. You are the best. Looking forward for the Axum video

  • @hos7012
    @hos7012 ปีที่แล้ว

    axum plz

  • @primozpadar
    @primozpadar ปีที่แล้ว

    You could use docker swarm or dokku instead of docker-compose (which us not really meant for producion). Otherwise, really great video!

  • @rHino122295
    @rHino122295 ปีที่แล้ว

    This is an amazing video. Saving for later

  • @haliszekeriyaozkok4851
    @haliszekeriyaozkok4851 ปีที่แล้ว

    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 ปีที่แล้ว +5

      > 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_ ปีที่แล้ว +1

      docker performance is near to native, with noticeable overhead only if you don't use host networking

  • @ybergik
    @ybergik ปีที่แล้ว +1

    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 ปีที่แล้ว

      What are you even saying?

    • @ac130kz
      @ac130kz ปีที่แล้ว

      good luck paying the bills with all those downtimes

    • @DJenriqez
      @DJenriqez ปีที่แล้ว

      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.