Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
e591e54
Start logging before loading config
oarcas-huawei Dec 16, 2024
fd48dc5
Clear backlog of clippy warnings
Mar 6, 2025
814a88d
Fix logical errors for slow arriving ClientHello
akhwi Feb 28, 2025
7f6b556
Keep task alive when no data available
akhwi Mar 5, 2025
f644cd0
rename traits, allow for context on options
Nov 12, 2024
6af16c9
Fix NACK not sent for malformed xDS messages with decoding errors
akhwi Mar 3, 2025
aada845
Refactor xDS client.rs to improve readability
akhwi Mar 4, 2025
d8c28eb
Add orion-format module with Envoy grammar and token parsing
awgn May 12, 2025
afd6ecd
Add benchmarking and context evaluation for request formatting
awgn May 12, 2025
1ee7f1e
Add response context support to log formatter
awgn May 12, 2025
eefdf49
Add `smol_str` dependency and refactor to use `SmolStr`
awgn May 12, 2025
99ff0a5
Replace Cow with SmolCow for optimized string handling
awgn May 13, 2025
e7e37d7
Add support for start and end context in log formatting
awgn May 13, 2025
8f0d502
Refactor context structs and add write_to method for LogFormatter
awgn May 13, 2025
ccff658
Refactor LogFormatter to remove FormatType and simplify try_new method
awgn May 13, 2025
2dd8016
Minor code improvements.
awgn May 13, 2025
2f3e0e0
Add benchmark for pure rust format!
awgn May 13, 2025
91f851f
Deprecating the annotation of the orginal placeholder for performance
awgn May 13, 2025
fc75574
Improvements to Rust format bench
May 13, 2025
bd14964
Rename envoy module to grammar for clarity
awgn May 14, 2025
b974180
Optimize benchmark profile for performance
awgn May 14, 2025
a1d6d72
Refactor context types and benchmarks for clarity
awgn May 14, 2025
d77a712
Benchmark updated.
awgn May 14, 2025
b73234d
Add benchmark for full clone in Rust format
awgn May 14, 2025
eefbb4d
Add category support to context and grammar parsing
awgn May 14, 2025
1dfc837
Improve rfc3339 DateTime format with SmolStrBuilder.
awgn May 14, 2025
dd6128e
Benchmark tests updated.
awgn May 16, 2025
6dad024
Refactor token handling to simplify argument structure
awgn May 16, 2025
8482fa1
Code improvements.
awgn May 16, 2025
2a5e6de
Refactor `eval_format` to use mutable `LogFormatter`
awgn May 16, 2025
96a3d8d
Add format-test binary for benchmarking log formatting
awgn May 16, 2025
d4ace4c
Use itoa for integer formatting in context evaluation
awgn May 16, 2025
d16ed5a
Refactor `format_system_time` to simplify and remove helpers
awgn May 16, 2025
e0a2913
Add upstream context and response flags to log formatting
awgn May 16, 2025
ebb0ae1
Refactor string handling to use unified StringType enum
awgn May 16, 2025
3f8576e
Add support for X-Envoy-Original-Path header in request context
awgn May 19, 2025
3a93b03
Refactor response flags handling and improve logging
awgn May 19, 2025
183bd1f
Miscellaneous Updates
awgn May 20, 2025
824db7a
Refactor error handling for format parsing
awgn May 20, 2025
75255e8
Performance improvements.
awgn May 21, 2025
46ba212
Replace mutable references with RefCell to allow interior mutability
awgn May 21, 2025
1c1387e
Refactor LogFormatter to use LogFormatterCell
awgn May 22, 2025
ee729e4
Remove LogFormatterCell, unsuitable for easy use in the Tokyo context.
awgn May 22, 2025
087d2fe
Update Cargo.lock and refactor authority handling
awgn May 22, 2025
127903c
Refactor LogFormatter to use FormattedMessage for output
awgn May 23, 2025
bdf32da
Fix formatting of DEFAULT_ENVOY_FORMAT string
awgn May 23, 2025
b89ef05
Update dependencies Cargo.lock to resolve audit issues
akhwi May 23, 2025
2eb5e92
Few minor clippy fixes.
awgn May 23, 2025
965948e
Update DownstreamRequest and DownstreamResponse to return "-" for Non…
awgn May 26, 2025
f7fac76
Implement UnwrapClippyWorkaround trait to replace unwrap calls with s…
awgn May 26, 2025
e5b7e18
Additional clippy adjustments.
awgn May 26, 2025
c00a81c
Update cargo fmt.
awgn May 26, 2025
aab9570
Update DownstreamRequest and DownstreamResponse to return "-" for Non…
awgn May 26, 2025
51d61a2
Update for cargo fmt.
awgn May 26, 2025
581c18c
Refactor header value handling to use either strings or bytes.
awgn May 26, 2025
b6951b1
Add benchmark for log headers and improve error messages
awgn May 27, 2025
d43f3a2
Websocket Support
akhwi May 29, 2025
68d904b
Changes, formatting and cleaning some
May 29, 2025
bf9aa1a
Add Service Runtime.
awgn May 30, 2025
38849ed
Fixing clippy warnings.
fciaccia May 30, 2025
3e67ec8
Add Clone trait to bootsrap configuration and refactor ServiceInfo
awgn May 29, 2025
9b19972
Update dependencies and clean up imports.
fciaccia Aug 21, 2025
22301c9
Refactor Cargo.toml.
fciaccia Aug 22, 2025
9b97fe9
Cargo fmt and minor miscellanous fixes.
fciaccia Aug 25, 2025
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
559 changes: 427 additions & 132 deletions Cargo.lock

