From 81c6c8c7a279769fe94f470ead67c6e50e73113a Mon Sep 17 00:00:00 2001 From: Ryan Goodfellow Date: Sat, 27 May 2023 00:45:05 -0700 Subject: [PATCH] wip --- .github/buildomat/jobs/deploy.sh | 11 ++++++++ nexus/src/app/rack.rs | 45 +++++++++++++++++++++++--------- package-manifest.toml | 12 ++++----- tools/create_virtual_hardware.sh | 2 +- tools/dendrite_openapi_version | 2 +- tools/dendrite_stub_checksums | 4 +-- 6 files changed, 53 insertions(+), 23 deletions(-) diff --git a/.github/buildomat/jobs/deploy.sh b/.github/buildomat/jobs/deploy.sh index 66719067d0..65aec3e5a6 100755 --- a/.github/buildomat/jobs/deploy.sh +++ b/.github/buildomat/jobs/deploy.sh @@ -44,6 +44,11 @@ _exit_trap() { standalone \ dump-state pfexec /opt/oxide/opte/bin/opteadm list-ports + z_swadm link ls + z_swadm addr list + z_swadm route list + z_swadm arp list + PORTS=$(pfexec /opt/oxide/opte/bin/opteadm list-ports | tail +2 | awk '{ print $1; }') for p in $PORTS; do LAYERS=$(pfexec /opt/oxide/opte/bin/opteadm list-layers -p $p | tail +2 | awk '{ print $1; }') @@ -67,10 +72,16 @@ _exit_trap() { pfexec zlogin "$z" arp -an done + pfexec zlogin softnpu cat /softnpu.log + exit $status } trap _exit_trap EXIT +z_swadm () { + pfexec zlogin oxz_switch /opt/oxide/dendrite/bin/swadm $@ +} + # # XXX work around 14537 (UFS should not allow directories to be unlinked) which # is probably not yet fixed in xde branch? Once the xde branch merges from diff --git a/nexus/src/app/rack.rs b/nexus/src/app/rack.rs index 9c8fac3428..bdca5d2061 100644 --- a/nexus/src/app/rack.rs +++ b/nexus/src/app/rack.rs @@ -321,7 +321,7 @@ impl super::Nexus { let loopback_address_params = LoopbackAddressCreate { address_lot: NameOrId::Name(address_lot_name.clone()), rack_id, - switch_location, + switch_location: switch_location.clone(), address: first_address, mask: 64, }; @@ -344,14 +344,26 @@ impl super::Nexus { Error::internal_error(&format!("unable to retrieve authz_address_lot for infra address_lot: {e}")) })?; - self.db_datastore - .loopback_address_create( - opctx, - &loopback_address_params, - None, - &authz_address_lot, - ) - .await?; + if self + .loopback_address_lookup( + &opctx, + rack_id, + switch_location.into(), + first_address.into(), + )? + .lookup_for(authz::Action::Read) + .await + .is_err() + { + self.db_datastore + .loopback_address_create( + opctx, + &loopback_address_params, + None, + &authz_address_lot, + ) + .await?; + } let body = Ipv6Entry { addr: Ipv6Addr::from_str("fd00:99::1").map_err(|e| { @@ -374,7 +386,7 @@ impl super::Nexus { })?; let identity = IdentityMetadataCreateParams { - name, + name: name.clone(), description: "initial uplink configuration".to_string(), }; @@ -431,9 +443,16 @@ impl super::Nexus { RouteConfig { routes: vec![route] }, ); - self.db_datastore - .switch_port_settings_create(opctx, &port_settings_params) - .await?; + if self + .db_datastore + .switch_port_settings_get(opctx, &name.into()) + .await + .is_err() + { + self.db_datastore + .switch_port_settings_create(opctx, &port_settings_params) + .await?; + } let mut dpd_port_settings = PortSettings { tag: NEXUS_DPD_TAG.into(), diff --git a/package-manifest.toml b/package-manifest.toml index 612123f9c8..a52b49f864 100644 --- a/package-manifest.toml +++ b/package-manifest.toml @@ -300,8 +300,8 @@ only_for_targets.image = "standard" # 2. Copy dendrite.tar.gz from dendrite/out to omicron/out source.type = "prebuilt" source.repo = "dendrite" -source.commit = "9ddb6420ed198e225c53c9f55599345c7c194fa1" -source.sha256 = "d12446730e609560a44bfced4803b80b46e8fb4d0815fd8125c01c33f4567183" +source.commit = "746b53dc06d95829307efe211011018f845205cf" +source.sha256 = "86e046be3b2d24bedceb46da5f9a0bc736cb0ffde5176444fe8fefb9b661a37b" output.type = "zone" output.intermediate_only = true @@ -325,8 +325,8 @@ only_for_targets.image = "standard" # 2. Copy the output zone image from dendrite/out to omicron/out source.type = "prebuilt" source.repo = "dendrite" -source.commit = "9ddb6420ed198e225c53c9f55599345c7c194fa1" -source.sha256 = "f09b4d7da6e1008a5d5f1fd46ce41acb6623afd6650913910048ad221c638787" +source.commit = "746b53dc06d95829307efe211011018f845205cf" +source.sha256 = "fcfcb25b93ee392821a3427645acb2d901f65b418f8132004be7471ee6f5644a" output.type = "zone" output.intermediate_only = true @@ -343,8 +343,8 @@ only_for_targets.image = "standard" # 2. Copy dendrite.tar.gz from dendrite/out to omicron/out/dendrite-softnpu.tar.gz source.type = "prebuilt" source.repo = "dendrite" -source.commit = "9ddb6420ed198e225c53c9f55599345c7c194fa1" -source.sha256 = "748732e4d23e9063ac087c723320c6b8f8b806b45270e276344f6cec31a2e7b0" +source.commit = "746b53dc06d95829307efe211011018f845205cf" +source.sha256 = "b540fc95746e80dacac20dde0578884849f4ef86a98fb9f5154231bcbdcbadde" output.type = "zone" output.intermediate_only = true diff --git a/tools/create_virtual_hardware.sh b/tools/create_virtual_hardware.sh index a2e9a2d18e..7f878e235a 100755 --- a/tools/create_virtual_hardware.sh +++ b/tools/create_virtual_hardware.sh @@ -132,7 +132,7 @@ function enable_softnpu { exit 1 } zlogin softnpu pgrep softnpu || { - zlogin softnpu /stuff/softnpu /stuff/softnpu.toml & + zlogin softnpu 'RUST_LOG=debug /stuff/softnpu /stuff/softnpu.toml &> /softnpu.log &' } success "softnpu started" } diff --git a/tools/dendrite_openapi_version b/tools/dendrite_openapi_version index 99aec58794..f7cdbc7cac 100644 --- a/tools/dendrite_openapi_version +++ b/tools/dendrite_openapi_version @@ -1,2 +1,2 @@ -COMMIT="9ddb6420ed198e225c53c9f55599345c7c194fa1" +COMMIT="746b53dc06d95829307efe211011018f845205cf" SHA2="4073eeb768014d6073ba18a7b7b12b2f767467969bf69217f19ff2b974debd51" diff --git a/tools/dendrite_stub_checksums b/tools/dendrite_stub_checksums index 36f87d6b7e..a5a7191c05 100644 --- a/tools/dendrite_stub_checksums +++ b/tools/dendrite_stub_checksums @@ -1,3 +1,3 @@ -CIDL_SHA256_ILLUMOS="d12446730e609560a44bfced4803b80b46e8fb4d0815fd8125c01c33f4567183" -CIDL_SHA256_LINUX_DPD="61d947fb8cffbc1b9e477398e354b59223d74ab5374f0d8f93aa4096c42bb136" +CIDL_SHA256_ILLUMOS="86e046be3b2d24bedceb46da5f9a0bc736cb0ffde5176444fe8fefb9b661a37b" +CIDL_SHA256_LINUX_DPD="96367a835dd9436a530df3b1beb647184cd506f95b6ed8b78e78162c50085dc1" CIDL_SHA256_LINUX_SWADM="fa4a8725d86d56ff179f0b8c943c87b4e618e5baa497a705d81c80a668003248"