Releases: shuttle-hq/shuttle
v0.10.0
shuttle: v0.10.0 update
We're excited to release shuttle v0.10.0! 🚀
Here are the highlights in this update.
Local secrets
We now support setting secrets for the local development environment, meaning for cargo shuttle run
. To use local secrets, simply create a Secrets.dev.toml
file, and this will only be used for local runs. If you want to use some of the same secrets in prod and dev, you'll need to have them in both files. Thanks a lot @joshua-mo-143! #610
Binstall support
For 0.9.0
we published our first pre-built releases, but there was a compatibility issue with cargo-binstall. That has been resolved, and binstall is now supported! We have also added the x86_64-unknown-linux-gnu
target. #608
The following targets are supported as of 0.10
:
- x86_64-unknown-linux-musl
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- x86_64-pc-windows-msvc
- x86_64-apple-darwin
And more
- To improve project creation stability, we have added three new project states that ensure containers that fail to start will automatically retry, and that containers that become unhealthy will attempt to restart. #620
- Renamed
cargo shuttle delete
tocargo shuttle stop
, to more accurately reflect its purpose, and also fixed the foreign key error it would return. Thanks @jdrouet! #619 - Added a
cargo shuttle logout
command that clears the shuttle API-key from your environment, thanks @joshua-mo-143: #595 - Added a flag to
cargo shuttle run
that allows running locally in the release profile:cargo shuttle run --release
. Thanks @gautamprikshit1! #611 - Local runs now respect the
$PORT
environment variable, thanks @canac! #571
Misc
- Migrated our uses of the
tempdir
crate totempfile
, thanks @gautamprikshit! #603
How to upgrade
If you had a project on shuttle, then you will need to manually update the version to 0.10.0
in your Cargo.toml
. You may also need to update the versions of your shuttle resources to 0.10.0
.
To upgrade your project container:
# this will not delete any databases, and you will keep your project name
cargo shuttle project rm # to remove your project
cargo shuttle project new # to recreate your project
cargo shuttle deploy # redeploy your service
To upgrade your shuttle CLI, simply run cargo install cargo-shuttle
, or if you’re using [cargo-binstall](https://github.com/cargo-bins/cargo-binstall), cargo binstall cargo-shuttle
.
New Contributors
Contributions for this release
- Fix: bin builds tag persistence by @oddgrd in #605
- fix: add repo url to cargo-shuttle for binstall by @oddgrd in #608
- feat: add logout function by @joshua-mo-143 in #595
- Release flag by @gautamprikshit1 in #611
- Tempdir by @gautamprikshit1 in #603
- Respect $PORT environment variable by @canac in #571
- feat: rename delete to stop by @jdrouet in #619
- feat: retry on bollard errors by @chesedo in #620
- bug: make Stopped a sink state by @chesedo in #624
- feat: add dev/prod secrets functionality by @joshua-mo-143 in #610
- feat: show progress bar on stopping service by @oddgrd in #628
- chore: update examples submodule by @oddgrd in #626
- Chore: v0.10.0 by @oddgrd in #625
Full Changelog: v0.9.0...v0.10.0
v0.9.0
shuttle: v0.9.0 update
We're excited to release shuttle v0.9.0! 🚀
Here are the highlights in this update.
Poise support
Shuttle now has a Poise integration for building command-based discord bots with ease. Check out the new example here. Thanks to @Anafabula for their first contribution to shuttle!
Binary distributions
Shuttle will now include pre-built binaries for cargo-shuttle
with every release, meaning rather than installing the CLI with cargo install cargo-shuttle
you can now simply download the binary for your OS, put it in your .cargo/bin
folder and you’re good to go!
If you’d prefer a simple tool for this, you can also install the binary using [cargo-binstall](https://github.com/cargo-bins/cargo-binstall).
Note: The current binary paths are incompatible with cargo-binstall
(this will be fixed for the next release), so to install with it you need to add some additional flags: cargo binstall cargo-shuttle --pkg-url="https://github.com/shuttle-hq/shuttle/releases/download/v0.9.0/cargo-shuttle-v0.9.0-8-gf75c2e9-<target>.tar.gz" --bin-dir="shuttle/cargo-shuttle" --pkg-fmt="tgz"
. Remember to add .exe
to the end of bin-dir
if you're using the windows binary.
The following targets will be supported as of 0.9
:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-musl
- x86_64-pc-windows-msvc
- x86_64-apple-darwin
Expose your shuttle app to your local network
You can now pass the --external
flag to cargo shuttle run
, this will run your app on 0.0.0.0:8000
, exposing your app to your local network. If you’re serving a static website from your app, this makes it easy to open it up on your phone to see that the styling is correct across devices. Thanks to @joshua-mo-143 for this cool new feature!
Override local run database URIs
You can now pass in a local URI as an argument to the shuttle DB resources, allowing you to opt out of the default spawning of a docker container for your local DB. When you set the local_uri
, you can also insert secrets from Secrets.toml
using string interpolation: #596, #597
#[shuttle_service::main]
async fn axum(
#[shuttle_shared_db::Postgres(
local_uri = "postgres://postgres:{secrets.PASSWORD}@localhost:5432/postgres"
)] pool: PgPool) -> ShuttleAxum { ... }
And more
- Added a
cargo shuttle feedback
command that opens a browser on the create new issue page of the shuttle repo, thanks @gautamprikshit1: #592
Bug fixes
- Fixed a bug where using crates with a
rust-toolchain
override, likedashmap
, would lead to errors in deployment: #545 - Fixed a bug where deployer was persisting incorrect historical states, so when doing
cargo shuttle deployment list
users would see deployments that appeared to be stuck in theloading
orbuilding
state: #548
How to upgrade
If you had a project on shuttle, then you will need to manually update the version to 0.9.0
in your Cargo.toml
. You may also need to update the versions of your shuttle resources to 0.9.0
.
To upgrade your project container:
# this will not delete any databases, and you will keep your project name
cargo shuttle project rm # to remove your project
cargo shuttle project new # to recreate your project
cargo shuttle deploy # redeploy your service
To upgrade your shuttle CLI, simply run cargo install cargo-shuttle
or install from the binary releases, see instructions near the top of this release.
New Contributors
- @joshua-mo-143 made their first contribution in #555
- @emmakuen made their first contribution in #553
- @alekspickle made their first contribution in #556
- @Anafabula made their first contribution in #560
- @gautamprikshit1 made their first contribution in #570
Pull requests for this release
- test: fixes by @chesedo in #554
- Refactor: remove deprecated auth command by @oddgrd in #550
- ci: add Makefile command for Windows to convert .sh files to LF format by @joshua-mo-143 in #555
- Fix: dependencies compiled with incompatible versions of rustc by @oddgrd in #545
- feat: create subcommand to list all projects of calling account by @emmakuen in #553
- bug: deployer drifting state by @chesedo in #548
- ci: fix bin builds by @oddgrd in #546
- docs: update contributing by @alekspickle in #556
- feat: Support Poise by @Anafabula in #560
- feat: add flag for router IP local run by @joshua-mo-143 in #565
- bug: no networks by @chesedo in #541
- feat: local uri by @chesedo in #596
- feat: allow string interpolation on resource options by @chesedo in #597
- Upgraded to clap v4 by @gautamprikshit1 in #570
- feat: build prod images in release profile by @oddgrd in #590
- added feedback by @gautamprikshit1 in #592
- refactor: hide some pg catalogs by @chesedo in #593
- chore: update examples submodule by @oddgrd in #601
- chore: v0.9.0 by @oddgrd in #600
Full Changelog: v0.8.1...v0.9.0
v0.8.0
We're excited to release shuttle v0.8.0! 🚀
Here are the highlights in this update.
Better scaffolding
The CLI now has a completely interactive starter flow (thanks @Procrat and @guerinoni!)
Static files
You can now send a local folder from your source files to deployed services.
Just add the shuttle-static-folder
crate to your Cargo.toml
:
[dependencies]
shuttle-service = { version = "0.8.0" }
shuttle-static-folder = { version = "0.8.0" }
and add the #[shuttle_static_folder::StaticFolder]
annotation to a PathBuf
argument in your service's main:
use shuttle_static_folder::StaticFolder;
#[shuttle_service::main]
async fn main(
#[StaticFolder(folder = "/public")] static: PathBuf,
) -> _ { ... }
This will mount a folder in the service's runtime and populate it with the content of the local directory /public
. If you don't specify the value of the folder
parameter, the default is /static
. Head over [to the docs](https://docs.shuttle.rs/resources/shuttle-static-folder) to learn more about this plugin.
Public dependencies
The Cargo.toml
file of your shuttle services can now accept any public dependency that can be pulled on deployment - not just [crates.io](http://crates.io/) ones. This means, for example, that you can deploy with git dependencies:
[dependencies]
shuttle-service = { version = "0.8.0" }
strum = { git = "git@github.com:shuttle-hq/strum.git" }
And more!
- We now support Actix Web, thanks @biryukovmaxim!
- We have bumped our supported Rust version to 1.65, and our pinned tokio version to 1.22
- We have bumped all of our dependencies, including our integrations. A few of you will need to upgrade as well, for example Axum users will have to upgrade to
0.6
to use the latest version of shuttle-service with the axum integration. - We fixed issues for certain projects that would lead them to not report their readiness state correctly
- We've added a redeployment strategy that kicks in if projects stop responding, making them more resilient to unexpected panics
How to upgrade
If you had a project on shuttle, then you will need to manually update the version to 0.8.0
in your Cargo.toml
. You may also need to update the versions of your shuttle resources to 0.8.0
.
To upgrade your project container:
cargo shuttle project rm // to remove your project
cargo shuttle project new // to recreate your project
cargo shuttle deploy // redeploy your service
To upgrade your shuttle CLI, simply run cargo install cargo-shuttle
.
New Contributors
- @Procrat made their first contribution in #498
- @Nereuxofficial made their first contribution in #477
- @biryukovmaxim made their first contribution in #491
- @guerinoni made their first contribution in #502
Pull Requests for this release
- feat: link the tracing spans between services by @chesedo in #445
- Add docker-compose extra flags param in Makefile by @brokad in #446
- misc: restructure repo by @chesedo in #453
- refactor: tf files are now in shuttle-hq/terraform-aws-shuttle by @brokad in #449
- fix: wrap around common::ProjectName for parsing by @brokad in #451
- fix: gateway state drifts, health checks and project recreation by @brokad in #447
- misc: add more helpful flags to Makefile by @brokad in #456
- misc: remove old migrator by @chesedo in #463
- feat(gateway): add account_tier column by @brokad in #458
- feat: prefetch shuttle-service crates by @chesedo in #461
- Feat: revive via gateway endpoint by @oddgrd in #460
- feat: create a new admin cli binary crate by @chesedo in #462
- fix: broken link by @oddgrd in #467
- fix: add timeout to health checks by @brokad in #468
- feat(gateway): add custom domains table and routing by @akrantz01 in #465
- WIP feat: count recent start events before restart by @oddgrd in #469
- feat: make deployer only answer its own project by @chesedo in #466
- Fixed Links in Readme by @Nereuxofficial in #477
- refactor: base client error off response status code by @chesedo in #470
- feat: verify project exists before sending destroy task by @oddgrd in #474
- feat: add a custom domains admin route by @chesedo in #473
- bug: deployer freezes by @chesedo in #478
- ci: green by @chesedo in #482
- feat: TLS acceptor with SNI resolver by @brokad in #471
- fix: custom domain routing by @brokad in #484
- refactor: more metrics by @chesedo in #475
- misc: configurable deployment tags by @brokad in #486
- feat: restore removed containers by @brokad in #485
- fix: backend bumps and hot fixes by @brokad in #487
- Feature/support actix web by @biryukovmaxim in #491
- Doc: Fix command to prime database with docker-compose by @guerinoni in #502
- Doc: Improve contributing documentation by @guerinoni in #499
- feat: static file support for a single folder by @chesedo in #501
- ci: build binary by @chesedo in #483
- feat: bump rust to 1.64, bump dependencies by @oddgrd in #495
- feat: interactive project initialization by @Procrat in #498
- feat: bump pinned rust version to 1.65 by @oddgrd in #504
- misc: env updates by @chesedo in #509
- feat: make the folder configurable by @chesedo in #508
- feat: implement workspace inheritance by @oddgrd in #506
- refactor: switch away from cargo package by @chesedo in #507
- Add spinner wait for
project new
andproject status --follow
by @guerinoni in #503 - fix: capitalise correctly by @brokad in #511
- fix: make nice by @brokad in #512
- feat: find (soon to be) invalid project names by @chesedo in #479
- refactor: missed axum 0.6 update by @chesedo in #513
- feat: build tests in release profile, limit build workers by @oddgrd in #514
- feat: create
init
project from correct dir by @oddgrd in #518 - misc: interactive init gif by @brokad in #519
- Feat/set examples submodule to main by @oddgrd in #520
- chore: 0.8.0 by @oddgrd in #521
- chore: bump examples by @brokad in #522
- bug: hacking static folders by @chesedo in #524
- fix: actix integration with state by @oddgrd in #523
- chore: release v0.8.0 by @brokad in #528
Full Changelog: v0.7.2...v0.8.0
v0.7.2
v0.7.1
Features 🚀
- [#411 and #415] Limit memory used by projects
- [#343] (@XyLyXyRR) Generate shell completion using
cargo shuttle generate
Bugs 🐞
- [#409] Prevent
cargo shuttle
from panicking when config can't be accessed - [#410 and #412] Fix restart issues of the shuttle infrastructure
- [#416]
transport error
showing up during deploys - [#422]
Secrets.toml
not being packaged because of.gitignore
- [#423] Deploys bigger than 32 768 bytes not uploading
v0.7.0
v0.6.0
Features 🚀
- A new
cargo shuttle project
command (See important changes below) - [#214] (@marioidival) Checking the version service side in order to reduce amount of crashes
- [#334] Salvo framework support
- [#306] (@Butch78) Persistence storage resource
- [#276] Options support for resource attributes
This will allow resources to take in options like so:#[shuttle_service::main] async fn poem(#[shared::Postgres(size = "10Gb", public = false)] pool: PgPool) -> ShuttlePoem { // ----------------------------- Options that will be passed to builder }
- [#273] Make resources plugin-able (See breaking changes)
- [#324] (@coszio) Switch to
tracing
which allows for more structured logs - [#326] (@jmwill86) Warp framework support
Bugs 🐞
- [#348] Locking down the tokio version to prevent seg faults
Important changes ❗
New project subcommand
This release introduces a model to segregate user projects from one another. This allows for improved security as projects will no longer be able to access the filesystem to see other projects. It also enhances the stability of shuttle as a rogue project crashing can no longer bring down other projects.
All new projects now have the following deployment flow:
cargo shuttle project new // Run only once for new projects
cargo shuttle project status // Until the project is "ready"... We will soon remove this extra step
cargo shuttle deploy // As often as there are new code changes
Other new subcommands
cargo shuttle deployment
All deployments for a project can now be managed with the new cargo shuttle deployments
subcommand. This will also list all resources and secrets linked to a deployment.
cargo shuttle secrets
Secrets can also be viewed using cargo shuttle secrets
and finally cargo shuttle delete
now stops the currently active deployment
Projects vs Services vs Deployments
This release defines these terms better for shuttle:
- A user can have multiple projects. Ie projects are the same as a cargo workspace and all projects are managed inside an isolated container
- In theory, a project can have multiple services. The support for running multiple services exists but its detection is not currently working
- And then each service can have multiple deployments, but only one deployment can be active at a time. Ie after setting up all the resources for a new deployment, we stop all running deployments for the service while also starting up the new deployment
Plug in resources
Resources like DBs and secrets that used do be behind feature flags are now independent crates of their own. This allows the community to create 3rd-party resources without having to wait for official shuttle support.
The old attributes on the main function for these resources need to change as follows:
Old attribute | New attribute |
---|---|
shared::Postgres | shuttle_shared_db::Postgres |
shared::MongoDb | shuttle_shared_db::MongoDb |
aws::rds::Postgres | shuttle_aws_rds::Postgres |
aws::rds::MySql | shuttle_aws_rds::MySql |
aws::rds::MariaDB | shuttle_aws_rds::MariaDB |
persist | shuttle_persist::Persist |
And in Cargo.toml
their feature flags on shuttle_service
needs to be replaced with the following crates:
Old feature flag | Extra crate definition |
---|---|
sqlx-postgres | shuttle-shared-db = { version = "0.6.0", features = ["postgres"] } |
mongo-integration | shuttle-shared-db = { version = "0.6.0", features = ["mongo"] } |
sqlx-aws-postgres | shuttle-aws-rds = { version = "0.6.0", features = ["postgres"] } |
sqlx-aws-mysql | shuttle-aws-rds = { version = "0.6.0", features = ["mysql"] } |
sqlx-aws-mariadb | shuttle-aws-rds = { version = "0.6.0", features = ["mariadb"] } |
secrets | shuttle-secrets = "0.6.0" |
persist | shuttle-persist = "0.6.0" |
New major version
This version has many changes in it and we decided not to automatically restore old projects. Here is what we have done:
- We reserved old project names that have already been taken to allow their owners to reclaim them.
- We restored everything in databases so your data won't be lost. We might just have missed any data changes that happened during the migration
What do you have to do
If you had a project on shuttle, then you will need to manually update the version to v0.6.0
in your Cargo.toml
. You may also need to update your use of resources as outlined above. Then, finally, run:
cargo shuttle project status // to confirm the project still below to you (in should be in a "errored" state)
cargo shuttle project rm // to release the project back into the pool of available project names
cargo shuttle project new // to claim your project again
cargo shuttle project status // until the project is in the "ready" state
cargo shuttle deploy
v0.5.2
v0.5.1
Features 🚀
- [#316] Respect
RUST_LOG
a bit more for local runs (cargo shuttle run
) - [#303][@oddgrd] Discord bot support using the serenity framework
Bugs 🐞
- [#312][@jmwill86] Rework profanity checker to be more lenient
- [#314][@coszio] Fix rocket version for
cargo shuttle init --rocket
- [#317] Fix secrets not being used for local runs (
cargo shuttle run
)
Misc 🌱
- [#311] Upgrade to sqlx v0.6.0 and Rust 1.63.0
- [#278][@kianmeng] Fix general typos all over the place
Thanks to all the contributors for the new features and bug fixes 🤛