Large diffs are not rendered by default.

192 changes: 103 additions & 89 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,119 +4,133 @@ members = [
"orion-configuration",
"orion-data-plane-api",
"orion-error",
"orion-format",
"orion-lib",
"orion-proxy",
"orion-xds",
]


resolver = "2"


[workspace.package]
description = "Orion Proxy is a cloud native proxy. Orion Proxy is configurable via Envoy xDS protocol"
edition = "2021"
license-file = "./LICENSE"
rust-version = "1.84"
version = "0.1.0"



[workspace.dependencies]
envoy-data-plane-api = { path = "envoy-data-plane-api" }
orion-configuration = { path = "orion-configuration" }
orion-configuration = { path = "orion-configuration" }
orion-data-plane-api = { path = "orion-data-plane-api" }
orion-error = { path = "orion-error" }
orion-lib = { path = "orion-lib" }
orion-xds = { path = "orion-xds" }

orion-error = { path = "orion-error" }
orion-format = { path = "orion-format" }
orion-lib = { path = "orion-lib" }
orion-xds = { path = "orion-xds" }

abort-on-drop = "0.2"
bytes = "1"
compact_str = { version = "0.8.0", features = ["serde"] }
enum_dispatch = "0.3.13"
abort-on-drop = "0.2"
bytes = "1"
compact_str = { version = "0.8.0", features = ["serde"] }
exponential-backoff = "1.2.0"
futures = "0.3"
http = "1.0"
http-body = "1.0"
http-body-util = "0.1.0"
hyper-util = { version = "0.1.3", features = ["full"] }
num_cpus = "1"
parking_lot = "0.12.3"
prost = "0.13"
prost-build = "^0.13"
prost-reflect = { version = "0.14", features = ["derive", "serde"] }
regex = "1.10.2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_yaml = "0.9.34"
thiserror = "2.0"
tokio = { version = "1.41", features = ["full"] }
tokio-stream = { version = "0.1.17", features = ["net", "sync"] }
tonic = "^0.12"
tonic-build = "^0.12"
tonic-health = "^0.12"
tower = { version = "0.5.1", features = ["make"] }
tracing = "0.1"
tracing-subscriber = "0.3"
tracing-test = { version = "0.2", features = ["no-env-filter"] }
url = "2"
futures = "0.3"
http = "1.0"
http-body = "1.0"
http-body-util = "0.1.0"
hyper-util = { version = "0.1.15" }
num_cpus = "1"
ppp = "2.3"
prost = "0.13"
prost-build = "^0.13"
prost-reflect = { version = "0.14", features = ["derive", "serde"] }
regex = "1.10.2"
serde = { version = "1", features = ["derive", "rc"] }
serde_json = { version = "1" }
serde_yaml = "0.9.34"
thiserror = "1.0.57"
tokio = { version = "1.37", features = ["full"] }
tokio-stream = { version = "0.1.15", features = ["net", "sync"] }
tonic = "^0.12"
tonic-build = "^0.12"
tonic-health = "^0.12"
tower = { version = "0.5.1", features = ["make"] }
tracing = "0.1"
tracing-subscriber = "0.3"
tracing-test = { version = "0.2", features = ["no-env-filter"] }
url = "2"


[profile.release]
codegen-units = 1
debug = false
codegen-units = 1
debug = false
debug-assertions = false
incremental = false
lto = true
opt-level = 3
overflow-checks = false
panic = 'unwind'
rpath = false
strip = "debuginfo"
incremental = false
lto = true
opt-level = 3
overflow-checks = false
panic = 'unwind'
rpath = false
strip = "debuginfo"

