Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: refactor and improve speed and caching. add rustls flags to aws-rds #1167

Merged
merged 8 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
248 changes: 161 additions & 87 deletions .circleci/config.yml

Large diffs are not rendered by default.

403 changes: 214 additions & 189 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion DEVELOPING.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,11 @@ In order to test local changes to the library crates, you may want to add the be

```toml
[patch.crates-io]
shuttle-service = { path = "[base]/shuttle/service" }
shuttle-codegen = { path = "[base]/shuttle/codegen" }
shuttle-common = { path = "[base]/shuttle/common" }
shuttle-proto = { path = "[base]/shuttle/proto" }
shuttle-runtime = { path = "[base]/shuttle/runtime" }
shuttle-service = { path = "[base]/shuttle/service" }

shuttle-aws-rds = { path = "[base]/shuttle/resources/aws-rds" }
shuttle-persist = { path = "[base]/shuttle/resources/persist" }
Expand Down
8 changes: 5 additions & 3 deletions cargo-shuttle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ homepage = "https://www.shuttle.rs"
anyhow = { workspace = true }
async-trait = { workspace = true }
bollard = { workspace = true }
cargo-generate = "0.18.3"
cargo_metadata = { workspace = true }
chrono = { workspace = true }
clap = { workspace = true, features = ["env"] }
Expand All @@ -34,12 +35,15 @@ reqwest = { workspace = true, features = ["json"] }
reqwest-middleware = "0.2.0"
reqwest-retry = "0.2.0"
rmp-serde = { workspace = true }
semver = "1.0.17"
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
strum = { workspace = true }
tar = { workspace = true }
tokio = { workspace = true, features = ["macros", "signal"] }
tokio-tungstenite = { version = "0.19.0", features = ["rustls-tls-webpki-roots"] }
tokio-tungstenite = { version = "0.19.0", features = [
"rustls-tls-webpki-roots",
] }
toml = { workspace = true }
toml_edit = { workspace = true }
tonic = { workspace = true }
Expand All @@ -52,8 +56,6 @@ tracing-subscriber = { workspace = true, features = [
url = "2.3.1"
uuid = { workspace = true, features = ["v4"] }
webbrowser = "0.8.2"
semver = "1.0.17"
cargo-generate = "0.18.3"

[dependencies.shuttle-common]
workspace = true
Expand Down
5 changes: 4 additions & 1 deletion deployer/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ touch $CARGO_HOME/config.toml
if [[ $PROD != "true" ]]; then
echo '
[patch.crates-io]
shuttle-service = { path = "/usr/src/shuttle/service" }
shuttle-codegen = { path = "/usr/src/shuttle/codegen" }
shuttle-common = { path = "/usr/src/shuttle/common" }
shuttle-proto = { path = "/usr/src/shuttle/proto" }
shuttle-runtime = { path = "/usr/src/shuttle/runtime" }
shuttle-service = { path = "/usr/src/shuttle/service" }

shuttle-aws-rds = { path = "/usr/src/shuttle/resources/aws-rds" }
shuttle-persist = { path = "/usr/src/shuttle/resources/persist" }
Expand Down
17 changes: 10 additions & 7 deletions e2e/tests/integration/helpers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,18 @@ impl TempCargoHome {
write!(
config,
r#"[patch.crates-io]
shuttle-service = {{ path = "{}" }}
shuttle-codegen = {{ path = "{}" }}
shuttle-common = {{ path = "{}" }}
shuttle-proto = {{ path = "{}" }}
shuttle-runtime = {{ path = "{}" }}
shuttle-service = {{ path = "{}" }}

shuttle-aws-rds = {{ path = "{}" }}
shuttle-metadata = {{ path = "{}" }}
shuttle-persist = {{ path = "{}" }}
shuttle-shared-db = {{ path = "{}" }}
shuttle-secrets = {{ path = "{}" }}
shuttle-static-folder = {{ path = "{}" }}
shuttle-metadata = {{ path = "{}" }}

shuttle-axum = {{ path = "{}" }}
shuttle-actix-web = {{ path = "{}" }}
Expand All @@ -60,20 +63,20 @@ shuttle-thruster = {{ path = "{}" }}
shuttle-tide = {{ path = "{}" }}
shuttle-tower = {{ path = "{}" }}
shuttle-warp = {{ path = "{}" }}"#,
WORKSPACE_ROOT.join("service").display(),
WORKSPACE_ROOT.join("codegen").display(),
WORKSPACE_ROOT.join("common").display(),
WORKSPACE_ROOT.join("proto").display(),
WORKSPACE_ROOT.join("runtime").display(),
WORKSPACE_ROOT.join("service").display(),
WORKSPACE_ROOT.join("resources").join("aws-rds").display(),
WORKSPACE_ROOT.join("resources").join("metadata").display(),
WORKSPACE_ROOT.join("resources").join("persist").display(),
WORKSPACE_ROOT.join("resources").join("shared-db").display(),
WORKSPACE_ROOT.join("resources").join("secrets").display(),
WORKSPACE_ROOT
.join("resources")
.join("static-folder")
.display(),
WORKSPACE_ROOT
.join("resources")
.join("metadata")
.display(),
WORKSPACE_ROOT
.join("services")
.join("shuttle-axum")
Expand Down
13 changes: 8 additions & 5 deletions resources/aws-rds/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ keywords = ["shuttle-service", "rds"]
async-trait = "0.1.56"
paste = "1.0.7"
serde = { version = "1.0.148", features = ["derive"] }
shuttle-service = { path = "../../service", version = "0.24.0" }
sqlx = { version = "0.7.1", features = ["runtime-tokio-native-tls"] }
shuttle-service = { path = "../../service", version = "0.24.0", default-features = false }
sqlx = "0.7.1"

[features]
postgres = ["sqlx/postgres"]
mysql = ["sqlx/mysql"]
mariadb = ["sqlx/mysql"]
postgres = ["sqlx/postgres", "sqlx/runtime-tokio-native-tls"]
postgres-rustls = ["sqlx/postgres", "sqlx/runtime-tokio-rustls"]
mysql = ["sqlx/mysql", "sqlx/runtime-tokio-native-tls"]
mysql-rustls = ["sqlx/mysql", "sqlx/runtime-tokio-rustls"]
mariadb = ["sqlx/mysql", "sqlx/runtime-tokio-native-tls"]
mariadb-rustls = ["sqlx/mysql", "sqlx/runtime-tokio-rustls"]
2 changes: 2 additions & 0 deletions resources/aws-rds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Add `shuttle-aws-rds` to the dependencies for your service. Every engine is behi
| MySql | mysql | shuttle_aws_rds::MySql |
| MariaDB | mariadb | shuttle_aws_rds::MariaDB |

Note: You can also add `-rustls` after the feature flag, `postgres-rustls` etc
jonaro00 marked this conversation as resolved.
Show resolved Hide resolved

An example using the Tide framework can be found on [GitHub](https://github.com/shuttle-hq/shuttle-examples/tree/main/tide/postgres)

### Options
Expand Down
1 change: 1 addition & 0 deletions resources/aws-rds/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![doc = include_str!("../README.md")]
#![allow(unused_imports)]
jonaro00 marked this conversation as resolved.
Show resolved Hide resolved

use async_trait::async_trait;
use paste::paste;
Expand Down