Skip to content

Releases: shuttle-hq/shuttle

v0.10.0

13 Feb 17:55
4668291
Compare
Choose a tag to compare

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 to cargo 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 to tempfile, 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

Full Changelog: v0.9.0...v0.10.0

v0.9.0

27 Jan 18:13
79ff57e
Compare
Choose a tag to compare

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, like dashmap , 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 the loading or building 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

Pull requests for this release

Full Changelog: v0.8.1...v0.9.0

v0.8.0

16 Dec 09:29
2956292
Compare
Choose a tag to compare

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

https://github.com/shuttle-hq/shuttle/raw/main/assets/v0.8.0-interactive-init.gif

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 = "[email protected]: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

Pull Requests for this release

Full Changelog: v0.7.2...v0.8.0

v0.7.2

28 Oct 08:29
5fd6e40
Compare
Choose a tag to compare

Bugs 🐞

  • [#430] Improve context for errors
  • [#427] Reduce CPU footprint by doing our own health checks
  • [#428] Clear folder of old deploy files before deploying new version

v0.7.1

24 Oct 09:18
65b71c8
Compare
Choose a tag to compare

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

17 Oct 20:58
5d2215b
Compare
Choose a tag to compare

Features 🚀

  • [#358] (@christoshadjiaslanis) Add field to Cargo.toml to avoid accidental publishing of services
  • [#403] Build production deploys in release mode
  • [#389] (@trezm) Thruster framework support

Bugs 🐞

  • [#401] Error logs not showing

v0.6.0

13 Oct 16:04
Compare
Choose a tag to compare

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:

  1. We reserved old project names that have already been taken to allow their owners to reclaim them.
  2. 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

09 Sep 15:39
0c55a15
Compare
Choose a tag to compare

Bugs 🐞

  • [#332] Make sure the service loader updates the state of the DB deployment even when the deployment fails mid-way

Misc 🌱

  • [#335] Helpful errors when secrets are not found on service startup
  • [#330] Migrate the build and load backend infra to amd64 (away from arm64)

v0.5.1

31 Aug 13:41
b43536a
Compare
Choose a tag to compare

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 🤛

v0.5.0

19 Aug 05:43
1d1ba78
Compare
Choose a tag to compare

Features 🚀

#[shuttle_service::main]
async fn main(
    #[shared::MongoDb] db: Database, // Get a shared MongoDB
) -> shuttle_service::ShuttlePoem<impl poem::Endpoint> {
    ...
}

Misc 🌱

  • [#277] Migrated to CircleCI
  • [#308] Table of contributors in README.md