[profile.release-debuginfo]
debug = "full"
inherits = "release"
debug = "full"
inherits = "release"
split-debuginfo = "packed"
strip = false
strip = false

[profile.release-dhat]
debug = 1
debug = 1
inherits = "release"

[profile.bench]
inherits = "release"

[workspace.lints.clippy]
correctness = { level = "deny", priority = 10 }
disallowed-methods = "deny"
expect_used = "warn" # FIXME this should be deny
panic = "warn" # FIXME this should be deny
todo = "deny"
transmute_ptr_to_ptr = "deny"
correctness = { level = "deny", priority = 10 }
disallowed-methods = "deny"
expect_used = "warn" # FIXME this should be deny
panic = "warn" # FIXME this should be deny
todo = "deny"
transmute_ptr_to_ptr = "deny"
unchecked_duration_subtraction = "deny"
unused_async = "deny"
unwrap_used = "deny"
unused_async = "deny"
unwrap_used = "deny"

# A subset of pedantic as warn
cast_lossless = "warn"
cast_possible_truncation = "warn"
cast_possible_wrap = "warn"
cast_precision_loss = "warn"
cast_ptr_alignment = "warn"
cast_sign_loss = "warn"
checked_conversions = "warn"
if_then_some_else_none = "warn"
inconsistent_struct_constructor = "allow"
invalid_upcast_comparisons = "warn"
large_futures = "warn"
large_stack_arrays = "warn"
large_types_passed_by_value = "warn"
map_unwrap_or = "allow"
maybe_infinite_iter = "warn"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
doc_markdown = "allow"
module_name_repetitions = "allow"
must_use_candidate = "allow"
needless_raw_string_hashes = "allow"
pedantic = { level = "warn", priority = -1 }
print_stderr = "warn"
print_stdout = "warn"
ptr_cast_constness = "warn"
range_minus_one = "warn"
range_plus_one = "warn"
cast_lossless = "warn"
cast_possible_truncation = "warn"
cast_possible_wrap = "warn"
cast_precision_loss = "warn"
cast_ptr_alignment = "warn"
cast_sign_loss = "warn"
checked_conversions = "warn"
if_then_some_else_none = "warn"
inconsistent_struct_constructor = "allow"
invalid_upcast_comparisons = "warn"
large_futures = "warn"
large_stack_arrays = "warn"
large_types_passed_by_value = "warn"
map_unwrap_or = "allow"
maybe_infinite_iter = "warn"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
module_name_repetitions = "allow"
must_use_candidate = "allow"
needless_raw_string_hashes = "allow"
pedantic = { level = "warn", priority = -1 }
print_stderr = "warn"
print_stdout = "warn"
ptr_cast_constness = "warn"
range_minus_one = "warn"
range_plus_one = "warn"
redundant_closure_for_method_calls = "warn"
return_self_not_must_use = "warn"
same_functions_in_if_condition = "warn"
semicolon-if-nothing-returned = "allow"
similar_names = "warn"
str_to_string = "warn"
string_to_string = "warn"
unicode_not_nfc = "warn"
return_self_not_must_use = "warn"
same_functions_in_if_condition = "warn"
semicolon-if-nothing-returned = "allow"
similar_names = "warn"
str_to_string = "warn"
string_to_string = "warn"
unicode_not_nfc = "warn"
2 changes: 1 addition & 1 deletion orion-configuration/examples/convert.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![allow(clippy::print_stdout)]
use orion_configuration::config::Bootstrap;
use orion_error::{Result, ResultExtension};
use orion_error::{Context, Result};
use std::fs::File;

