From 79713cb6d689a353d19e51d938fb4cac4ce1ccfb Mon Sep 17 00:00:00 2001 From: "Andrew J. Stone" Date: Thu, 17 Oct 2024 22:58:27 +0000 Subject: [PATCH] Fix clickhouse-admin after split into two servers These changes allow properly building and deploying clickhouse cluster nodes via reconfigurator. --- package-manifest.toml | 10 ++++++---- sled-agent/src/services.rs | 24 +++++++++++++----------- smf/clickhouse-admin-keeper/manifest.xml | 2 +- smf/clickhouse-admin-server/manifest.xml | 2 +- smf/clickhouse_keeper/manifest.xml | 4 ++-- smf/clickhouse_keeper/method_script.sh | 2 +- smf/clickhouse_server/manifest.xml | 4 ++-- smf/clickhouse_server/method_script.sh | 2 +- 8 files changed, 27 insertions(+), 23 deletions(-) diff --git a/package-manifest.toml b/package-manifest.toml index e724486e77..2b5eecc2ec 100644 --- a/package-manifest.toml +++ b/package-manifest.toml @@ -208,6 +208,7 @@ source.paths = [ { from = "out/clickhouse", to = "/opt/oxide/clickhouse_server" }, { from = "smf/clickhouse_server/manifest.xml", to = "/var/svc/manifest/site/clickhouse_server/manifest.xml" }, { from = "smf/clickhouse_server/method_script.sh", to = "/opt/oxide/lib/svc/manifest/clickhouse_server.sh" }, + { from = "smf/clickhouse-admin-server", to = "/var/svc/manifest/site/clickhouse-admin-server" }, ] output.type = "zone" output.intermediate_only = true @@ -237,6 +238,7 @@ source.paths = [ { from = "out/clickhouse", to = "/opt/oxide/clickhouse_keeper" }, { from = "smf/clickhouse_keeper/manifest.xml", to = "/var/svc/manifest/site/clickhouse_keeper/manifest.xml" }, { from = "smf/clickhouse_keeper/method_script.sh", to = "/opt/oxide/lib/svc/manifest/clickhouse_keeper.sh" }, + { from = "smf/clickhouse-admin-keeper", to = "/var/svc/manifest/site/clickhouse-admin-keeper" }, ] output.type = "zone" output.intermediate_only = true @@ -248,10 +250,10 @@ only_for_targets.image = "standard" source.type = "local" source.rust.binary_names = ["clickhouse-admin-keeper", "clickhouse-admin-server"] source.rust.release = true -source.paths = [ - { from = "smf/clickhouse-admin-keeper", to = "/var/svc/manifest/site/clickhouse-admin-keeper" }, - { from = "smf/clickhouse-admin-server", to = "/var/svc/manifest/site/clickhouse-admin-server" }, -] +# We specifically put the smf manifests with their corresponding container zones +# so that both servers aren't started simultaneously +# See [package.clickhouse_keeper_svc] and [package.clickhouse_server_svc] +source.paths = [] output.type = "zone" output.intermediate_only = true diff --git a/sled-agent/src/services.rs b/sled-agent/src/services.rs index 36360ddeae..368655aa9f 100644 --- a/sled-agent/src/services.rs +++ b/sled-agent/src/services.rs @@ -132,10 +132,10 @@ const IPV6_UNSPECIFIED: IpAddr = IpAddr::V6(Ipv6Addr::UNSPECIFIED); const COCKROACH: &str = "/opt/oxide/cockroachdb/bin/cockroach"; const CLICKHOUSE_SERVER_BINARY: &str = - "/opt/oxide//opt/oxide/clickhouse_server/clickhouse"; + "/opt/oxide/clickhouse_server/clickhouse"; const CLICKHOUSE_KEEPER_BINARY: &str = - "/opt/oxide//opt/oxide/clickhouse_keeper/clickhouse"; -const CLICKHOUSE_BINARY: &str = "/opt/oxide//opt/oxide/clickhouse/clickhouse"; + "/opt/oxide/clickhouse_keeper/clickhouse"; +const CLICKHOUSE_BINARY: &str = "/opt/oxide/clickhouse/clickhouse"; pub const SWITCH_ZONE_BASEBOARD_FILE: &str = "/opt/oxide/baseboard.json"; @@ -1687,10 +1687,11 @@ impl ServiceManager { CLICKHOUSE_SERVER_BINARY, ); let clickhouse_admin_service = - ServiceBuilder::new("oxide/clickhouse-admin").add_instance( - ServiceInstanceBuilder::new("default") - .add_property_group(clickhouse_admin_config), - ); + ServiceBuilder::new("oxide/clickhouse-admin-server") + .add_instance( + ServiceInstanceBuilder::new("default") + .add_property_group(clickhouse_admin_config), + ); let profile = ProfileBuilder::new("omicron") .add_service(nw_setup_service) @@ -1762,10 +1763,11 @@ impl ServiceManager { CLICKHOUSE_KEEPER_BINARY, ); let clickhouse_admin_service = - ServiceBuilder::new("oxide/clickhouse-admin").add_instance( - ServiceInstanceBuilder::new("default") - .add_property_group(clickhouse_admin_config), - ); + ServiceBuilder::new("oxide/clickhouse-admin-keeper") + .add_instance( + ServiceInstanceBuilder::new("default") + .add_property_group(clickhouse_admin_config), + ); let profile = ProfileBuilder::new("omicron") .add_service(nw_setup_service) diff --git a/smf/clickhouse-admin-keeper/manifest.xml b/smf/clickhouse-admin-keeper/manifest.xml index 46b0a33e3c..08407b924e 100644 --- a/smf/clickhouse-admin-keeper/manifest.xml +++ b/smf/clickhouse-admin-keeper/manifest.xml @@ -17,7 +17,7 @@ diff --git a/smf/clickhouse-admin-server/manifest.xml b/smf/clickhouse-admin-server/manifest.xml index 0b72b56323..0b34130919 100644 --- a/smf/clickhouse-admin-server/manifest.xml +++ b/smf/clickhouse-admin-server/manifest.xml @@ -17,7 +17,7 @@ diff --git a/smf/clickhouse_keeper/manifest.xml b/smf/clickhouse_keeper/manifest.xml index 1b5ff3c0e1..8af4dba3f2 100644 --- a/smf/clickhouse_keeper/manifest.xml +++ b/smf/clickhouse_keeper/manifest.xml @@ -16,9 +16,9 @@ - - + - - +