diff --git a/Cargo.lock b/Cargo.lock index 0d1e149700..c3fc5d86cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4262,39 +4262,6 @@ dependencies = [ "rustc_version 0.1.7", ] -[[package]] -name = "nexus-blueprint-execution" -version = "0.1.0" -dependencies = [ - "anyhow", - "chrono", - "dns-service-client", - "futures", - "httptest", - "illumos-utils", - "internal-dns", - "ipnet", - "nexus-db-model", - "nexus-db-queries", - "nexus-deployment", - "nexus-inventory", - "nexus-test-utils", - "nexus-test-utils-macros", - "nexus-types", - "omicron-common", - "omicron-nexus", - "omicron-rpaths", - "omicron-test-utils", - "omicron-workspace-hack", - "pq-sys", - "reqwest", - "sled-agent-client", - "slog", - "slog-error-chain", - "tokio", - "uuid", -] - [[package]] name = "nexus-client" version = "0.1.0" @@ -4386,8 +4353,8 @@ dependencies = [ "macaddr", "newtype_derive", "nexus-db-model", - "nexus-deployment", "nexus-inventory", + "nexus-reconfigurator-planning", "nexus-test-utils", "nexus-types", "omicron-common", @@ -4444,26 +4411,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "nexus-deployment" -version = "0.1.0" -dependencies = [ - "anyhow", - "chrono", - "internal-dns", - "ipnet", - "ipnetwork", - "nexus-inventory", - "nexus-types", - "omicron-common", - "omicron-test-utils", - "omicron-workspace-hack", - "sled-agent-client", - "slog", - "thiserror", - "uuid", -] - [[package]] name = "nexus-inventory" version = "0.1.0" @@ -4501,6 +4448,59 @@ dependencies = [ "syn 2.0.51", ] +[[package]] +name = "nexus-reconfigurator-execution" +version = "0.1.0" +dependencies = [ + "anyhow", + "chrono", + "dns-service-client", + "futures", + "httptest", + "illumos-utils", + "internal-dns", + "ipnet", + "nexus-db-model", + "nexus-db-queries", + "nexus-inventory", + "nexus-reconfigurator-planning", + "nexus-test-utils", + "nexus-test-utils-macros", + "nexus-types", + "omicron-common", + "omicron-nexus", + "omicron-rpaths", + "omicron-test-utils", + "omicron-workspace-hack", + "pq-sys", + "reqwest", + "sled-agent-client", + "slog", + "slog-error-chain", + "tokio", + "uuid", +] + +[[package]] +name = "nexus-reconfigurator-planning" +version = "0.1.0" +dependencies = [ + "anyhow", + "chrono", + "internal-dns", + "ipnet", + "ipnetwork", + "nexus-inventory", + "nexus-types", + "omicron-common", + "omicron-test-utils", + "omicron-workspace-hack", + "sled-agent-client", + "slog", + "thiserror", + "uuid", +] + [[package]] name = "nexus-test-interface" version = "0.1.0" @@ -5031,12 +5031,12 @@ dependencies = [ "macaddr", "mg-admin-client", "mime_guess", - "nexus-blueprint-execution", "nexus-db-model", "nexus-db-queries", "nexus-defaults", - "nexus-deployment", "nexus-inventory", + "nexus-reconfigurator-execution", + "nexus-reconfigurator-planning", "nexus-test-interface", "nexus-test-utils", "nexus-test-utils-macros", diff --git a/Cargo.toml b/Cargo.toml index 97300bc0d2..e19ed35c32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,14 +37,14 @@ members = [ "key-manager", "nexus", "nexus/authz-macros", - "nexus/blueprint-execution", "nexus/db-macros", "nexus/db-model", "nexus/db-queries", "nexus/defaults", - "nexus/deployment", "nexus/inventory", "nexus/macros-common", + "nexus/reconfigurator/execution", + "nexus/reconfigurator/planning", "nexus/test-interface", "nexus/test-utils-macros", "nexus/test-utils", @@ -114,14 +114,14 @@ default-members = [ "key-manager", "nexus", "nexus/authz-macros", - "nexus/blueprint-execution", "nexus/macros-common", "nexus/db-macros", "nexus/db-model", "nexus/db-queries", "nexus/defaults", - "nexus/deployment", "nexus/inventory", + "nexus/reconfigurator/execution", + "nexus/reconfigurator/planning", "nexus/types", "oximeter/collector", "oximeter/db", @@ -253,14 +253,14 @@ mockall = "0.12" newtype_derive = "0.1.6" mg-admin-client = { path = "clients/mg-admin-client" } multimap = "0.10.0" -nexus-blueprint-execution = { path = "nexus/blueprint-execution" } nexus-client = { path = "clients/nexus-client" } nexus-db-model = { path = "nexus/db-model" } nexus-db-queries = { path = "nexus/db-queries" } nexus-defaults = { path = "nexus/defaults" } -nexus-deployment = { path = "nexus/deployment" } nexus-inventory = { path = "nexus/inventory" } nexus-macros-common = { path = "nexus/macros-common" } +nexus-reconfigurator-execution = { path = "nexus/reconfigurator/execution" } +nexus-reconfigurator-planning = { path = "nexus/reconfigurator/planning" } omicron-certificates = { path = "certificates" } omicron-passwords = { path = "passwords" } omicron-workspace-hack = "0.1.0" diff --git a/nexus/Cargo.toml b/nexus/Cargo.toml index 6e9f2f135d..581e16e84d 100644 --- a/nexus/Cargo.toml +++ b/nexus/Cargo.toml @@ -77,12 +77,12 @@ tough.workspace = true trust-dns-resolver.workspace = true uuid.workspace = true -nexus-blueprint-execution.workspace = true nexus-defaults.workspace = true nexus-db-model.workspace = true nexus-db-queries.workspace = true -nexus-deployment.workspace = true nexus-inventory.workspace = true +nexus-reconfigurator-execution.workspace = true +nexus-reconfigurator-planning.workspace = true nexus-types.workspace = true omicron-common.workspace = true omicron-passwords.workspace = true diff --git a/nexus/blueprint-execution/tests/config.test.toml b/nexus/blueprint-execution/tests/config.test.toml deleted file mode 120000 index 52f00171fd..0000000000 --- a/nexus/blueprint-execution/tests/config.test.toml +++ /dev/null @@ -1 +0,0 @@ -../../tests/config.test.toml \ No newline at end of file diff --git a/nexus/db-queries/Cargo.toml b/nexus/db-queries/Cargo.toml index 539a913476..9d0c22c373 100644 --- a/nexus/db-queries/Cargo.toml +++ b/nexus/db-queries/Cargo.toml @@ -69,8 +69,8 @@ gateway-client.workspace = true illumos-utils.workspace = true internal-dns.workspace = true itertools.workspace = true -nexus-deployment.workspace = true nexus-inventory.workspace = true +nexus-reconfigurator-planning.workspace = true nexus-test-utils.workspace = true omicron-sled-agent.workspace = true omicron-test-utils.workspace = true diff --git a/nexus/db-queries/src/db/datastore/deployment.rs b/nexus/db-queries/src/db/datastore/deployment.rs index 00a75a21da..020916928d 100644 --- a/nexus/db-queries/src/db/datastore/deployment.rs +++ b/nexus/db-queries/src/db/datastore/deployment.rs @@ -1055,9 +1055,9 @@ impl RunQueryDsl for InsertTargetQuery {} mod tests { use super::*; use crate::db::datastore::test_utils::datastore_test; - use nexus_deployment::blueprint_builder::BlueprintBuilder; - use nexus_deployment::blueprint_builder::Ensure; use nexus_inventory::now_db_precision; + use nexus_reconfigurator_planning::blueprint_builder::BlueprintBuilder; + use nexus_reconfigurator_planning::blueprint_builder::Ensure; use nexus_test_utils::db::test_setup_database; use nexus_types::deployment::Policy; use nexus_types::deployment::SledResources; diff --git a/nexus/reconfigurator/README.md b/nexus/reconfigurator/README.md new file mode 100644 index 0000000000..7c6a98e666 --- /dev/null +++ b/nexus/reconfigurator/README.md @@ -0,0 +1,13 @@ +# Reconfigurator + +**Reconfigurator** is a project and control plane facility for dynamically reconfiguring the software running on the Oxide rack. This will be used for a variety of use cases: + +* Adding, removing, or replacing sleds (gracefully or otherwise) +* Upgrading any Oxide-delivered software (see below) +* Scale-up and scale-down of control plane services +* Automated response to hardware failure + +For those with access (primarily, Oxide employees), see: + +* [RFD 418 Towards automated system update](https://rfd.shared.oxide.computer/rfd/418). +* [Reconfigurator GitHub Project](https://github.com/orgs/oxidecomputer/projects/44?pane=info). diff --git a/nexus/blueprint-execution/Cargo.toml b/nexus/reconfigurator/execution/Cargo.toml similarity index 92% rename from nexus/blueprint-execution/Cargo.toml rename to nexus/reconfigurator/execution/Cargo.toml index 164559b468..2f4807d38d 100644 --- a/nexus/blueprint-execution/Cargo.toml +++ b/nexus/reconfigurator/execution/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nexus-blueprint-execution" +name = "nexus-reconfigurator-execution" version = "0.1.0" edition = "2021" @@ -33,7 +33,7 @@ omicron-workspace-hack.workspace = true chrono.workspace = true httptest.workspace = true ipnet.workspace = true -nexus-deployment.workspace = true +nexus-reconfigurator-planning.workspace = true nexus-inventory.workspace = true nexus-test-utils.workspace = true nexus-test-utils-macros.workspace = true diff --git a/nexus/blueprint-execution/build.rs b/nexus/reconfigurator/execution/build.rs similarity index 100% rename from nexus/blueprint-execution/build.rs rename to nexus/reconfigurator/execution/build.rs diff --git a/nexus/blueprint-execution/src/datasets.rs b/nexus/reconfigurator/execution/src/datasets.rs similarity index 100% rename from nexus/blueprint-execution/src/datasets.rs rename to nexus/reconfigurator/execution/src/datasets.rs diff --git a/nexus/blueprint-execution/src/dns.rs b/nexus/reconfigurator/execution/src/dns.rs similarity index 99% rename from nexus/blueprint-execution/src/dns.rs rename to nexus/reconfigurator/execution/src/dns.rs index 54611e9f66..0fa8eb1c10 100644 --- a/nexus/blueprint-execution/src/dns.rs +++ b/nexus/reconfigurator/execution/src/dns.rs @@ -320,8 +320,8 @@ mod test { use crate::Sled; use internal_dns::ServiceName; use internal_dns::DNS_ZONE; - use nexus_deployment::blueprint_builder::BlueprintBuilder; use nexus_inventory::CollectionBuilder; + use nexus_reconfigurator_planning::blueprint_builder::BlueprintBuilder; use nexus_types::deployment::Blueprint; use nexus_types::deployment::OmicronZoneConfig; use nexus_types::deployment::OmicronZoneType; diff --git a/nexus/blueprint-execution/src/lib.rs b/nexus/reconfigurator/execution/src/lib.rs similarity index 97% rename from nexus/blueprint-execution/src/lib.rs rename to nexus/reconfigurator/execution/src/lib.rs index 531c4f57a8..74b4764d7a 100644 --- a/nexus/blueprint-execution/src/lib.rs +++ b/nexus/reconfigurator/execution/src/lib.rs @@ -4,7 +4,7 @@ //! Execution of Nexus blueprints //! -//! See `nexus_deployment` crate-level docs for background. +//! See `nexus_reconfigurator_planning` crate-level docs for background. use anyhow::{anyhow, Context}; use nexus_db_queries::context::OpContext; diff --git a/nexus/blueprint-execution/src/omicron_zones.rs b/nexus/reconfigurator/execution/src/omicron_zones.rs similarity index 100% rename from nexus/blueprint-execution/src/omicron_zones.rs rename to nexus/reconfigurator/execution/src/omicron_zones.rs diff --git a/nexus/blueprint-execution/src/resource_allocation.rs b/nexus/reconfigurator/execution/src/resource_allocation.rs similarity index 100% rename from nexus/blueprint-execution/src/resource_allocation.rs rename to nexus/reconfigurator/execution/src/resource_allocation.rs diff --git a/nexus/reconfigurator/execution/tests/config.test.toml b/nexus/reconfigurator/execution/tests/config.test.toml new file mode 120000 index 0000000000..7e4238a9d6 --- /dev/null +++ b/nexus/reconfigurator/execution/tests/config.test.toml @@ -0,0 +1 @@ +../../../tests/config.test.toml \ No newline at end of file diff --git a/nexus/deployment/Cargo.toml b/nexus/reconfigurator/planning/Cargo.toml similarity index 92% rename from nexus/deployment/Cargo.toml rename to nexus/reconfigurator/planning/Cargo.toml index 115dec98a5..35ead9494e 100644 --- a/nexus/deployment/Cargo.toml +++ b/nexus/reconfigurator/planning/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nexus-deployment" +name = "nexus-reconfigurator-planning" version = "0.1.0" edition = "2021" diff --git a/nexus/deployment/src/blueprint_builder.rs b/nexus/reconfigurator/planning/src/blueprint_builder.rs similarity index 100% rename from nexus/deployment/src/blueprint_builder.rs rename to nexus/reconfigurator/planning/src/blueprint_builder.rs diff --git a/nexus/deployment/src/ip_allocator.rs b/nexus/reconfigurator/planning/src/ip_allocator.rs similarity index 100% rename from nexus/deployment/src/ip_allocator.rs rename to nexus/reconfigurator/planning/src/ip_allocator.rs diff --git a/nexus/deployment/src/lib.rs b/nexus/reconfigurator/planning/src/lib.rs similarity index 100% rename from nexus/deployment/src/lib.rs rename to nexus/reconfigurator/planning/src/lib.rs diff --git a/nexus/deployment/src/planner.rs b/nexus/reconfigurator/planning/src/planner.rs similarity index 100% rename from nexus/deployment/src/planner.rs rename to nexus/reconfigurator/planning/src/planner.rs diff --git a/nexus/src/app/background/blueprint_execution.rs b/nexus/src/app/background/blueprint_execution.rs index 4ba60ab566..3c2530a3d3 100644 --- a/nexus/src/app/background/blueprint_execution.rs +++ b/nexus/src/app/background/blueprint_execution.rs @@ -69,7 +69,7 @@ impl BackgroundTask for BlueprintExecutor { }); } - let result = nexus_blueprint_execution::realize_blueprint( + let result = nexus_reconfigurator_execution::realize_blueprint( opctx, &self.datastore, blueprint, @@ -258,7 +258,7 @@ mod test { // Make sure that requests get made to the sled agent. This is not a // careful check of exactly what gets sent. For that, see the tests in - // nexus-blueprint-execution. + // nexus-reconfigurator-execution. for s in [&mut s1, &mut s2] { s.expect( Expectation::matching(all_of![request::method_path( diff --git a/nexus/src/app/deployment.rs b/nexus/src/app/deployment.rs index adf6119c5c..31ba9fe065 100644 --- a/nexus/src/app/deployment.rs +++ b/nexus/src/app/deployment.rs @@ -9,8 +9,8 @@ use nexus_db_queries::authz; use nexus_db_queries::context::OpContext; use nexus_db_queries::db::datastore::SQL_BATCH_SIZE; use nexus_db_queries::db::pagination::Paginator; -use nexus_deployment::blueprint_builder::BlueprintBuilder; -use nexus_deployment::planner::Planner; +use nexus_reconfigurator_planning::blueprint_builder::BlueprintBuilder; +use nexus_reconfigurator_planning::planner::Planner; use nexus_types::deployment::Blueprint; use nexus_types::deployment::BlueprintMetadata; use nexus_types::deployment::BlueprintTarget; diff --git a/nexus/types/src/deployment.rs b/nexus/types/src/deployment.rs index 0f601f3db5..ef3c03a302 100644 --- a/nexus/types/src/deployment.rs +++ b/nexus/types/src/deployment.rs @@ -4,12 +4,13 @@ //! Types representing deployed software and configuration //! -//! For more on this, see the crate-level documentation for `nexus/deployment`. +//! For more on this, see the crate-level documentation for +//! `nexus/reconfigurator/planning`. //! //! This lives in nexus/types because it's used by both nexus/db-model and -//! nexus/deployment. (It could as well just live in nexus/db-model, but -//! nexus/deployment does not currently know about nexus/db-model and it's -//! convenient to separate these concerns.) +//! nexus/reconfigurator/planning. (It could as well just live in +//! nexus/db-model, but nexus/reconfigurator/planning does not currently know +//! about nexus/db-model and it's convenient to separate these concerns.) use crate::external_api::views::SledPolicy; use crate::external_api::views::SledState; @@ -98,8 +99,8 @@ impl SledResources { /// Describes a complete set of software and configuration for the system // Blueprints are a fundamental part of how the system modifies itself. Each // blueprint completely describes all of the software and configuration -// that the control plane manages. See the nexus/deployment crate-level -// documentation for details. +// that the control plane manages. See the nexus/reconfigurator/planning +// crate-level documentation for details. // // Blueprints are different from policy. Policy describes the things that an // operator would generally want to control. The blueprint describes the