fn main() -> Result<()> {
Expand Down
13 changes: 5 additions & 8 deletions orion-configuration/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ mod envoy_conversions {
};
use orion_data_plane_api::decode::from_serde_deserializer;
pub use orion_data_plane_api::envoy_data_plane_api::envoy::config::bootstrap::v3::Bootstrap as EnvoyBootstrap;
use orion_error::ResultExtension;
use orion_error::Context;
use serde::Deserialize;

#[derive(Deserialize)]
Expand All @@ -122,7 +122,7 @@ mod envoy_conversions {
serde_yaml::Deserializer::from_reader(&envoy_file),
&mut track,
))
.with_context(|| format!("failed to deserialize {}", track.path().to_string()))?;
.with_context(|| format!("failed to deserialize {}", track.path()))?;
Bootstrap::try_from(envoy).context("failed to convert into orion bootstrap")
})()
.with_context(|| format!("failed to read config from \"{}\"", envoy_path.as_ref().display()))
Expand All @@ -137,7 +137,7 @@ mod envoy_conversions {
Self { runtime: Runtime::default(), logging: Log::default(), bootstrap }
},
(Some(config), maybe_override) => {
let ShimConfig { runtime, logging, bootstrap, envoy_bootstrap } = deserialize_yaml(&config)
let ShimConfig { runtime, logging, bootstrap, envoy_bootstrap } = deserialize_yaml(config)
.with_context(|| format!("failed to deserialize \"{}\"", config.display()))?;
let mut bootstrap = match (bootstrap, envoy_bootstrap) {
(None, None) => Bootstrap::default(),
Expand All @@ -149,7 +149,7 @@ mod envoy_conversions {
},
};
if let Some(bootstrap_override) = maybe_override {
bootstrap = bootstrap_from_path_to_envoy_bootstrap(&bootstrap_override)?;
bootstrap = bootstrap_from_path_to_envoy_bootstrap(bootstrap_override)?;
}
Self { runtime, logging, bootstrap }
},
Expand Down Expand Up @@ -199,10 +199,7 @@ mod envoy_conversions {
// std::fs::write(new_path, serialized.as_bytes())?;
// }
let deserialized: Config = serde_yaml::from_str(&serialized)?;
if new_conf != deserialized {
tracing::info!("\n{}\n", serde_yaml::to_string(&deserialized)?);
panic!("failed to roundtrip config transcoding")
}
assert_eq!(new_conf, deserialized, "failed to roundtrip config transcoding");
} else {
tracing::info!("skipping {}", path.display())
}
Expand Down
13 changes: 7 additions & 6 deletions orion-configuration/src/config/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ use crate::config::{cluster::Cluster, common::is_default, listener::Listener, se
use compact_str::CompactString;
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize, Default, PartialEq)]
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)]
pub struct Bootstrap {
#[serde(with = "serde_yaml::with::singleton_map_recursive", skip_serializing_if = "is_default", default)]
pub static_resources: StaticResources,
#[serde(skip_serializing_if = "Option::is_none", default = "Default::default")]
dynamic_resources: Option<DynamicResources>,
pub dynamic_resources: Option<DynamicResources>,
#[serde(skip_serializing_if = "Option::is_none", default = "Default::default")]
pub node: Option<Node>,
}
Expand All @@ -43,12 +43,12 @@ pub struct Node {
pub id: CompactString,
}

#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct DynamicResources {
pub grpc_cluster_specifiers: Vec<CompactString>,
}

#[derive(Debug, Serialize, Deserialize, Default, PartialEq)]
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq)]
pub struct StaticResources {
#[serde(skip_serializing_if = "Vec::is_empty", default = "Default::default")]
pub listeners: Vec<Listener>,
Expand Down Expand Up @@ -126,7 +126,7 @@ mod envoy_conversions {
application_log_config,
grpc_async_client_manager_config,
stats_flush,
memory_allocator_manager: _,
memory_allocator_manager,
} = envoy;
unsupported_field!(
// node,
Expand Down Expand Up @@ -166,7 +166,8 @@ mod envoy_conversions {
listener_manager,
application_log_config,
grpc_async_client_manager_config,
stats_flush
stats_flush,
memory_allocator_manager
)?;
let static_resources = convert_opt!(static_resources)?;
let dynamic_resources =
Expand Down
17 changes: 9 additions & 8 deletions orion-configuration/src/config/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ mod envoy_conversions {
connection_pool_per_downstream_connection,
cluster_discovery_type,
lb_config,
dns_jitter: _,
lrs_report_endpoint_metrics: _,
dns_jitter,
lrs_report_endpoint_metrics,
} = envoy;
let name = required!(name)?;
(|| -> Result<Self, GenericError> {
Expand Down Expand Up @@ -350,9 +350,11 @@ mod envoy_conversions {
upstream_config,
track_cluster_stats,
preconnect_policy,
connection_pool_per_downstream_connection
// cluster_discovery_type,
// lb_config
connection_pool_per_downstream_connection,
dns_jitter, // cluster_discovery_type,
lrs_report_endpoint_metrics
// lb_config

)?;

if let Some(lb_config_type) = &lb_config {
Expand Down Expand Up @@ -497,10 +499,9 @@ mod envoy_conversions {
Ok(Self { endpoints })
})();
if !cluster_name.is_empty() {
ret.with_name(cluster_name)
} else {
ret
return ret.with_name(cluster_name);
}
ret
}
}

Expand Down
Loading