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