diff --git a/.github/buildomat/jobs/a4x2-deploy.sh b/.github/buildomat/jobs/a4x2-deploy.sh index a07f953281..0e37d4ae25 100755 --- a/.github/buildomat/jobs/a4x2-deploy.sh +++ b/.github/buildomat/jobs/a4x2-deploy.sh @@ -13,7 +13,7 @@ #: "%/out/dhcp-server.log", #: ] #: skip_clone = true -#: enable = false +#: enable = true #: #: [dependencies.a4x2] #: job = "a4x2-prepare" @@ -87,7 +87,7 @@ pfexec mv propolis-server /usr/bin/ # export DISK=${DISK:-c1t1d0} pfexec diskinfo -pfexec zpool create -f cpool $DISK +pfexec zpool create -o ashift=12 -f cpool $DISK pfexec zfs create -o mountpoint=/ci cpool/ci if [[ $(curl -s http://catacomb.eng.oxide.computer:12346/trim-me) =~ "true" ]]; then @@ -115,7 +115,7 @@ ls -R # buildomat_url=https://buildomat.eng.oxide.computer testbed_artifact_path=public/file/oxidecomputer/testbed/topo/ -testbed_rev=677559e30b4dfc65c374b24336ac23d40102de81 +testbed_rev=67454d38958bcf51830850aec36600df84b7d8a0 curl -fOL $buildomat_url/$testbed_artifact_path/$testbed_rev/a4x2 chmod +x a4x2 @@ -193,13 +193,16 @@ pfexec route add 198.51.100.0/24 $customer_edge_addr # # Run the communications test program # +# TODO tighten up packet loss tolerance. For now it's more or less ok for it to +# just run with _some_ comms. The program will fail if there are no comms to a +# given sled. cp /input/a4x2/out/commtest . chmod +x commtest -pfexec ./commtest http://198.51.100.23 run \ +NO_COLOR=1 pfexec ./commtest http://198.51.100.23 run \ --ip-pool-begin 198.51.100.40 \ --ip-pool-end 198.51.100.70 \ - --icmp-loss-tolerance 10 \ - --test-duration 300s \ - --packet-rate 30 + --icmp-loss-tolerance 500 \ + --test-duration 200s \ + --packet-rate 10 cp connectivity-report.json /out/ diff --git a/.github/buildomat/jobs/a4x2-prepare.sh b/.github/buildomat/jobs/a4x2-prepare.sh index bc88ddd4c0..79fa037139 100755 --- a/.github/buildomat/jobs/a4x2-prepare.sh +++ b/.github/buildomat/jobs/a4x2-prepare.sh @@ -20,7 +20,7 @@ #: access_repos = [ #: "oxidecomputer/testbed", #: ] -#: enable = false +#: enable = true source ./env.sh diff --git a/Cargo.lock b/Cargo.lock index 1818c89bd7..0bb79eece8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -174,7 +174,7 @@ dependencies = [ "omicron-workspace-hack", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -275,7 +275,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -297,7 +297,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -308,7 +308,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -361,7 +361,7 @@ dependencies = [ "quote", "serde", "serde_tokenstream 0.2.0", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -466,6 +466,26 @@ dependencies = [ "thiserror", ] +[[package]] +name = "bgp" +version = "0.1.0" +source = "git+https://github.com/oxidecomputer/maghemite?rev=1d8b818b0fd000bc6d2739575c8868b0781dfe41#1d8b818b0fd000bc6d2739575c8868b0781dfe41" +dependencies = [ + "anyhow", + "chrono", + "mg-common", + "nom", + "num_enum 0.7.2", + "rdb", + "schemars", + "serde", + "sled", + "slog", + "slog-async", + "slog-bunyan", + "thiserror", +] + [[package]] name = "bhyve_api" version = "0.0.0" @@ -504,7 +524,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.51", + "syn 2.0.52", "which", ] @@ -649,7 +669,7 @@ dependencies = [ "slog-term", "thiserror", "tokio", - "uuid", + "uuid 1.7.0", "vsss-rs", "zeroize", ] @@ -662,13 +682,13 @@ dependencies = [ "omicron-common", "omicron-workspace-hack", "progenitor", - "regress 0.9.0", + "regress", "reqwest", "schemars", "serde", "sled-hardware-types", "slog", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -1024,7 +1044,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -1362,7 +1382,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -1478,7 +1498,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -1526,7 +1546,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -1548,7 +1568,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core 0.20.3", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -1582,30 +1602,21 @@ dependencies = [ "quote", "serde", "serde_tokenstream 0.2.0", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] name = "ddm-admin-client" version = "0.1.0" +source = "git+https://github.com/oxidecomputer/maghemite?rev=1d8b818b0fd000bc6d2739575c8868b0781dfe41#1d8b818b0fd000bc6d2739575c8868b0781dfe41" dependencies = [ - "anyhow", - "either", - "omicron-common", - "omicron-workspace-hack", - "omicron-zone-package", + "mg-common", + "percent-encoding", "progenitor", - "progenitor-client", - "quote", "reqwest", - "rustfmt-wrapper", "serde", "serde_json", - "sled-hardware-types", "slog", - "thiserror", - "tokio", - "toml 0.8.10", ] [[package]] @@ -1634,7 +1645,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -1667,7 +1678,7 @@ checksum = "5fe87ce4529967e0ba1dcf8450bab64d97dfd5010a6256187ffe2e43e6f0e049" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -1688,7 +1699,7 @@ checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -1743,7 +1754,7 @@ dependencies = [ "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -1783,7 +1794,7 @@ dependencies = [ "pq-sys", "r2d2", "serde_json", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -1794,7 +1805,7 @@ dependencies = [ "diesel", "serde", "usdt 0.5.0", - "uuid", + "uuid 1.7.0", "version_check", ] @@ -1807,7 +1818,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -1816,7 +1827,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -1898,7 +1909,7 @@ source = "git+https://github.com/oxidecomputer/dlpi-sys#1d587ea98cf2d36f1b1624b0 dependencies = [ "libc", "libdlpi-sys", - "num_enum", + "num_enum 0.5.11", "pretty-hex 0.2.1", "thiserror", "tokio", @@ -1939,7 +1950,7 @@ dependencies = [ "trust-dns-proto", "trust-dns-resolver", "trust-dns-server", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -2008,7 +2019,7 @@ dependencies = [ "progenitor-client", "quote", "rand 0.8.5", - "regress 0.9.0", + "regress", "reqwest", "rustfmt-wrapper", "schemars", @@ -2016,7 +2027,7 @@ dependencies = [ "serde_json", "slog", "toml 0.8.10", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -2060,7 +2071,7 @@ dependencies = [ "tokio-rustls 0.25.0", "toml 0.8.10", "usdt 0.3.5", - "uuid", + "uuid 1.7.0", "version_check", "waitgroup", ] @@ -2074,7 +2085,7 @@ dependencies = [ "quote", "serde", "serde_tokenstream 0.2.0", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -2241,7 +2252,7 @@ dependencies = [ "tokio", "toml 0.8.10", "trust-dns-resolver", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -2456,7 +2467,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -2573,7 +2584,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -2641,7 +2652,7 @@ dependencies = [ "termios", "tokio", "tokio-tungstenite", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -2659,7 +2670,7 @@ dependencies = [ "serde", "serde_json", "slog", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -2674,7 +2685,7 @@ dependencies = [ "smoltcp 0.9.1", "static_assertions", "strum_macros 0.25.2", - "uuid", + "uuid 1.7.0", "zerocopy 0.6.4", ] @@ -2704,7 +2715,7 @@ dependencies = [ "tlvc 0.3.1 (git+https://github.com/oxidecomputer/tlvc.git?branch=main)", "tokio", "usdt 0.3.5", - "uuid", + "uuid 1.7.0", "version_check", "zip", ] @@ -2722,7 +2733,7 @@ dependencies = [ "slog", "sp-sim", "tokio", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -3419,7 +3430,7 @@ source = "git+https://github.com/oxidecomputer/illumos-devinfo?branch=main#4323b dependencies = [ "anyhow", "libc", - "num_enum", + "num_enum 0.5.11", ] [[package]] @@ -3449,7 +3460,7 @@ dependencies = [ "opte-ioctl", "oxide-vpc", "oxlog", - "regress 0.9.0", + "regress", "schemars", "serde", "serde_json", @@ -3458,7 +3469,7 @@ dependencies = [ "thiserror", "tokio", "toml 0.8.10", - "uuid", + "uuid 1.7.0", "zone", ] @@ -3542,7 +3553,6 @@ dependencies = [ "camino", "cancel-safe-futures", "clap 4.5.1", - "ddm-admin-client", "display-error-chain", "futures", "hex", @@ -3555,6 +3565,7 @@ dependencies = [ "itertools 0.12.1", "libc", "omicron-common", + "omicron-ddm-admin-client", "omicron-test-utils", "omicron-workspace-hack", "partial-io", @@ -3576,7 +3587,7 @@ dependencies = [ "tokio-stream", "tufaceous-lib", "update-engine", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -3586,14 +3597,14 @@ dependencies = [ "installinator-common", "omicron-workspace-hack", "progenitor", - "regress 0.9.0", + "regress", "reqwest", "schemars", "serde", "serde_json", "slog", "update-engine", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -3617,7 +3628,7 @@ dependencies = [ "serde_json", "slog", "subprocess", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -3675,7 +3686,7 @@ dependencies = [ "thiserror", "tokio", "trust-dns-resolver", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -3712,7 +3723,7 @@ dependencies = [ "serde", "test-strategy", "thiserror", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -3832,7 +3843,7 @@ version = "0.1.0" source = "git+https://github.com/oxidecomputer/opte?rev=a4c956e44fc9b75b58b83ad2eec22f6bd9005262#a4c956e44fc9b75b58b83ad2eec22f6bd9005262" dependencies = [ "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -3907,7 +3918,7 @@ dependencies = [ "libc", "libefi-sys", "thiserror", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -3942,7 +3953,7 @@ dependencies = [ "colored", "dlpi", "libc", - "num_enum", + "num_enum 0.5.11", "nvpair", "nvpair-sys", "rusty-doors", @@ -4026,9 +4037,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "lpc55_areas" @@ -4175,23 +4186,31 @@ dependencies = [ [[package]] name = "mg-admin-client" version = "0.1.0" +source = "git+https://github.com/oxidecomputer/maghemite?rev=1d8b818b0fd000bc6d2739575c8868b0781dfe41#1d8b818b0fd000bc6d2739575c8868b0781dfe41" dependencies = [ "anyhow", - "either", - "omicron-common", - "omicron-workspace-hack", - "omicron-zone-package", + "bgp", + "chrono", + "percent-encoding", "progenitor", - "progenitor-client", - "quote", + "rdb", "reqwest", - "rustfmt-wrapper", + "schemars", "serde", "serde_json", "slog", +] + +[[package]] +name = "mg-common" +version = "0.1.0" +source = "git+https://github.com/oxidecomputer/maghemite?rev=1d8b818b0fd000bc6d2739575c8868b0781dfe41#1d8b818b0fd000bc6d2739575c8868b0781dfe41" +dependencies = [ + "anstyle", + "clap 4.5.1", + "schemars", + "serde", "thiserror", - "tokio", - "toml 0.8.10", ] [[package]] @@ -4261,7 +4280,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -4347,7 +4366,7 @@ checksum = "6a5ff2b31594942586c1520da8f1e5c705729ec67b3c2ad0fe459f0b576e4d9a" dependencies = [ "schemars", "serde", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -4372,13 +4391,13 @@ dependencies = [ "omicron-uuid-kinds", "omicron-workspace-hack", "progenitor", - "regress 0.9.0", + "regress", "reqwest", "schemars", "serde", "serde_json", "slog", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -4398,7 +4417,7 @@ dependencies = [ "serde_with", "tokio-postgres", "toml 0.8.10", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -4436,7 +4455,7 @@ dependencies = [ "steno", "strum 0.26.1", "thiserror", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -4518,7 +4537,7 @@ dependencies = [ "thiserror", "tokio", "usdt 0.5.0", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -4557,7 +4576,7 @@ dependencies = [ "strum 0.26.1", "thiserror", "tokio", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -4567,7 +4586,7 @@ dependencies = [ "omicron-workspace-hack", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -4582,7 +4601,7 @@ dependencies = [ "reqwest", "sled-agent-client", "slog", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -4618,7 +4637,7 @@ dependencies = [ "slog", "slog-error-chain", "tokio", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -4644,7 +4663,7 @@ dependencies = [ "sled-agent-client", "slog", "thiserror", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -4668,7 +4687,7 @@ dependencies = [ "omicron-common", "omicron-workspace-hack", "slog", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -4712,7 +4731,7 @@ dependencies = [ "tokio", "tokio-util", "trust-dns-resolver", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -4721,7 +4740,7 @@ version = "0.1.0" dependencies = [ "omicron-workspace-hack", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -4750,7 +4769,7 @@ dependencies = [ "steno", "strum 0.26.1", "thiserror", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -4883,7 +4902,7 @@ checksum = "9e6a0fd4f737c707bd9086cc16c925f294943eb62eb71499e9fd4cf71f8b9f4e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -4943,7 +4962,16 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" dependencies = [ - "num_enum_derive", + "num_enum_derive 0.5.11", +] + +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive 0.7.2", ] [[package]] @@ -4958,6 +4986,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "num_threads" version = "0.1.6" @@ -5054,6 +5094,7 @@ dependencies = [ "ipnetwork", "libc", "macaddr", + "mg-admin-client", "omicron-uuid-kinds", "omicron-workspace-hack", "once_cell", @@ -5062,7 +5103,7 @@ dependencies = [ "progenitor-client", "proptest", "rand 0.8.5", - "regress 0.9.0", + "regress", "reqwest", "schemars", "semver 1.0.22", @@ -5077,7 +5118,31 @@ dependencies = [ "test-strategy", "thiserror", "tokio", - "uuid", + "uuid 1.7.0", +] + +[[package]] +name = "omicron-ddm-admin-client" +version = "0.1.0" +dependencies = [ + "anyhow", + "ddm-admin-client", + "either", + "omicron-common", + "omicron-workspace-hack", + "omicron-zone-package", + "progenitor", + "progenitor-client", + "quote", + "reqwest", + "rustfmt-wrapper", + "serde", + "serde_json", + "sled-hardware-types", + "slog", + "thiserror", + "tokio", + "toml 0.8.10", ] [[package]] @@ -5154,7 +5219,7 @@ dependencies = [ "tokio-stream", "tokio-tungstenite", "toml 0.8.10", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -5276,7 +5341,7 @@ dependencies = [ "tufaceous", "tufaceous-lib", "update-common", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -5332,7 +5397,7 @@ dependencies = [ "textwrap 0.16.1", "tokio", "unicode-width", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -5410,7 +5475,6 @@ dependencies = [ "chrono", "clap 4.5.1", "crucible-agent-client", - "ddm-admin-client", "derive_more", "display-error-chain", "dns-server", @@ -5441,6 +5505,7 @@ dependencies = [ "nexus-config", "nexus-types", "omicron-common", + "omicron-ddm-admin-client", "omicron-test-utils", "omicron-workspace-hack", "once_cell", @@ -5483,7 +5548,7 @@ dependencies = [ "tokio-util", "toml 0.8.10", "usdt 0.5.0", - "uuid", + "uuid 1.7.0", "zeroize", "zone", ] @@ -5623,7 +5688,7 @@ dependencies = [ "string_cache", "subtle", "syn 1.0.109", - "syn 2.0.51", + "syn 2.0.52", "time", "time-macros", "tokio", @@ -5640,7 +5705,7 @@ dependencies = [ "unicode-normalization", "usdt 0.3.5", "usdt-impl 0.5.0", - "uuid", + "uuid 1.7.0", "yasna", "zerocopy 0.7.32", "zeroize", @@ -5743,7 +5808,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -5858,14 +5923,14 @@ dependencies = [ "omicron-workspace-hack", "progenitor", "rand 0.8.5", - "regress 0.9.0", + "regress", "reqwest", "serde", "serde_json", "thiserror", "tokio", "trust-dns-resolver", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -5902,7 +5967,7 @@ dependencies = [ "strum 0.26.1", "thiserror", "trybuild", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -5917,7 +5982,7 @@ dependencies = [ "reqwest", "serde", "slog", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -5957,7 +6022,7 @@ dependencies = [ "thiserror", "tokio", "toml 0.8.10", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -6000,7 +6065,7 @@ dependencies = [ "thiserror", "tokio", "usdt 0.5.0", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -6021,7 +6086,7 @@ dependencies = [ "slog-term", "thiserror", "tokio", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -6031,7 +6096,7 @@ dependencies = [ "omicron-workspace-hack", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -6052,7 +6117,7 @@ dependencies = [ "slog-dtrace", "thiserror", "tokio", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -6064,7 +6129,7 @@ dependencies = [ "chrono", "clap 4.5.1", "omicron-workspace-hack", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -6196,7 +6261,7 @@ dependencies = [ "regex", "regex-syntax 0.8.2", "structmeta 0.3.0", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -6343,7 +6408,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -6413,7 +6478,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -6586,7 +6651,7 @@ dependencies = [ "postgres-protocol", "serde", "serde_json", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -6674,7 +6739,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -6731,8 +6796,8 @@ dependencies = [ [[package]] name = "progenitor" -version = "0.5.0" -source = "git+https://github.com/oxidecomputer/progenitor?branch=main#08bbafc251d3d6828ca5921d1658c3d12d64fe7c" +version = "0.6.0" +source = "git+https://github.com/oxidecomputer/progenitor?branch=main#90d3282f488a17f9c85e25c26845fef2d92af435" dependencies = [ "progenitor-client", "progenitor-impl", @@ -6742,8 +6807,8 @@ dependencies = [ [[package]] name = "progenitor-client" -version = "0.5.0" -source = "git+https://github.com/oxidecomputer/progenitor?branch=main#08bbafc251d3d6828ca5921d1658c3d12d64fe7c" +version = "0.6.0" +source = "git+https://github.com/oxidecomputer/progenitor?branch=main#90d3282f488a17f9c85e25c26845fef2d92af435" dependencies = [ "bytes", "futures-core", @@ -6756,8 +6821,8 @@ dependencies = [ [[package]] name = "progenitor-impl" -version = "0.5.0" -source = "git+https://github.com/oxidecomputer/progenitor?branch=main#08bbafc251d3d6828ca5921d1658c3d12d64fe7c" +version = "0.6.0" +source = "git+https://github.com/oxidecomputer/progenitor?branch=main#90d3282f488a17f9c85e25c26845fef2d92af435" dependencies = [ "getopts", "heck 0.4.1", @@ -6770,7 +6835,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "syn 2.0.51", + "syn 2.0.52", "thiserror", "typify", "unicode-ident", @@ -6778,8 +6843,8 @@ dependencies = [ [[package]] name = "progenitor-macro" -version = "0.5.0" -source = "git+https://github.com/oxidecomputer/progenitor?branch=main#08bbafc251d3d6828ca5921d1658c3d12d64fe7c" +version = "0.6.0" +source = "git+https://github.com/oxidecomputer/progenitor?branch=main#90d3282f488a17f9c85e25c26845fef2d92af435" dependencies = [ "openapiv3", "proc-macro2", @@ -6790,7 +6855,7 @@ dependencies = [ "serde_json", "serde_tokenstream 0.2.0", "serde_yaml", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -6811,7 +6876,7 @@ dependencies = [ "thiserror", "tokio", "tokio-tungstenite", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -6841,7 +6906,7 @@ dependencies = [ "thiserror", "tokio", "tokio-tungstenite", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -7110,6 +7175,22 @@ dependencies = [ "yasna", ] +[[package]] +name = "rdb" +version = "0.1.0" +source = "git+https://github.com/oxidecomputer/maghemite?rev=1d8b818b0fd000bc6d2739575c8868b0781dfe41#1d8b818b0fd000bc6d2739575c8868b0781dfe41" +dependencies = [ + "anyhow", + "ciborium", + "mg-common", + "schemars", + "serde", + "serde_json", + "sled", + "slog", + "thiserror", +] + [[package]] name = "rdrand" version = "0.4.0" @@ -7145,7 +7226,7 @@ dependencies = [ "subprocess", "swrite", "tabled", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -7223,7 +7304,7 @@ checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -7267,16 +7348,6 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" -[[package]] -name = "regress" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f5f39ba4513916c1b2657b72af6ec671f091cd637992f58d0ede5cae4e5dea0" -dependencies = [ - "hashbrown 0.14.3", - "memchr", -] - [[package]] name = "regress" version = "0.9.0" @@ -7472,7 +7543,7 @@ dependencies = [ "regex", "relative-path", "rustc_version 0.4.0", - "syn 2.0.51", + "syn 2.0.52", "unicode-ident", ] @@ -7821,7 +7892,7 @@ dependencies = [ "serde", "thiserror", "url", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -7863,7 +7934,8 @@ dependencies = [ "schemars_derive", "serde", "serde_json", - "uuid", + "uuid 0.8.2", + "uuid 1.7.0", ] [[package]] @@ -7901,7 +7973,7 @@ checksum = "7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -8039,7 +8111,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -8100,7 +8172,7 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -8132,7 +8204,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -8174,7 +8246,7 @@ dependencies = [ "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -8354,12 +8426,12 @@ dependencies = [ "omicron-common", "omicron-workspace-hack", "progenitor", - "regress 0.9.0", + "regress", "reqwest", "schemars", "serde", "slog", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -8389,7 +8461,7 @@ dependencies = [ "thiserror", "tofino", "tokio", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -8427,7 +8499,7 @@ dependencies = [ "slog", "thiserror", "tokio", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -8505,7 +8577,7 @@ source = "git+https://github.com/oxidecomputer/slog-error-chain?branch=main#15f6 dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -8760,7 +8832,7 @@ checksum = "01b2e185515564f15375f593fb966b5718bc624ba77fe49fa4616ad619690554" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -8804,7 +8876,7 @@ dependencies = [ "slog", "thiserror", "tokio", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -8867,7 +8939,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive 0.2.0", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -8879,7 +8951,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive 0.3.0", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -8890,7 +8962,7 @@ checksum = "a60bcaff7397072dca0017d1db428e30d5002e00b6847703e2e42005c95fbe00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -8901,7 +8973,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -8966,7 +9038,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -8979,7 +9051,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -9026,9 +9098,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.51" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -9224,7 +9296,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta 0.2.0", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -9264,7 +9336,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -9454,7 +9526,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -9720,7 +9792,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -9946,8 +10018,8 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "typify" -version = "0.0.15" -source = "git+https://github.com/oxidecomputer/typify#131fe0ef3722d3034a61a8ab2994c29f9c978903" +version = "0.0.16" +source = "git+https://github.com/oxidecomputer/typify#c5ebe0a2bf08ad8a743be5b593b1a8526a3fff4a" dependencies = [ "typify-impl", "typify-macro", @@ -9955,25 +10027,25 @@ dependencies = [ [[package]] name = "typify-impl" -version = "0.0.15" -source = "git+https://github.com/oxidecomputer/typify#131fe0ef3722d3034a61a8ab2994c29f9c978903" +version = "0.0.16" +source = "git+https://github.com/oxidecomputer/typify#c5ebe0a2bf08ad8a743be5b593b1a8526a3fff4a" dependencies = [ "heck 0.4.1", "log", "proc-macro2", "quote", - "regress 0.8.0", + "regress", "schemars", "serde_json", - "syn 2.0.51", + "syn 2.0.52", "thiserror", "unicode-ident", ] [[package]] name = "typify-macro" -version = "0.0.15" -source = "git+https://github.com/oxidecomputer/typify#131fe0ef3722d3034a61a8ab2994c29f9c978903" +version = "0.0.16" +source = "git+https://github.com/oxidecomputer/typify#c5ebe0a2bf08ad8a743be5b593b1a8526a3fff4a" dependencies = [ "proc-macro2", "quote", @@ -9981,7 +10053,7 @@ dependencies = [ "serde", "serde_json", "serde_tokenstream 0.2.0", - "syn 2.0.51", + "syn 2.0.52", "typify-impl", ] @@ -10148,7 +10220,7 @@ dependencies = [ "tokio", "tokio-stream", "unicode-width", - "uuid", + "uuid 1.7.0", ] [[package]] @@ -10215,7 +10287,7 @@ dependencies = [ "proc-macro2", "quote", "serde_tokenstream 0.2.0", - "syn 2.0.51", + "syn 2.0.52", "usdt-impl 0.5.0", ] @@ -10253,7 +10325,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.51", + "syn 2.0.52", "thiserror", "thread-id", "version_check", @@ -10283,7 +10355,7 @@ dependencies = [ "proc-macro2", "quote", "serde_tokenstream 0.2.0", - "syn 2.0.51", + "syn 2.0.52", "usdt-impl 0.5.0", ] @@ -10299,6 +10371,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" + [[package]] name = "uuid" version = "1.7.0" @@ -10441,7 +10519,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", "wasm-bindgen-shared", ] @@ -10475,7 +10553,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -10633,7 +10711,6 @@ dependencies = [ "camino", "camino-tempfile", "clap 4.5.1", - "ddm-admin-client", "debug-ignore", "display-error-chain", "dpd-client", @@ -10662,6 +10739,7 @@ dependencies = [ "maplit", "omicron-certificates", "omicron-common", + "omicron-ddm-admin-client", "omicron-passwords", "omicron-test-utils", "omicron-workspace-hack", @@ -10689,7 +10767,7 @@ dependencies = [ "tufaceous-lib", "update-common", "update-engine", - "uuid", + "uuid 1.7.0", "wicket", "wicket-common", "wicketd-client", @@ -10704,14 +10782,14 @@ dependencies = [ "ipnetwork", "omicron-workspace-hack", "progenitor", - "regress 0.9.0", + "regress", "reqwest", "schemars", "serde", "serde_json", "slog", "update-engine", - "uuid", + "uuid 1.7.0", "wicket-common", ] @@ -11027,7 +11105,7 @@ checksum = "56097d5b91d711293a42be9289403896b68654625021732067eac7a4ca388a1f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -11038,7 +11116,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -11058,7 +11136,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 4a039e8c43..802f965965 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,6 @@ members = [ "clients/dpd-client", "clients/gateway-client", "clients/installinator-artifact-client", - "clients/mg-admin-client", "clients/nexus-client", "clients/oxide-client", "clients/oximeter-client", @@ -96,7 +95,6 @@ default-members = [ "clients/oximeter-client", "clients/sled-agent-client", "clients/wicketd-client", - "clients/mg-admin-client", "common", "dev-tools/crdb-seed", "dev-tools/omdb", @@ -201,7 +199,7 @@ csv = "1.3.0" curve25519-dalek = "4" datatest-stable = "0.2.3" display-error-chain = "0.2.0" -ddm-admin-client = { path = "clients/ddm-admin-client" } +omicron-ddm-admin-client = { path = "clients/ddm-admin-client" } db-macros = { path = "nexus/db-macros" } debug-ignore = "1.0.5" derive_more = "0.99.17" @@ -267,7 +265,8 @@ maplit = "1.0.2" mime_guess = "2.0.4" mockall = "0.12" newtype_derive = "0.1.6" -mg-admin-client = { path = "clients/mg-admin-client" } +mg-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "1d8b818b0fd000bc6d2739575c8868b0781dfe41" } +ddm-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "1d8b818b0fd000bc6d2739575c8868b0781dfe41" } multimap = "0.10.0" nexus-client = { path = "clients/nexus-client" } nexus-config = { path = "nexus-config" } @@ -669,6 +668,7 @@ branch = "oxide/omicron" # See also: uuid-kinds/README.adoc. [patch."https://github.com/oxidecomputer/omicron"] omicron-uuid-kinds = { path = "uuid-kinds" } +omicron-common = { path = "common" } [patch.crates-io.zone] git = 'https://github.com/oxidecomputer/zone' diff --git a/clients/ddm-admin-client/Cargo.toml b/clients/ddm-admin-client/Cargo.toml index f4aee0a961..8254007c7c 100644 --- a/clients/ddm-admin-client/Cargo.toml +++ b/clients/ddm-admin-client/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "ddm-admin-client" +name = "omicron-ddm-admin-client" version = "0.1.0" edition = "2021" license = "MPL-2.0" @@ -12,10 +12,10 @@ serde.workspace = true slog.workspace = true thiserror.workspace = true tokio.workspace = true - omicron-common.workspace = true sled-hardware-types.workspace = true omicron-workspace-hack.workspace = true +ddm-admin-client.workspace = true [build-dependencies] anyhow.workspace = true diff --git a/clients/ddm-admin-client/build.rs b/clients/ddm-admin-client/build.rs deleted file mode 100644 index c51ec05faa..0000000000 --- a/clients/ddm-admin-client/build.rs +++ /dev/null @@ -1,107 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. - -// Copyright 2022 Oxide Computer Company - -use anyhow::bail; -use anyhow::Context; -use anyhow::Result; -use omicron_zone_package::config::Config; -use omicron_zone_package::package::PackageSource; -use quote::quote; -use std::env; -use std::fs; -use std::path::Path; - -fn main() -> Result<()> { - // Find the current maghemite repo commit from our package manifest. - let manifest = fs::read_to_string("../../package-manifest.toml") - .context("failed to read ../../package-manifest.toml")?; - println!("cargo:rerun-if-changed=../../package-manifest.toml"); - - let config: Config = toml::from_str(&manifest) - .context("failed to parse ../package-manifest.toml")?; - - let ddm = config - .packages - .get("mg-ddm-gz") - .context("missing mg-ddm-gz package in ../package-manifest.toml")?; - - let local_path = match &ddm.source { - PackageSource::Prebuilt { commit, .. } => { - // Report a relatively verbose error if we haven't downloaded the requisite - // openapi spec. - let local_path = - env::var("DDM_OPENAPI_PATH").unwrap_or_else(|_| { - format!("../../out/downloads/ddm-admin-{commit}.json") - }); - if !Path::new(&local_path).exists() { - bail!("{local_path} doesn't exist; rerun `tools/ci_download_maghemite_openapi` (after updating `tools/maghemite_ddm_openapi_version` if the maghemite commit in package-manifest.toml has changed)"); - } - println!("cargo:rerun-if-changed={local_path}"); - local_path - } - - PackageSource::Manual => { - let local_path = - "../../out/downloads/ddm-admin-manual.json".to_string(); - if !Path::new(&local_path).exists() { - bail!("{local_path} doesn't exist, please copy manually built ddm-admin.json there!"); - } - println!("cargo:rerun-if-changed={local_path}"); - local_path - } - - _ => { - bail!( - "mg-ddm external package must have type `prebuilt` or `manual`" - ) - } - }; - - let spec = { - let bytes = fs::read(&local_path) - .with_context(|| format!("failed to read {local_path}"))?; - serde_json::from_slice(&bytes).with_context(|| { - format!("failed to parse {local_path} as openapi spec") - })? - }; - - let code = progenitor::Generator::new( - progenitor::GenerationSettings::new() - .with_inner_type(quote!(slog::Logger)) - .with_pre_hook(quote! { - |log: &slog::Logger, request: &reqwest::Request| { - slog::debug!(log, "client request"; - "method" => %request.method(), - "uri" => %request.url(), - "body" => ?&request.body(), - ); - } - }) - .with_post_hook(quote! { - |log: &slog::Logger, result: &Result<_, _>| { - slog::debug!(log, "client response"; "result" => ?result); - } - }), - ) - .generate_tokens(&spec) - .with_context(|| { - format!("failed to generate progenitor client from {local_path}") - })?; - - let content = rustfmt_wrapper::rustfmt(code).with_context(|| { - format!("rustfmt failed on progenitor code from {local_path}") - })?; - - let out_file = - Path::new(&env::var("OUT_DIR").expect("OUT_DIR env var not set")) - .join("ddm-admin-client.rs"); - - fs::write(&out_file, content).with_context(|| { - format!("failed to write client to {}", out_file.display()) - })?; - - Ok(()) -} diff --git a/clients/ddm-admin-client/src/lib.rs b/clients/ddm-admin-client/src/lib.rs index b88ea51e00..c27532d7d7 100644 --- a/clients/ddm-admin-client/src/lib.rs +++ b/clients/ddm-admin-client/src/lib.rs @@ -9,19 +9,12 @@ #![allow(clippy::match_single_binding)] #![allow(clippy::clone_on_copy)] -#[allow(dead_code)] -mod inner { - include!(concat!(env!("OUT_DIR"), "/ddm-admin-client.rs")); - - impl Copy for types::Ipv6Prefix {} -} - -pub use inner::types; -pub use inner::Error; +pub use ddm_admin_client::types; +pub use ddm_admin_client::Error; +use ddm_admin_client::Client as InnerClient; +use ddm_admin_client::{Ipv6Prefix, TunnelOrigin}; use either::Either; -use inner::types::{Ipv6Prefix, TunnelOrigin}; -use inner::Client as InnerClient; use omicron_common::address::Ipv6Subnet; use omicron_common::address::SLED_PREFIX; use omicron_common::backoff::retry_notify; diff --git a/clients/mg-admin-client/Cargo.toml b/clients/mg-admin-client/Cargo.toml deleted file mode 100644 index e426fa2371..0000000000 --- a/clients/mg-admin-client/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "mg-admin-client" -version = "0.1.0" -edition = "2021" -license = "MPL-2.0" - -[dependencies] -either.workspace = true -progenitor-client.workspace = true -reqwest = { workspace = true, features = ["json", "stream", "rustls-tls"] } -serde.workspace = true -slog.workspace = true -thiserror.workspace = true -tokio.workspace = true -omicron-common.workspace = true -omicron-workspace-hack.workspace = true - -[build-dependencies] -anyhow.workspace = true -omicron-zone-package.workspace = true -progenitor.workspace = true -quote.workspace = true -rustfmt-wrapper.workspace = true -serde_json.workspace = true -toml.workspace = true diff --git a/clients/mg-admin-client/build.rs b/clients/mg-admin-client/build.rs deleted file mode 100644 index d9886d0ece..0000000000 --- a/clients/mg-admin-client/build.rs +++ /dev/null @@ -1,103 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. - -// Copyright 2022 Oxide Computer Company - -use anyhow::bail; -use anyhow::Context; -use anyhow::Result; -use omicron_zone_package::config::Config; -use omicron_zone_package::package::PackageSource; -use quote::quote; -use std::env; -use std::fs; -use std::path::Path; - -fn main() -> Result<()> { - // Find the current maghemite repo commit from our package manifest. - let manifest = fs::read_to_string("../../package-manifest.toml") - .context("failed to read ../../package-manifest.toml")?; - println!("cargo:rerun-if-changed=../../package-manifest.toml"); - - let config: Config = toml::from_str(&manifest) - .context("failed to parse ../../package-manifest.toml")?; - let mg = config - .packages - .get("mgd") - .context("missing mgd package in ../../package-manifest.toml")?; - - let local_path = match &mg.source { - PackageSource::Prebuilt { commit, .. } => { - // Report a relatively verbose error if we haven't downloaded the requisite - // openapi spec. - let local_path = env::var("MG_OPENAPI_PATH").unwrap_or_else(|_| { - format!("../../out/downloads/mg-admin-{commit}.json") - }); - if !Path::new(&local_path).exists() { - bail!("{local_path} doesn't exist; rerun `tools/ci_download_maghemite_openapi` (after updating `tools/maghemite_mg_openapi_version` if the maghemite commit in package-manifest.toml has changed)"); - } - println!("cargo:rerun-if-changed={local_path}"); - local_path - } - - PackageSource::Manual => { - let local_path = - "../../out/downloads/mg-admin-manual.json".to_string(); - if !Path::new(&local_path).exists() { - bail!("{local_path} doesn't exist, please copy manually built mg-admin.json there!"); - } - println!("cargo:rerun-if-changed={local_path}"); - local_path - } - - _ => { - bail!("mgd external package must have type `prebuilt` or `manual`") - } - }; - - let spec = { - let bytes = fs::read(&local_path) - .with_context(|| format!("failed to read {local_path}"))?; - serde_json::from_slice(&bytes).with_context(|| { - format!("failed to parse {local_path} as openapi spec") - })? - }; - - let code = progenitor::Generator::new( - progenitor::GenerationSettings::new() - .with_inner_type(quote!(slog::Logger)) - .with_pre_hook(quote! { - |log: &slog::Logger, request: &reqwest::Request| { - slog::debug!(log, "client request"; - "method" => %request.method(), - "uri" => %request.url(), - "body" => ?&request.body(), - ); - } - }) - .with_post_hook(quote! { - |log: &slog::Logger, result: &Result<_, _>| { - slog::debug!(log, "client response"; "result" => ?result); - } - }), - ) - .generate_tokens(&spec) - .with_context(|| { - format!("failed to generate progenitor client from {local_path}") - })?; - - let content = rustfmt_wrapper::rustfmt(code).with_context(|| { - format!("rustfmt failed on progenitor code from {local_path}") - })?; - - let out_file = - Path::new(&env::var("OUT_DIR").expect("OUT_DIR env var not set")) - .join("mg-admin-client.rs"); - - fs::write(&out_file, content).with_context(|| { - format!("failed to write client to {}", out_file.display()) - })?; - - Ok(()) -} diff --git a/clients/mg-admin-client/src/lib.rs b/clients/mg-admin-client/src/lib.rs deleted file mode 100644 index b246cddc26..0000000000 --- a/clients/mg-admin-client/src/lib.rs +++ /dev/null @@ -1,100 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at https://mozilla.org/MPL/2.0/. - -// Copyright 2023 Oxide Computer Company - -#![allow(clippy::redundant_closure_call)] -#![allow(clippy::needless_lifetimes)] -#![allow(clippy::match_single_binding)] -#![allow(clippy::clone_on_copy)] -#![allow(rustdoc::broken_intra_doc_links)] -#![allow(rustdoc::invalid_html_tags)] - -#[allow(dead_code)] -mod inner { - include!(concat!(env!("OUT_DIR"), "/mg-admin-client.rs")); -} - -pub use inner::types; -use inner::types::Prefix4; -pub use inner::Error; - -use inner::Client as InnerClient; -use omicron_common::api::external::BgpPeerState; -use slog::Logger; -use std::hash::Hash; -use std::net::Ipv6Addr; -use std::net::SocketAddr; -use thiserror::Error; - -// TODO-cleanup Is it okay to hardcode this port number here? -const MGD_PORT: u16 = 4676; - -#[derive(Debug, Error)] -pub enum MgError { - #[error("Failed to construct an HTTP client: {0}")] - HttpClient(#[from] reqwest::Error), - - #[error("Failed making HTTP request to mgd: {0}")] - MgApi(#[from] Error), -} - -impl From for BgpPeerState { - fn from(s: inner::types::FsmStateKind) -> BgpPeerState { - use inner::types::FsmStateKind; - match s { - FsmStateKind::Idle => BgpPeerState::Idle, - FsmStateKind::Connect => BgpPeerState::Connect, - FsmStateKind::Active => BgpPeerState::Active, - FsmStateKind::OpenSent => BgpPeerState::OpenSent, - FsmStateKind::OpenConfirm => BgpPeerState::OpenConfirm, - FsmStateKind::SessionSetup => BgpPeerState::SessionSetup, - FsmStateKind::Established => BgpPeerState::Established, - } - } -} - -#[derive(Debug, Clone)] -pub struct Client { - pub inner: InnerClient, - pub log: Logger, -} - -impl Client { - /// Creates a new [`Client`] that points to localhost - pub fn localhost(log: &Logger) -> Result { - Self::new(log, SocketAddr::new(Ipv6Addr::LOCALHOST.into(), MGD_PORT)) - } - - pub fn new(log: &Logger, mgd_addr: SocketAddr) -> Result { - let dur = std::time::Duration::from_secs(60); - let log = log.new(slog::o!("MgAdminClient" => mgd_addr)); - - let inner = reqwest::ClientBuilder::new() - .connect_timeout(dur) - .timeout(dur) - .build()?; - let inner = InnerClient::new_with_client( - &format!("http://{mgd_addr}"), - inner, - log.clone(), - ); - Ok(Self { inner, log }) - } -} - -impl Eq for Prefix4 {} - -impl PartialEq for Prefix4 { - fn eq(&self, other: &Self) -> bool { - self.value == other.value && self.length == other.length - } -} - -impl Hash for Prefix4 { - fn hash(&self, state: &mut H) { - self.value.hash(state); - self.length.hash(state); - } -} diff --git a/common/Cargo.toml b/common/Cargo.toml index 3acd849b96..0485d3973b 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -23,6 +23,7 @@ hex.workspace = true http.workspace = true ipnetwork.workspace = true macaddr.workspace = true +mg-admin-client.workspace = true omicron-uuid-kinds.workspace = true proptest = { workspace = true, optional = true } rand.workspace = true diff --git a/common/src/api/external/mod.rs b/common/src/api/external/mod.rs index 1a355f4929..002f92ecc9 100644 --- a/common/src/api/external/mod.rs +++ b/common/src/api/external/mod.rs @@ -9,9 +9,6 @@ mod error; pub mod http_pagination; -use dropshot::HttpError; -pub use error::*; - pub use crate::api::internal::shared::SwitchLocation; use crate::update::ArtifactHash; use crate::update::ArtifactId; @@ -20,7 +17,9 @@ use anyhow::Context; use api_identity::ObjectIdentity; use chrono::DateTime; use chrono::Utc; +use dropshot::HttpError; pub use dropshot::PaginationOrder; +pub use error::*; use futures::stream::BoxStream; use parse_display::Display; use parse_display::FromStr; @@ -31,6 +30,7 @@ use semver; use serde::Deserialize; use serde::Serialize; use serde_with::{DeserializeFromStr, SerializeDisplay}; +use std::collections::HashMap; use std::convert::TryFrom; use std::fmt::Debug; use std::fmt::Display; @@ -2718,6 +2718,21 @@ pub enum BgpPeerState { Established, } +impl From for BgpPeerState { + fn from(s: mg_admin_client::types::FsmStateKind) -> BgpPeerState { + use mg_admin_client::types::FsmStateKind; + match s { + FsmStateKind::Idle => BgpPeerState::Idle, + FsmStateKind::Connect => BgpPeerState::Connect, + FsmStateKind::Active => BgpPeerState::Active, + FsmStateKind::OpenSent => BgpPeerState::OpenSent, + FsmStateKind::OpenConfirm => BgpPeerState::OpenConfirm, + FsmStateKind::SessionSetup => BgpPeerState::SessionSetup, + FsmStateKind::Established => BgpPeerState::Established, + } + } +} + /// The current status of a BGP peer. #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize, PartialEq)] pub struct BgpPeerStatus { @@ -2740,6 +2755,56 @@ pub struct BgpPeerStatus { pub switch: SwitchLocation, } +/// Opaque object representing BGP message history for a given BGP peer. The +/// contents of this object are not yet stable. +#[derive(Clone, Debug, Deserialize, Serialize)] +pub struct BgpMessageHistory(mg_admin_client::MessageHistory); + +impl BgpMessageHistory { + pub fn new(arg: mg_admin_client::MessageHistory) -> Self { + Self(arg) + } +} + +impl JsonSchema for BgpMessageHistory { + fn json_schema( + gen: &mut schemars::gen::SchemaGenerator, + ) -> schemars::schema::Schema { + let obj = schemars::schema::Schema::Object( + schemars::schema::SchemaObject::default(), + ); + gen.definitions_mut().insert(Self::schema_name(), obj.clone()); + obj + } + + fn schema_name() -> String { + "BgpMessageHistory".to_owned() + } +} + +/// BGP message history for a particular switch. +#[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] +pub struct SwitchBgpHistory { + /// Switch this message history is associated with. + pub switch: SwitchLocation, + + /// Message history indexed by peer address. + pub history: HashMap, +} + +/// BGP message history for rack switches. +#[derive(Clone, Debug, Deserialize, JsonSchema, Serialize)] +pub struct AggregateBgpMessageHistory { + /// BGP history organized by switch. + switch_histories: Vec, +} + +impl AggregateBgpMessageHistory { + pub fn new(switch_histories: Vec) -> Self { + Self { switch_histories } + } +} + /// A route imported from a BGP peer. #[derive(Clone, Debug, Deserialize, JsonSchema, Serialize, PartialEq)] pub struct BgpImportedRouteIpv4 { diff --git a/end-to-end-tests/src/helpers/icmp.rs b/end-to-end-tests/src/helpers/icmp.rs index 42617801d8..36b9bc5675 100644 --- a/end-to-end-tests/src/helpers/icmp.rs +++ b/end-to-end-tests/src/helpers/icmp.rs @@ -125,7 +125,7 @@ impl Pinger4 { fn show(self: Arc) { println!( - "{:15} {:7} {:7} {:7} {:7} {:7} {:7} {}", + "{:15} {:7} {:7} {:7} {:7} {:7} {:9} {}", "addr".dimmed(), "low".dimmed(), "avg".dimmed(), @@ -140,7 +140,7 @@ impl Pinger4 { // print a status line for each target for (_id, t) in self.targets.lock().unwrap().iter() { println!( - "{:15} {:7} {:7} {:7} {:7} {:7} {:7} {:<7}", + "{:15} {:7} {:7} {:7} {:7} {:7} {:9} {:<7}", t.dest.to_string().cyan(), format!("{:.3}", (t.low.as_micros() as f32 / 1000.0)), if t.rx_count == 0 { diff --git a/installinator/Cargo.toml b/installinator/Cargo.toml index 1f92913aa1..abfcc5e892 100644 --- a/installinator/Cargo.toml +++ b/installinator/Cargo.toml @@ -12,7 +12,6 @@ bytes.workspace = true camino.workspace = true cancel-safe-futures.workspace = true clap.workspace = true -ddm-admin-client.workspace = true display-error-chain.workspace = true futures.workspace = true hex.workspace = true @@ -24,6 +23,7 @@ ipcc.workspace = true itertools.workspace = true libc.workspace = true omicron-common.workspace = true +omicron-ddm-admin-client.workspace = true reqwest.workspace = true sha2.workspace = true sled-hardware.workspace = true diff --git a/installinator/src/bootstrap.rs b/installinator/src/bootstrap.rs index 59541df28e..9be1c12b86 100644 --- a/installinator/src/bootstrap.rs +++ b/installinator/src/bootstrap.rs @@ -9,12 +9,12 @@ use anyhow::ensure; use anyhow::Context; use anyhow::Result; -use ddm_admin_client::Client as DdmAdminClient; use illumos_utils::addrobj::AddrObject; use illumos_utils::dladm; use illumos_utils::dladm::Dladm; use illumos_utils::zone::Zones; use omicron_common::address::Ipv6Subnet; +use omicron_ddm_admin_client::Client as DdmAdminClient; use sled_hardware::underlay; use sled_hardware_types::underlay::BootstrapInterface; use slog::info; diff --git a/installinator/src/peers.rs b/installinator/src/peers.rs index 33ba0de0e5..644507da4b 100644 --- a/installinator/src/peers.rs +++ b/installinator/src/peers.rs @@ -14,7 +14,6 @@ use anyhow::{bail, Result}; use async_trait::async_trait; use buf_list::BufList; use bytes::Bytes; -use ddm_admin_client::Client as DdmAdminClient; use display_error_chain::DisplayErrorChain; use futures::{Stream, StreamExt}; use installinator_artifact_client::ClientError; @@ -24,6 +23,7 @@ use installinator_common::{ use itertools::Itertools; use omicron_common::address::BOOTSTRAP_ARTIFACT_PORT; use omicron_common::update::ArtifactHashId; +use omicron_ddm_admin_client::Client as DdmAdminClient; use reqwest::StatusCode; use sled_hardware_types::underlay::BootstrapInterface; use tokio::{sync::mpsc, time::Instant}; diff --git a/nexus/src/app/background/bfd.rs b/nexus/src/app/background/bfd.rs index ca23fb7f65..39b3c8f661 100644 --- a/nexus/src/app/background/bfd.rs +++ b/nexus/src/app/background/bfd.rs @@ -140,11 +140,11 @@ impl BackgroundTask for BfdManager { let mgd_clients = build_mgd_clients(mappings, log); for (location, c) in &mgd_clients { - let client_current = match c.inner.get_bfd_peers().await { + let client_current = match c.get_bfd_peers().await { Ok(x) => x.into_inner(), Err(e) => { error!(&log, "failed to get bfd sessions from mgd: {}", - c.inner.baseurl(); + c.baseurl(); "error" => e.to_string() ); continue; @@ -194,7 +194,6 @@ impl BackgroundTask for BfdManager { } }; if let Err(e) = mg - .inner .add_bfd_peer(&BfdPeerConfig { peer: x.remote, detection_threshold: x.detection_threshold, @@ -224,7 +223,7 @@ impl BackgroundTask for BfdManager { continue; } }; - if let Err(e) = mg.inner.remove_bfd_peer(&x.remote).await { + if let Err(e) = mg.remove_bfd_peer(&x.remote).await { error!(&log, "failed to remove bfd peer from switch daemon"; "error" => e.to_string(), "switch" => x.switch.to_string(), diff --git a/nexus/src/app/background/networking.rs b/nexus/src/app/background/networking.rs index 95e0cd32b3..95005d07cd 100644 --- a/nexus/src/app/background/networking.rs +++ b/nexus/src/app/background/networking.rs @@ -21,20 +21,10 @@ pub(crate) fn build_mgd_clients( let port = MGD_PORT; let socketaddr = std::net::SocketAddr::V6(SocketAddrV6::new(*addr, port, 0, 0)); - let client = - match mg_admin_client::Client::new(&log.clone(), socketaddr) { - Ok(client) => client, - Err(e) => { - error!( - log, - "error building mgd client"; - "location" => %location, - "addr" => %addr, - "error" => %e, - ); - continue; - } - }; + let client = mg_admin_client::Client::new( + format!("http://{}", socketaddr).as_str(), + log.clone(), + ); clients.push((*location, client)); } clients.into_iter().collect::>() diff --git a/nexus/src/app/background/sync_switch_configuration.rs b/nexus/src/app/background/sync_switch_configuration.rs index 4bc75bad10..e21f82b007 100644 --- a/nexus/src/app/background/sync_switch_configuration.rs +++ b/nexus/src/app/background/sync_switch_configuration.rs @@ -28,8 +28,9 @@ use futures::future::BoxFuture; use futures::FutureExt; use mg_admin_client::types::{ AddStaticRoute4Request, ApplyRequest, BgpPeerConfig, - DeleteStaticRoute4Request, Prefix4, StaticRoute4, StaticRoute4List, + DeleteStaticRoute4Request, StaticRoute4, StaticRoute4List, }; +use mg_admin_client::Prefix4; use nexus_db_queries::{ context::OpContext, db::{datastore::SwitchPortSettingsCombinedResult, DataStore}, @@ -605,7 +606,7 @@ impl BackgroundTask for SwitchPortSettingsManager { "switch_location" => ?location, "config" => ?config, ); - if let Err(e) = client.inner.bgp_apply(config).await { + if let Err(e) = client.bgp_apply(config).await { error!(log, "error while applying bgp configuration"; "error" => ?e); } } @@ -1083,7 +1084,7 @@ fn static_routes_to_del( .difference(routes_wanted) .map(|(nexthop, prefix)| StaticRoute4 { nexthop: *nexthop, - prefix: prefix.clone(), + prefix: *prefix, }) .collect::>(); @@ -1099,7 +1100,7 @@ fn static_routes_to_del( .iter() .map(|(nexthop, prefix)| StaticRoute4 { nexthop: *nexthop, - prefix: prefix.clone(), + prefix: *prefix, }) .collect::>(); @@ -1146,7 +1147,7 @@ fn static_routes_to_add( .difference(routes_on_switch) .map(|(nexthop, prefix)| StaticRoute4 { nexthop: *nexthop, - prefix: prefix.clone(), + prefix: *prefix, }) .collect::>(); @@ -1325,12 +1326,10 @@ async fn static_routes_on_switch<'a>( for (location, client) in mgd_clients { let static_routes: HashSet<(Ipv4Addr, Prefix4)> = - match client.inner.static_list_v4_routes().await { - Ok(routes) => routes - .list - .iter() - .map(|r| (r.nexthop, r.prefix.clone())) - .collect(), + match client.static_list_v4_routes().await { + Ok(routes) => { + routes.list.iter().map(|r| (r.nexthop, r.prefix)).collect() + } Err(_) => { error!( &log, @@ -1369,7 +1368,7 @@ async fn delete_static_routes( "switch_location" => ?switch_location, "request" => ?request, ); - if let Err(e) = client.inner.static_remove_v4_route(&request).await { + if let Err(e) = client.static_remove_v4_route(&request).await { error!( &log, "failed to delete routes from mgd"; @@ -1405,7 +1404,7 @@ async fn add_static_routes<'a>( "switch_location" => ?switch_location, "request" => ?request, ); - if let Err(e) = client.inner.static_add_v4_route(&request).await { + if let Err(e) = client.static_add_v4_route(&request).await { error!( &log, "failed to add routes to mgd"; diff --git a/nexus/src/app/bfd.rs b/nexus/src/app/bfd.rs index 22b9fc82ef..d3d0a731d0 100644 --- a/nexus/src/app/bfd.rs +++ b/nexus/src/app/bfd.rs @@ -69,7 +69,6 @@ impl super::Nexus { for s in &[SwitchLocation::Switch0, SwitchLocation::Switch1] { let mg_client = self.mg_client_for_switch_location(*s).await?; let status = mg_client - .inner .get_bfd_peers() .await .map_err(|e| { diff --git a/nexus/src/app/bgp.rs b/nexus/src/app/bgp.rs index 9e609712e2..4a85306d56 100644 --- a/nexus/src/app/bgp.rs +++ b/nexus/src/app/bgp.rs @@ -4,12 +4,14 @@ use crate::app::authz; use crate::external_api::params; +use mg_admin_client::types::MessageHistoryRequest; use nexus_db_model::{BgpAnnounceSet, BgpAnnouncement, BgpConfig}; use nexus_db_queries::context::OpContext; use omicron_common::api::external::http_pagination::PaginatedBy; use omicron_common::api::external::{ - self, BgpImportedRouteIpv4, BgpPeerStatus, CreateResult, DeleteResult, - Ipv4Net, ListResultVec, LookupResult, NameOrId, + self, BgpImportedRouteIpv4, BgpMessageHistory, BgpPeerStatus, CreateResult, + DeleteResult, Ipv4Net, ListResultVec, LookupResult, NameOrId, + SwitchBgpHistory, }; impl super::Nexus { @@ -93,7 +95,7 @@ impl super::Nexus { "failed to get mg clients: {e}" )) })? { - let router_info = match client.inner.get_routers().await { + let router_info = match client.get_routers().await { Ok(result) => result.into_inner(), Err(e) => { error!( @@ -123,6 +125,45 @@ impl super::Nexus { Ok(result) } + pub async fn bgp_message_history( + &self, + opctx: &OpContext, + sel: ¶ms::BgpRouteSelector, + ) -> ListResultVec { + opctx.authorize(authz::Action::Read, &authz::FLEET).await?; + + let mut result = Vec::new(); + for (switch, client) in &self.mg_clients().await.map_err(|e| { + external::Error::internal_error(&format!( + "failed to get mg clients: {e}" + )) + })? { + let history = match client + .message_history(&MessageHistoryRequest { asn: sel.asn }) + .await + { + Ok(result) => result.into_inner().by_peer.clone(), + Err(e) => { + error!( + self.log, + "failed to get bgp history from {switch}: {e}" + ); + continue; + } + }; + + result.push(SwitchBgpHistory { + switch: *switch, + history: history + .into_iter() + .map(|(k, v)| (k, BgpMessageHistory::new(v))) + .collect(), + }); + } + + Ok(result) + } + pub async fn bgp_imported_routes_ipv4( &self, opctx: &OpContext, @@ -136,7 +177,6 @@ impl super::Nexus { )) })? { let imported: Vec = match client - .inner .get_imported4(&mg_admin_client::types::GetImported4Request { asn: sel.asn, }) diff --git a/nexus/src/app/mod.rs b/nexus/src/app/mod.rs index 9d94e08a5d..fdae303489 100644 --- a/nexus/src/app/mod.rs +++ b/nexus/src/app/mod.rs @@ -253,8 +253,10 @@ impl Nexus { dpd_clients.insert(*location, Arc::new(dpd_client)); } for (location, config) in &config.pkg.mgd { - let mg_client = mg_admin_client::Client::new(&log, config.address) - .map_err(|e| format!("mg admin client: {e}"))?; + let mg_client = mg_admin_client::Client::new( + &format!("http://{}", config.address), + log.clone(), + ); mg_clients.insert(*location, Arc::new(mg_client)); } if config.pkg.dendrite.is_empty() { @@ -310,10 +312,15 @@ impl Nexus { for (location, addr) in &mappings { let port = MGD_PORT; let mgd_client = mg_admin_client::Client::new( - &log, - std::net::SocketAddr::new((*addr).into(), port), - ) - .map_err(|e| format!("mg admin client: {e}"))?; + &format!( + "http://{}", + &std::net::SocketAddr::new( + (*addr).into(), + port, + ) + ), + log.clone(), + ); mg_clients.insert(*location, Arc::new(mgd_client)); } break; @@ -903,22 +910,10 @@ impl Nexus { let port = MGD_PORT; let socketaddr = std::net::SocketAddr::V6(SocketAddrV6::new(*addr, port, 0, 0)); - let client = match mg_admin_client::Client::new( - &self.log.clone(), - socketaddr, - ) { - Ok(client) => client, - Err(e) => { - error!( - self.log, - "error building mgd client"; - "location" => %location, - "addr" => %addr, - "error" => %e, - ); - continue; - } - }; + let client = mg_admin_client::Client::new( + format!("http://{}", socketaddr).as_str(), + self.log.clone(), + ); clients.push((*location, client)); } Ok(clients.into_iter().collect::>()) diff --git a/nexus/src/external_api/http_entrypoints.rs b/nexus/src/external_api/http_entrypoints.rs index 9c8d9cef50..94cd35519b 100644 --- a/nexus/src/external_api/http_entrypoints.rs +++ b/nexus/src/external_api/http_entrypoints.rs @@ -42,7 +42,6 @@ use nexus_db_queries::db::lookup::ImageParentLookup; use nexus_db_queries::db::model::Name; use nexus_db_queries::{authz, db::datastore::ProbeInfo}; use nexus_types::external_api::shared::BfdStatus; -use omicron_common::api::external::http_pagination::data_page_params_for; use omicron_common::api::external::http_pagination::marker_for_name; use omicron_common::api::external::http_pagination::marker_for_name_or_id; use omicron_common::api::external::http_pagination::name_or_id_pagination; @@ -80,6 +79,9 @@ use omicron_common::api::external::TufRepoGetResponse; use omicron_common::api::external::TufRepoInsertResponse; use omicron_common::api::external::VpcFirewallRuleUpdateParams; use omicron_common::api::external::VpcFirewallRules; +use omicron_common::api::external::{ + http_pagination::data_page_params_for, AggregateBgpMessageHistory, +}; use omicron_common::bail_unless; use parse_display::Display; use propolis_client::support::tungstenite::protocol::frame::coding::CloseCode; @@ -278,6 +280,7 @@ pub(crate) fn external_api() -> NexusApiDescription { api.register(networking_bgp_announce_set_create)?; api.register(networking_bgp_announce_set_list)?; api.register(networking_bgp_announce_set_delete)?; + api.register(networking_bgp_message_history)?; api.register(networking_bfd_enable)?; api.register(networking_bfd_disable)?; @@ -3536,6 +3539,27 @@ async fn networking_bgp_status( apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await } +/// Get BGP router message history +#[endpoint { + method = GET, + path = "/v1/system/networking/bgp-message-history", + tags = ["system/networking"], +}] +async fn networking_bgp_message_history( + rqctx: RequestContext>, + query_params: Query, +) -> Result, HttpError> { + let apictx = rqctx.context(); + let opctx = crate::context::op_context_for_external_api(&rqctx).await?; + let handler = async { + let nexus = &apictx.nexus; + let sel = query_params.into_inner(); + let result = nexus.bgp_message_history(&opctx, &sel).await?; + Ok(HttpResponseOk(AggregateBgpMessageHistory::new(result))) + }; + apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await +} + //TODO pagination? the normal by-name/by-id stuff does not work here /// Get imported IPv4 BGP routes #[endpoint { diff --git a/nexus/tests/integration_tests/endpoints.rs b/nexus/tests/integration_tests/endpoints.rs index 7d2ff2596a..254bdabe8b 100644 --- a/nexus/tests/integration_tests/endpoints.rs +++ b/nexus/tests/integration_tests/endpoints.rs @@ -576,6 +576,8 @@ pub const DEMO_BGP_STATUS_URL: &'static str = "/v1/system/networking/bgp-status"; pub const DEMO_BGP_ROUTES_IPV4_URL: &'static str = "/v1/system/networking/bgp-routes-ipv4?asn=47"; +pub const DEMO_BGP_MESSAGE_HISTORY_URL: &'static str = + "/v1/system/networking/bgp-message-history?asn=47"; pub const DEMO_BFD_STATUS_URL: &'static str = "/v1/system/networking/bfd-status"; @@ -2247,6 +2249,15 @@ pub static VERIFY_ENDPOINTS: Lazy> = Lazy::new(|| { ], }, + VerifyEndpoint { + url: &DEMO_BGP_MESSAGE_HISTORY_URL, + visibility: Visibility::Public, + unprivileged_access: UnprivilegedAccess::None, + allowed_methods: vec![ + AllowedMethod::GetNonexistent, + ], + }, + VerifyEndpoint { url: &DEMO_BFD_STATUS_URL, visibility: Visibility::Public, diff --git a/nexus/tests/output/nexus_tags.txt b/nexus/tests/output/nexus_tags.txt index ba79d75f22..64413f396e 100644 --- a/nexus/tests/output/nexus_tags.txt +++ b/nexus/tests/output/nexus_tags.txt @@ -180,6 +180,7 @@ networking_bgp_config_create POST /v1/system/networking/bgp networking_bgp_config_delete DELETE /v1/system/networking/bgp networking_bgp_config_list GET /v1/system/networking/bgp networking_bgp_imported_routes_ipv4 GET /v1/system/networking/bgp-routes-ipv4 +networking_bgp_message_history GET /v1/system/networking/bgp-message-history networking_bgp_status GET /v1/system/networking/bgp-status networking_loopback_address_create POST /v1/system/networking/loopback-address networking_loopback_address_delete DELETE /v1/system/networking/loopback-address/{rack_id}/{switch_location}/{address}/{subnet_mask} diff --git a/openapi/nexus.json b/openapi/nexus.json index 7516a896a7..7d8e1909d2 100644 --- a/openapi/nexus.json +++ b/openapi/nexus.json @@ -6526,6 +6526,46 @@ } } }, + "/v1/system/networking/bgp-message-history": { + "get": { + "tags": [ + "system/networking" + ], + "summary": "Get BGP router message history", + "operationId": "networking_bgp_message_history", + "parameters": [ + { + "in": "query", + "name": "asn", + "description": "The ASN to filter on. Required.", + "required": true, + "schema": { + "type": "integer", + "format": "uint32", + "minimum": 0 + } + } + ], + "responses": { + "200": { + "description": "successful operation", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AggregateBgpMessageHistory" + } + } + } + }, + "4XX": { + "$ref": "#/components/responses/Error" + }, + "5XX": { + "$ref": "#/components/responses/Error" + } + } + } + }, "/v1/system/networking/bgp-routes-ipv4": { "get": { "tags": [ @@ -8930,6 +8970,22 @@ "items" ] }, + "AggregateBgpMessageHistory": { + "description": "BGP message history for rack switches.", + "type": "object", + "properties": { + "switch_histories": { + "description": "BGP history organized by switch.", + "type": "array", + "items": { + "$ref": "#/components/schemas/SwitchBgpHistory" + } + } + }, + "required": [ + "switch_histories" + ] + }, "Baseboard": { "description": "Properties that uniquely identify an Oxide hardware component", "type": "object", @@ -9373,6 +9429,7 @@ "switch" ] }, + "BgpMessageHistory": {}, "BgpPeer": { "description": "A BGP peer configuration for an interface. Includes the set of announcements that will be advertised to the peer identified by `addr`. The `bgp_config` parameter is a reference to global BGP parameters. The `interface_name` indicates what interface the peer should be contacted on.", "type": "object", @@ -16019,6 +16076,31 @@ "time_modified" ] }, + "SwitchBgpHistory": { + "description": "BGP message history for a particular switch.", + "type": "object", + "properties": { + "history": { + "description": "Message history indexed by peer address.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/BgpMessageHistory" + } + }, + "switch": { + "description": "Switch this message history is associated with.", + "allOf": [ + { + "$ref": "#/components/schemas/SwitchLocation" + } + ] + } + }, + "required": [ + "history", + "switch" + ] + }, "SwitchInterfaceConfig": { "description": "A switch port interface configuration for a port settings object.", "type": "object", diff --git a/package-manifest.toml b/package-manifest.toml index 83c12b9174..e88f135985 100644 --- a/package-manifest.toml +++ b/package-manifest.toml @@ -535,10 +535,10 @@ source.repo = "maghemite" # `tools/maghemite_openapi_version`. Failing to do so will cause a failure when # building `ddm-admin-client` (which will instruct you to update # `tools/maghemite_openapi_version`). -source.commit = "ee0896f5cf9ba0799f155dd8c95f6e1dabaf80ba" +source.commit = "1d8b818b0fd000bc6d2739575c8868b0781dfe41" # The SHA256 digest is automatically posted to: # https://buildomat.eng.oxide.computer/public/file/oxidecomputer/maghemite/image//maghemite.sha256.txt -source.sha256 = "f1407cb9aac188d6493d2b0f948c75aad2c36668ddf4ae2a1ed80e9dd395b35d" +source.sha256 = "a3914f991ab1441486d42097d135df15c09604c02a8104810e634b05f2e3f525" output.type = "tarball" [package.mg-ddm] @@ -551,10 +551,10 @@ source.repo = "maghemite" # `tools/maghemite_openapi_version`. Failing to do so will cause a failure when # building `ddm-admin-client` (which will instruct you to update # `tools/maghemite_openapi_version`). -source.commit = "ee0896f5cf9ba0799f155dd8c95f6e1dabaf80ba" +source.commit = "1d8b818b0fd000bc6d2739575c8868b0781dfe41" # The SHA256 digest is automatically posted to: # https://buildomat.eng.oxide.computer/public/file/oxidecomputer/maghemite/image//mg-ddm.sha256.txt -source.sha256 = "fae53cb39536dc92d97cb9610de65b0acbce285e685d7167b719ea6311844fec" +source.sha256 = "e973385b276c7910a76a58151723f30c39e2f8a302a506992b0543a7e95616fb" output.type = "zone" output.intermediate_only = true @@ -566,10 +566,10 @@ source.repo = "maghemite" # `tools/maghemite_openapi_version`. Failing to do so will cause a failure when # building `ddm-admin-client` (which will instruct you to update # `tools/maghemite_openapi_version`). -source.commit = "ee0896f5cf9ba0799f155dd8c95f6e1dabaf80ba" +source.commit = "1d8b818b0fd000bc6d2739575c8868b0781dfe41" # The SHA256 digest is automatically posted to: # https://buildomat.eng.oxide.computer/public/file/oxidecomputer/maghemite/image//mg-ddm.sha256.txt -source.sha256 = "151aeb26414989cad571b3886786efbeeafd91c41a93a747c784cdc654d5876d" +source.sha256 = "88065a5d5051c4e684ea15bd182c1d734d649df2336b7612108e2aee330b81a6" output.type = "zone" output.intermediate_only = true diff --git a/sled-agent/Cargo.toml b/sled-agent/Cargo.toml index 52c6e61efa..d210b9b86b 100644 --- a/sled-agent/Cargo.toml +++ b/sled-agent/Cargo.toml @@ -20,7 +20,6 @@ chrono.workspace = true clap.workspace = true # Only used by the simulated sled agent. crucible-agent-client.workspace = true -ddm-admin-client.workspace = true derive_more.workspace = true dns-server.workspace = true dns-service-client.workspace = true @@ -48,6 +47,7 @@ nexus-client.workspace = true nexus-config.workspace = true nexus-types.workspace = true omicron-common.workspace = true +omicron-ddm-admin-client.workspace = true once_cell.workspace = true oximeter.workspace = true oximeter-instruments.workspace = true diff --git a/sled-agent/src/bootstrap/bootstore_setup.rs b/sled-agent/src/bootstrap/bootstore_setup.rs index 120c7df000..e5079b978e 100644 --- a/sled-agent/src/bootstrap/bootstore_setup.rs +++ b/sled-agent/src/bootstrap/bootstore_setup.rs @@ -11,7 +11,7 @@ use super::config::BOOTSTORE_PORT; use super::server::StartError; use bootstore::schemes::v0 as bootstore; use camino::Utf8PathBuf; -use ddm_admin_client::Client as DdmAdminClient; +use omicron_ddm_admin_client::Client as DdmAdminClient; use sled_hardware_types::underlay::BootstrapInterface; use sled_hardware_types::Baseboard; use sled_storage::dataset::CLUSTER_DATASET; diff --git a/sled-agent/src/bootstrap/early_networking.rs b/sled-agent/src/bootstrap/early_networking.rs index c70758f775..0cc0f22f5d 100644 --- a/sled-agent/src/bootstrap/early_networking.rs +++ b/sled-agent/src/bootstrap/early_networking.rs @@ -6,7 +6,6 @@ use anyhow::{anyhow, Context}; use bootstore::schemes::v0 as bootstore; -use ddm_admin_client::DdmError; use dpd_client::types::{ LinkCreate, LinkId, LinkSettings, PortId, PortSettings, }; @@ -17,10 +16,10 @@ use internal_dns::resolver::{ResolveError, Resolver as DnsResolver}; use internal_dns::ServiceName; use ipnetwork::Ipv6Network; use mg_admin_client::types::{ - AddStaticRoute4Request, ApplyRequest, BgpPeerConfig, Prefix4, StaticRoute4, + AddStaticRoute4Request, ApplyRequest, BgpPeerConfig, StaticRoute4, StaticRoute4List, }; -use mg_admin_client::Client as MgdClient; +use mg_admin_client::{Client as MgdClient, Prefix4}; use omicron_common::address::DENDRITE_PORT; use omicron_common::address::{MGD_PORT, MGS_PORT}; use omicron_common::api::internal::shared::{ @@ -32,6 +31,7 @@ use omicron_common::backoff::{ ExponentialBackoffBuilder, }; use omicron_common::OMICRON_DPD_TAG; +use omicron_ddm_admin_client::DdmError; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use slog::Logger; @@ -446,14 +446,12 @@ impl<'a> EarlyNetworkSetup<'a> { } let mgd = MgdClient::new( - &self.log, - SocketAddrV6::new(switch_zone_underlay_ip, MGD_PORT, 0, 0).into(), - ) - .map_err(|e| { - EarlyNetworkSetupError::MgdError(format!( - "initialize mgd client: {e}" - )) - })?; + &format!( + "http://{}", + &SocketAddrV6::new(switch_zone_underlay_ip, MGD_PORT, 0, 0) + ), + self.log.clone(), + ); let mut config: Option = None; let mut bgp_peer_configs = HashMap::>::new(); @@ -509,25 +507,21 @@ impl<'a> EarlyNetworkSetup<'a> { if !bgp_peer_configs.is_empty() { if let Some(config) = &config { - mgd.inner - .bgp_apply(&ApplyRequest { - asn: config.asn, - peers: bgp_peer_configs, - originate: config - .originate - .iter() - .map(|x| Prefix4 { - length: x.prefix(), - value: x.ip(), - }) - .collect(), - }) - .await - .map_err(|e| { - EarlyNetworkSetupError::BgpConfigurationError(format!( - "BGP peer configuration failed: {e}", - )) - })?; + mgd.bgp_apply(&ApplyRequest { + asn: config.asn, + peers: bgp_peer_configs, + originate: config + .originate + .iter() + .map(|x| Prefix4 { length: x.prefix(), value: x.ip() }) + .collect(), + }) + .await + .map_err(|e| { + EarlyNetworkSetupError::BgpConfigurationError(format!( + "BGP peer configuration failed: {e}", + )) + })?; } } @@ -551,7 +545,7 @@ impl<'a> EarlyNetworkSetup<'a> { rq.routes.list.push(sr); } } - mgd.inner.static_add_v4_route(&rq).await.map_err(|e| { + mgd.static_add_v4_route(&rq).await.map_err(|e| { EarlyNetworkSetupError::BgpConfigurationError(format!( "static routing configuration failed: {e}", )) diff --git a/sled-agent/src/bootstrap/pre_server.rs b/sled-agent/src/bootstrap/pre_server.rs index 6769af8ca2..394cde7ac2 100644 --- a/sled-agent/src/bootstrap/pre_server.rs +++ b/sled-agent/src/bootstrap/pre_server.rs @@ -23,7 +23,6 @@ use crate::sled_agent::SledAgent; use crate::storage_monitor::UnderlayAccess; use camino::Utf8PathBuf; use cancel_safe_futures::TryStreamExt; -use ddm_admin_client::Client as DdmAdminClient; use futures::stream; use futures::StreamExt; use illumos_utils::addrobj::AddrObject; @@ -35,6 +34,7 @@ use illumos_utils::zone; use illumos_utils::zone::Zones; use omicron_common::address::Ipv6Subnet; use omicron_common::FileKv; +use omicron_ddm_admin_client::Client as DdmAdminClient; use sled_hardware::underlay; use sled_hardware::DendriteAsic; use sled_hardware::SledMode; diff --git a/sled-agent/src/bootstrap/server.rs b/sled-agent/src/bootstrap/server.rs index 47a8019ac5..d1f3fa0646 100644 --- a/sled-agent/src/bootstrap/server.rs +++ b/sled-agent/src/bootstrap/server.rs @@ -30,8 +30,6 @@ use crate::storage_monitor::UnderlayAccess; use bootstore::schemes::v0 as bootstore; use camino::Utf8PathBuf; use cancel_safe_futures::TryStreamExt; -use ddm_admin_client::Client as DdmAdminClient; -use ddm_admin_client::DdmError; use dropshot::HttpServer; use futures::StreamExt; use illumos_utils::dladm; @@ -40,6 +38,8 @@ use illumos_utils::zone; use illumos_utils::zone::Zones; use omicron_common::ledger; use omicron_common::ledger::Ledger; +use omicron_ddm_admin_client::Client as DdmAdminClient; +use omicron_ddm_admin_client::DdmError; use sled_hardware::underlay; use sled_storage::dataset::CONFIG_DATASET; use sled_storage::manager::StorageHandle; diff --git a/sled-agent/src/rack_setup/service.rs b/sled-agent/src/rack_setup/service.rs index 6b189f423c..0fae365242 100644 --- a/sled-agent/src/rack_setup/service.rs +++ b/sled-agent/src/rack_setup/service.rs @@ -86,7 +86,6 @@ use anyhow::{bail, Context}; use bootstore::schemes::v0 as bootstore; use camino::Utf8PathBuf; use chrono::Utc; -use ddm_admin_client::{Client as DdmAdminClient, DdmError}; use internal_dns::resolver::{DnsError, Resolver as DnsResolver}; use internal_dns::ServiceName; use nexus_client::{ @@ -100,6 +99,7 @@ use omicron_common::backoff::{ retry_notify, retry_policy_internal_service_aggressive, BackoffError, }; use omicron_common::ledger::{self, Ledger, Ledgerable}; +use omicron_ddm_admin_client::{Client as DdmAdminClient, DdmError}; use serde::{Deserialize, Serialize}; use sled_agent_client::{ types as SledAgentTypes, Client as SledAgentClient, Error as SledAgentError, diff --git a/sled-agent/src/services.rs b/sled-agent/src/services.rs index e0a4693877..55ebdccb5c 100644 --- a/sled-agent/src/services.rs +++ b/sled-agent/src/services.rs @@ -41,7 +41,6 @@ use crate::zone_bundle::BundleError; use crate::zone_bundle::ZoneBundler; use anyhow::anyhow; use camino::{Utf8Path, Utf8PathBuf}; -use ddm_admin_client::{Client as DdmAdminClient, DdmError}; use dpd_client::{types as DpdTypes, Client as DpdClient, Error as DpdError}; use dropshot::HandlerTaskMode; use illumos_utils::addrobj::AddrObject; @@ -87,6 +86,7 @@ use omicron_common::backoff::{ retry_notify, retry_policy_internal_service_aggressive, BackoffError, }; use omicron_common::ledger::{self, Ledger, Ledgerable}; +use omicron_ddm_admin_client::{Client as DdmAdminClient, DdmError}; use once_cell::sync::OnceCell; use rand::prelude::SliceRandom; use sled_hardware::is_gimlet; diff --git a/sled-agent/src/sled_agent.rs b/sled-agent/src/sled_agent.rs index 713b10428f..aa051e6e5b 100644 --- a/sled-agent/src/sled_agent.rs +++ b/sled-agent/src/sled_agent.rs @@ -34,7 +34,6 @@ use crate::zone_bundle; use crate::zone_bundle::BundleError; use bootstore::schemes::v0 as bootstore; use camino::Utf8PathBuf; -use ddm_admin_client::Client as DdmAdminClient; use derive_more::From; use dropshot::HttpError; use futures::stream::FuturesUnordered; @@ -65,6 +64,7 @@ use omicron_common::backoff::{ retry_notify, retry_policy_internal_service, retry_policy_internal_service_aggressive, BackoffError, }; +use omicron_ddm_admin_client::Client as DdmAdminClient; use oximeter::types::ProducerRegistry; use sled_hardware::{underlay, HardwareManager}; use sled_hardware_types::underlay::BootstrapInterface; @@ -1174,7 +1174,7 @@ pub enum AddSledError { err: bootstrap_agent_client::Error, }, #[error("Failed to connect to DDM")] - DdmAdminClient(#[source] ddm_admin_client::DdmError), + DdmAdminClient(#[source] omicron_ddm_admin_client::DdmError), #[error("Failed to learn bootstrap ip for {0:?}")] NotFound(BaseboardId), #[error("Failed to initialize {sled_id}: {err}")] diff --git a/tools/maghemite_ddm_openapi_version b/tools/maghemite_ddm_openapi_version index 14ff749506..73cbfefad8 100644 --- a/tools/maghemite_ddm_openapi_version +++ b/tools/maghemite_ddm_openapi_version @@ -1,2 +1,2 @@ -COMMIT="ee0896f5cf9ba0799f155dd8c95f6e1dabaf80ba" +COMMIT="a19e88979ab8ab9a0136854182c410c29047bfcb" SHA2="0b0dbc2f8bbc5d2d9be92d64c4865f8f9335355aae62f7de9f67f81dfb3f1803" diff --git a/tools/maghemite_mg_openapi_version b/tools/maghemite_mg_openapi_version index a2becb4efc..f46f293368 100644 --- a/tools/maghemite_mg_openapi_version +++ b/tools/maghemite_mg_openapi_version @@ -1,2 +1,2 @@ -COMMIT="ee0896f5cf9ba0799f155dd8c95f6e1dabaf80ba" -SHA2="0ac038bbaa54d0ae0ac5ccaeff48f03070618372cca26c9d09b716b909bf9355" +COMMIT="a19e88979ab8ab9a0136854182c410c29047bfcb" +SHA2="768b38ad9b01299be66a899241158123fc90ea240708a517c8acfa52b4b2eb8e" diff --git a/tools/maghemite_mgd_checksums b/tools/maghemite_mgd_checksums index 2f58a88808..face9b9b1b 100644 --- a/tools/maghemite_mgd_checksums +++ b/tools/maghemite_mgd_checksums @@ -1,2 +1,2 @@ -CIDL_SHA256="151aeb26414989cad571b3886786efbeeafd91c41a93a747c784cdc654d5876d" -MGD_LINUX_SHA256="943b0a52d279bde55a419e2cdb24873acc32703bc97bd599376117ee0edc1511" \ No newline at end of file +CIDL_SHA256="813fe3d408f538a9d7121a616fce5f87e6c42cf2800e20c1a2759c24c9e8b77b" +MGD_LINUX_SHA256="03bf4e9fbe7d46be5dbcf83f9cd67520383f843767939e06d0db93ce4e584111" \ No newline at end of file diff --git a/tools/update_maghemite.sh b/tools/update_maghemite.sh index 583a75ab22..5c146820a3 100755 --- a/tools/update_maghemite.sh +++ b/tools/update_maghemite.sh @@ -19,50 +19,9 @@ PACKAGES=( "mg-ddm" "mgd" ) - REPO="oxidecomputer/maghemite" - . "$SOURCE_DIR/update_helpers.sh" -function update_openapi { - TARGET_COMMIT="$1" - DRY_RUN="$2" - DAEMON="$3" - SHA=$(get_sha "$REPO" "$TARGET_COMMIT" "${DAEMON}-admin.json" "openapi") - OUTPUT=$(printf "COMMIT=\"%s\"\nSHA2=\"%s\"\n" "$TARGET_COMMIT" "$SHA") - - if [ -n "$DRY_RUN" ]; then - OPENAPI_PATH="/dev/null" - else - OPENAPI_PATH="$SOURCE_DIR/maghemite_${DAEMON}_openapi_version" - fi - echo "Updating Maghemite OpenAPI from: $TARGET_COMMIT" - set -x - echo "$OUTPUT" > "$OPENAPI_PATH" - set +x -} - -function update_mgd { - TARGET_COMMIT="$1" - DRY_RUN="$2" - DAEMON="$3" - SHA=$(get_sha "$REPO" "$TARGET_COMMIT" "mgd" "image") - OUTPUT=$(printf "CIDL_SHA256=\"%s\"\n" "$SHA") - - SHA_LINUX=$(get_sha "$REPO" "$TARGET_COMMIT" "mgd" "linux") - OUTPUT_LINUX=$(printf "MGD_LINUX_SHA256=\"%s\"\n" "$SHA_LINUX") - - if [ -n "$DRY_RUN" ]; then - MGD_PATH="/dev/null" - else - MGD_PATH="$SOURCE_DIR/maghemite_mgd_checksums" - fi - echo "Updating Maghemite mgd from: $TARGET_COMMIT" - set -x - printf "$OUTPUT\n$OUTPUT_LINUX" > $MGD_PATH - set +x -} - function main { TARGET_COMMIT="" DRY_RUN="" @@ -83,10 +42,6 @@ function main { TARGET_COMMIT=$(get_latest_commit_from_gh "$REPO" "$TARGET_COMMIT") install_toml2json do_update_packages "$TARGET_COMMIT" "$DRY_RUN" "$REPO" "${PACKAGES[@]}" - update_openapi "$TARGET_COMMIT" "$DRY_RUN" ddm - update_openapi "$TARGET_COMMIT" "$DRY_RUN" mg - update_mgd "$TARGET_COMMIT" "$DRY_RUN" - do_update_packages "$TARGET_COMMIT" "$DRY_RUN" "$REPO" "${PACKAGES[@]}" } main "$@" diff --git a/wicketd/Cargo.toml b/wicketd/Cargo.toml index 4b6e6d6f5f..ef9e0c2378 100644 --- a/wicketd/Cargo.toml +++ b/wicketd/Cargo.toml @@ -46,7 +46,7 @@ toml.workspace = true uuid.workspace = true bootstrap-agent-client.workspace = true -ddm-admin-client.workspace = true +omicron-ddm-admin-client.workspace = true gateway-client.workspace = true installinator-artifactd.workspace = true installinator-common.workspace = true diff --git a/wicketd/src/bootstrap_addrs.rs b/wicketd/src/bootstrap_addrs.rs index f7256ae6ac..dd13fe0f44 100644 --- a/wicketd/src/bootstrap_addrs.rs +++ b/wicketd/src/bootstrap_addrs.rs @@ -2,8 +2,8 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at https://mozilla.org/MPL/2.0/. -use ddm_admin_client::Client as DdmAdminClient; use futures::stream::FuturesUnordered; +use omicron_ddm_admin_client::Client as DdmAdminClient; use sled_hardware_types::underlay::BootstrapInterface; use sled_hardware_types::Baseboard; use slog::warn; diff --git a/workspace-hack/Cargo.toml b/workspace-hack/Cargo.toml index 5efbb6c1f1..c4fd52aef7 100644 --- a/workspace-hack/Cargo.toml +++ b/workspace-hack/Cargo.toml @@ -28,8 +28,8 @@ byteorder = { version = "1.5.0" } bytes = { version = "1.5.0", features = ["serde"] } chrono = { version = "0.4.34", features = ["serde"] } cipher = { version = "0.4.4", default-features = false, features = ["block-padding", "zeroize"] } -clap = { version = "4.5.1", features = ["cargo", "derive", "env", "wrap_help"] } -clap_builder = { version = "4.5.1", default-features = false, features = ["cargo", "color", "env", "std", "suggestions", "usage", "wrap_help"] } +clap = { version = "4.5.1", features = ["cargo", "derive", "env", "unstable-styles", "wrap_help"] } +clap_builder = { version = "4.5.1", default-features = false, features = ["cargo", "env", "std", "suggestions", "unstable-styles", "usage", "wrap_help"] } console = { version = "0.15.8" } const-oid = { version = "0.9.6", default-features = false, features = ["db", "std"] } crossbeam-epoch = { version = "0.9.18" } @@ -65,7 +65,7 @@ itertools = { version = "0.10.5" } lalrpop-util = { version = "0.19.12" } lazy_static = { version = "1.4.0", default-features = false, features = ["spin_no_std"] } libc = { version = "0.2.153", features = ["extra_traits"] } -log = { version = "0.4.20", default-features = false, features = ["std"] } +log = { version = "0.4.21", default-features = false, features = ["std"] } managed = { version = "0.8.0", default-features = false, features = ["alloc", "map"] } memchr = { version = "2.7.1" } nom = { version = "7.1.3" } @@ -87,7 +87,7 @@ regex-automata = { version = "0.4.5", default-features = false, features = ["dfa regex-syntax = { version = "0.8.2" } reqwest = { version = "0.11.24", features = ["blocking", "cookies", "json", "rustls-tls", "stream"] } ring = { version = "0.17.8", features = ["std"] } -schemars = { version = "0.8.16", features = ["bytes", "chrono", "uuid1"] } +schemars = { version = "0.8.16", features = ["bytes", "chrono", "uuid", "uuid1"] } semver = { version = "1.0.22", features = ["serde"] } serde = { version = "1.0.197", features = ["alloc", "derive", "rc"] } serde_json = { version = "1.0.114", features = ["raw_value", "unbounded_depth"] } @@ -98,14 +98,16 @@ spin = { version = "0.9.8" } string_cache = { version = "0.8.7" } subtle = { version = "2.5.0" } syn-dff4ba8e3ae991db = { package = "syn", version = "1.0.109", features = ["extra-traits", "fold", "full", "visit"] } -syn-f595c2ba2a3f28df = { package = "syn", version = "2.0.51", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] } +syn-f595c2ba2a3f28df = { package = "syn", version = "2.0.52", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] } time = { version = "0.3.34", features = ["formatting", "local-offset", "macros", "parsing"] } tokio = { version = "1.36.0", features = ["full", "test-util"] } tokio-postgres = { version = "0.7.10", features = ["with-chrono-0_4", "with-serde_json-1", "with-uuid-1"] } tokio-stream = { version = "0.1.14", features = ["net"] } tokio-util = { version = "0.7.10", features = ["codec", "io-util"] } toml = { version = "0.7.8" } +toml_datetime = { version = "0.6.5", default-features = false, features = ["serde"] } toml_edit-3c51e837cfc5589a = { package = "toml_edit", version = "0.22.6", features = ["serde"] } +toml_edit-cdcf2f9584511fe6 = { package = "toml_edit", version = "0.19.15", features = ["serde"] } tracing = { version = "0.1.40", features = ["log"] } trust-dns-proto = { version = "0.22.0" } unicode-bidi = { version = "0.3.15" } @@ -133,8 +135,8 @@ byteorder = { version = "1.5.0" } bytes = { version = "1.5.0", features = ["serde"] } chrono = { version = "0.4.34", features = ["serde"] } cipher = { version = "0.4.4", default-features = false, features = ["block-padding", "zeroize"] } -clap = { version = "4.5.1", features = ["cargo", "derive", "env", "wrap_help"] } -clap_builder = { version = "4.5.1", default-features = false, features = ["cargo", "color", "env", "std", "suggestions", "usage", "wrap_help"] } +clap = { version = "4.5.1", features = ["cargo", "derive", "env", "unstable-styles", "wrap_help"] } +clap_builder = { version = "4.5.1", default-features = false, features = ["cargo", "env", "std", "suggestions", "unstable-styles", "usage", "wrap_help"] } console = { version = "0.15.8" } const-oid = { version = "0.9.6", default-features = false, features = ["db", "std"] } crossbeam-epoch = { version = "0.9.18" } @@ -170,7 +172,7 @@ itertools = { version = "0.10.5" } lalrpop-util = { version = "0.19.12" } lazy_static = { version = "1.4.0", default-features = false, features = ["spin_no_std"] } libc = { version = "0.2.153", features = ["extra_traits"] } -log = { version = "0.4.20", default-features = false, features = ["std"] } +log = { version = "0.4.21", default-features = false, features = ["std"] } managed = { version = "0.8.0", default-features = false, features = ["alloc", "map"] } memchr = { version = "2.7.1" } nom = { version = "7.1.3" } @@ -192,7 +194,7 @@ regex-automata = { version = "0.4.5", default-features = false, features = ["dfa regex-syntax = { version = "0.8.2" } reqwest = { version = "0.11.24", features = ["blocking", "cookies", "json", "rustls-tls", "stream"] } ring = { version = "0.17.8", features = ["std"] } -schemars = { version = "0.8.16", features = ["bytes", "chrono", "uuid1"] } +schemars = { version = "0.8.16", features = ["bytes", "chrono", "uuid", "uuid1"] } semver = { version = "1.0.22", features = ["serde"] } serde = { version = "1.0.197", features = ["alloc", "derive", "rc"] } serde_json = { version = "1.0.114", features = ["raw_value", "unbounded_depth"] } @@ -203,7 +205,7 @@ spin = { version = "0.9.8" } string_cache = { version = "0.8.7" } subtle = { version = "2.5.0" } syn-dff4ba8e3ae991db = { package = "syn", version = "1.0.109", features = ["extra-traits", "fold", "full", "visit"] } -syn-f595c2ba2a3f28df = { package = "syn", version = "2.0.51", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] } +syn-f595c2ba2a3f28df = { package = "syn", version = "2.0.52", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] } time = { version = "0.3.34", features = ["formatting", "local-offset", "macros", "parsing"] } time-macros = { version = "0.2.17", default-features = false, features = ["formatting", "parsing"] } tokio = { version = "1.36.0", features = ["full", "test-util"] } @@ -211,7 +213,9 @@ tokio-postgres = { version = "0.7.10", features = ["with-chrono-0_4", "with-serd tokio-stream = { version = "0.1.14", features = ["net"] } tokio-util = { version = "0.7.10", features = ["codec", "io-util"] } toml = { version = "0.7.8" } +toml_datetime = { version = "0.6.5", default-features = false, features = ["serde"] } toml_edit-3c51e837cfc5589a = { package = "toml_edit", version = "0.22.6", features = ["serde"] } +toml_edit-cdcf2f9584511fe6 = { package = "toml_edit", version = "0.19.15", features = ["serde"] } tracing = { version = "0.1.40", features = ["log"] } trust-dns-proto = { version = "0.22.0" } unicode-bidi = { version = "0.3.15" } @@ -268,8 +272,6 @@ dof = { version = "0.3.0", default-features = false, features = ["des"] } mio = { version = "0.8.11", features = ["net", "os-ext"] } once_cell = { version = "1.19.0" } rustix = { version = "0.38.31", features = ["fs", "termios"] } -toml_datetime = { version = "0.6.5", default-features = false, features = ["serde"] } -toml_edit-cdcf2f9584511fe6 = { package = "toml_edit", version = "0.19.15", features = ["serde"] } [target.x86_64-unknown-illumos.build-dependencies] bitflags-f595c2ba2a3f28df = { package = "bitflags", version = "2.4.2", default-features = false, features = ["std"] } @@ -277,7 +279,5 @@ dof = { version = "0.3.0", default-features = false, features = ["des"] } mio = { version = "0.8.11", features = ["net", "os-ext"] } once_cell = { version = "1.19.0" } rustix = { version = "0.38.31", features = ["fs", "termios"] } -toml_datetime = { version = "0.6.5", default-features = false, features = ["serde"] } -toml_edit-cdcf2f9584511fe6 = { package = "toml_edit", version = "0.19.15", features = ["serde"] } ### END HAKARI SECTION