Hi everyone!
Looking to build a cargo workspace with multiple microservices and shared dependencies.
Right now we use a bunch of redundant dockerfiles chained together with docker compose. Even though we're using multistage builds with cargo-chef, it can still take over an hour to build 8 backend services when the profile is set to release.
Full disclosure: not a rustacean, just tasked with optimizing the ci/cd pipeline 😅
# workspace cargo.toml
[workspace]
members = ["rest/webhooks-service", "rest/storage-service", "rest/location-service", "kafka/one-fish-consumer", "kafka/two-fish-consumer", "kafka/red-fish-consumer", "kafka/blue-fish-consumer","cli/sql_transfer", "cli/utilities"]
resolver = "1"
[workspace.dependencies]
internal_deps = { path = "internal_deps" }
# internal_deps cargo.toml
[package]
name = "internal_deps"
version = "0.1.4"
edition = "2021"
[dependencies]
anyhow = "1.0.0"
base64 = "0.21.0"
chrono = { version = "0.4.38", features = ["serde"] }
dotenv = "0.15.0"
futures = "0.3.30"
log = "0.4.22"
mongodb = "2.3.0"
num-traits = "0.2.16"
once_cell = "1.17.1"
openapi = {path = "twilio-rust"}
rdkafka = "0.28.0"
redis = "0.22.3"
regex = "1.10.2"
reqwest = {version = "0.11.13", features = ["json"]}
rocket = "=0.5.0-rc.3"
serde = {version = "1.0.144", features = ["derive"]}
serde_json = "1.0.85"
slog = "2.7.0"
slog-async = "2.8.0"
slog-json = "2.6.1"
slog-scope = "4.4.0"
slog-stdlog = "4.1.0"
sqlx = "0.7.1"
tiberius = { version = "0.12.2", features = [] }
tiberius-mappers = "0.6.0"
tokio = "1.21.0"
tokio-util="0.7.10"