Skip to content

Commit

Permalink
Move xDS and protobuf definitions into separate crates.
Browse files Browse the repository at this point in the history
This commit moves the xDS functionality in its own library, with the
eventual goal of making the xDS component its own library that can be
used by other services, currently this just extracts the functionality
as-is, with the only change being the addition of the
`xds::config::Configuration` trait which abstracts over the usage of
`config::Config` in xDS as I wanted to keep that in the Quilkin library.

The `quilkin-proto` library was also added to allow for the protobuf
definitions to be shared between the xDS library and the quilkin
application.
  • Loading branch information
XAMPPRocky committed May 22, 2024
1 parent 2e15001 commit 0bdd832
Show file tree
Hide file tree
Showing 87 changed files with 561 additions and 338 deletions.
42 changes: 42 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 40 additions & 20 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,24 @@ test = false
[dependencies]
# Local
quilkin-macros = { version = "0.9.0-dev", path = "./crates/macros" }
xds = { path = "crates/xds" }
quilkin-proto = { path = "crates/quilkin-proto" }

# Crates.io
arc-swap = { version = "1.6.0", features = ["serde"] }
arc-swap.workspace = true
async-channel.workspace = true
async-stream = "0.3.5"
async-stream.workspace = true
base64.workspace = true
base64-serde = "0.7.0"
bytes = { version = "1.5.0", features = ["serde"] }
cached = { version = "0.49", default-features = false }
cached.workspace = true
time = { version = "0.3", default-features = false, features = ["std"] }
clap = { version = "4.4.6", features = ["cargo", "derive", "env"] }
dashmap = { version = "5.5.3", features = ["serde"] }
either = "1.9.0"
enum-map = "2.6.3"
eyre = "0.6.8"
fixedstr = { version = "0.5", features = ["flex-str"] }
enum-map.workspace = true
eyre.workspace = true
fixedstr.workspace = true
futures.workspace = true
hyper = { version = "0.14.27", features = ["http2"] }
hyper-rustls = { version = "0.24.1", features = ["http2", "webpki-roots"] }
Expand All @@ -92,32 +94,32 @@ maxminddb = "0.24.0"
notify = "6.1.1"
num_cpus = "1.16.0"
once_cell = "1.18.0"
parking_lot = "0.12.1"
prometheus = { version = "0.13.3", default-features = false }
prost = "0.12.1"
prost-types = "0.12.1"
parking_lot.workspace = true
prometheus.workspace = true
prost.workspace = true
prost-types.workspace = true
rand.workspace = true
regex = "1.9.6"
schemars = { version = "0.8.15", features = ["bytes", "url"] }
schemars.workspace = true
seahash = "4.1"
serde = { version = "1.0.188", features = ["derive", "rc"] }
serde.workspace = true
serde_json.workspace = true
serde_regex = "1.1.0"
serde_stacker = "0.1.10"
serde_yaml = "0.9.25"
snap = "1.1.0"
socket2.workspace = true
stable-eyre = "0.2.2"
thiserror = "1.0.49"
thiserror.workspace = true
tokio.workspace = true
tokio-stream = { version = "0.1.14", features = ["net", "sync"] }
tonic = "0.10.2"
tokio-stream.workspace = true
tonic.workspace = true
tracing.workspace = true
tracing-futures = { version = "0.2.5", features = ["futures-03"] }
tracing-futures.workspace = true
tracing-subscriber = { workspace = true, features = ["json", "env-filter"] }
tryhard = "0.5.1"
tryhard.workspace = true
url = { version = "2.4.1", features = ["serde"] }
uuid = { version = "1.4.1", default-features = false, features = ["v4"] }
uuid.workspace = true
lasso = { version = "0.7.2", features = ["multi-threaded"] }
kube.workspace = true
kube-core.workspace = true
Expand Down Expand Up @@ -168,8 +170,14 @@ debug = true
members = [".", "crates/*"]

[workspace.dependencies]
arc-swap = { version = "1.6.0", features = ["serde"] }
async-channel = "2.1.0"
async-stream = "0.3.5"
base64 = "0.21.0"
cached = { version = "0.49", default-features = false }
eyre = "0.6.8"
enum-map = "2.6.3"
futures = "0.3.28"
kube = { version = "0.91", features = [
"runtime",
"rustls-tls",
Expand All @@ -179,12 +187,18 @@ kube-core = { version = "0.91", default-features = false, features = [
"schema",
] }
k8s-openapi = { version = "0.22", features = ["v1_29", "schemars"] }
futures = "0.3.28"
once_cell = "1.18.0"
prometheus = { version = "0.13.3", default-features = false }
prost = "0.12.1"
prost-types = "0.12.1"
quilkin = { path = "." }
rand = "0.8.5"
serde = { version = "1.0.188", features = ["derive", "rc"] }
serde_json = "1.0.107"
socket2 = { version = "0.5.4", features = ["all"] }
tempfile = "3.8.0"
thiserror = "1.0.49"
tokio-stream = { version = "0.1.14", features = ["net", "sync"] }
tokio = { version = "1.32.0", features = [
"rt-multi-thread",
"fs",
Expand All @@ -193,6 +207,12 @@ tokio = { version = "1.32.0", features = [
"parking_lot",
"tracing",
] }
tempfile = "3.8.0"
tonic = "0.10.2"
tracing = "0.1.37"
tracing-futures = { version = "0.2.5", features = ["futures-03"] }
tracing-subscriber = "0.3"
tryhard = "0.5.1"
uuid = { version = "1.4.1", default-features = false, features = ["v4"] }
fixedstr = { version = "0.5", features = ["flex-str"] }
parking_lot = "0.12.1"
schemars = { version = "0.8.15", features = ["bytes", "url"] }
2 changes: 1 addition & 1 deletion crates/proto-gen/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ fn execute(which: &str) {
.arg("--generate-transport")
.args(["--disable-comments", "."])
.arg(which)
.args(["-o", "src/generated"]);
.args(["-o", "crates/quilkin-proto/src/generated"]);

for (dir, files) in files {
cmd.arg("-d");
Expand Down
11 changes: 11 additions & 0 deletions crates/quilkin-proto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "quilkin-proto"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
prost.workspace = true
prost-types.workspace = true
tonic.workspace = true
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions crates/quilkin-proto/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#![allow(
clippy::doc_markdown,
clippy::use_self,
clippy::enum_variant_names,
clippy::large_enum_variant,
clippy::len_without_is_empty,
rustdoc::bare_urls
)]
pub mod envoy;
pub mod google;
pub mod quilkin;
pub mod validate;
pub mod xds;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
34 changes: 34 additions & 0 deletions crates/xds/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[package]
name = "xds"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
quilkin-proto = { path = "../quilkin-proto" }

arc-swap.workspace = true
async-stream.workspace = true
cached.workspace = true
enum-map.workspace = true
eyre.workspace = true
futures.workspace = true
once_cell.workspace = true
prometheus.workspace = true
rand.workspace = true
prost.workspace = true
prost-types.workspace = true
serde.workspace = true
serde_json.workspace = true
schemars.workspace = true
fixedstr.workspace = true
parking_lot.workspace = true
thiserror.workspace = true
tokio-stream.workspace = true
tokio.workspace = true
tonic.workspace = true
tracing-futures.workspace = true
tracing.workspace = true
tryhard.workspace = true
uuid.workspace = true
Loading

0 comments on commit 0bdd832

Please sign in to comment.