Skip to content

Commit

Permalink
working well
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraettinger committed Oct 27, 2024
1 parent d7897e0 commit dd512ec
Show file tree
Hide file tree
Showing 8 changed files with 749 additions and 397 deletions.
9 changes: 8 additions & 1 deletion Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ humantime = "2.1"
humantime-serde = "1.1"
itertools = "0.10"
indexmap = { version = "1.8", features = ["serde"] }
ipnet = {version = "2.9", features = ["serde"] }
ipnetwork = { version = "0.19", features = ["serde"] }
iri-string = "0.6.0"
jemallocator = { version = "0.3", features = ["profiling"] }
jemalloc-ctl = "0.3"
Expand Down Expand Up @@ -142,6 +142,7 @@ strum_macros = "0.24"
superslice = "1.0"
sqlx = { version = "0.6", features = [
"chrono",
"ipnetwork",
"json",
"macros",
"postgres",
Expand Down
21 changes: 14 additions & 7 deletions crates/agent/src/api/create_data_plane.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,24 @@ async fn do_create_data_plane(
anyhow::bail!("authenticated user is not an admin of the 'ops/' tenant");
}

let (data_plane_fqdn, base_name) = match &private {
let (data_plane_fqdn, base_name, pulumi_stack) = match &private {
None => (
format!("{name}.dp.estuary-data.com"),
format!("public/{name}"),
format!("{name}.dp.estuary-data.com"), // 'aws-eu-west-1-c1.dp.estuary-data.com'
format!("public/{name}"), // 'public/aws-eu-west-1-c1'
format!("public-{name}"), // 'public-aws-eu-west-1-c1'
),
Some(prefix) => {
let base_name = format!("private/{prefix}{name}");
(
// '9e571ae54b74e18.dp.estuary-data.com'
format!(
"{:x}.dp.estuary-data.com",
xxhash_rust::xxh3::xxh3_64(base_name.as_bytes()),
),
// 'private/AcmeCo/aws-eu-west-1-c1'
base_name,
// 'private-AcmeCo-aws-eu-west-2-c3'
format!("private-{}-{name}", prefix.trim_end_matches("/")),
)
}
};
Expand All @@ -93,8 +98,8 @@ async fn do_create_data_plane(
let data_plane_name = format!("ops/dp/{base_name}");
let ops_l1_inferred_name = format!("ops/rollups/L1/{base_name}/inferred-schemas");
let ops_l1_stats_name = format!("ops/rollups/L1/{base_name}/catalog-stats");
let ops_l2_inferred_transform = format!("{data_plane_fqdn}");
let ops_l2_stats_transform = format!("{data_plane_fqdn}");
let ops_l2_inferred_transform = format!("from.{data_plane_fqdn}");
let ops_l2_stats_transform = format!("from.{data_plane_fqdn}");
let ops_logs_name = format!("ops/tasks/{base_name}/logs");
let ops_stats_name = format!("ops/tasks/{base_name}/stats");

Expand Down Expand Up @@ -147,9 +152,10 @@ async fn do_create_data_plane(
broker_address,
reactor_address,
hmac_keys,
enable_l2
enable_l2,
pulumi_stack
) values (
$1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12
$1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13
)
on conflict (data_plane_name) do update set
broker_address = $9,
Expand All @@ -172,6 +178,7 @@ async fn do_create_data_plane(
reactor_address,
hmac_keys.as_slice(),
!hmac_keys.is_empty(), // Enable L2 if HMAC keys are defined at creation.
pulumi_stack,
)
.fetch_one(pg_pool)
.await?;
Expand Down
2 changes: 1 addition & 1 deletion crates/data-plane-controller/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ clap = { workspace = true }
futures = { workspace = true }
humantime = { workspace = true }
humantime-serde = { workspace = true }
ipnet = { workspace = true }
ipnetwork = { workspace = true }
itertools = { workspace = true }
rustls = { workspace = true }
serde = { workspace = true }
Expand Down
Loading

0 comments on commit dd512ec

Please sign in to comment.