From 3f9a77092510eda634eaf3a8cde1ac7d3c087b51 Mon Sep 17 00:00:00 2001 From: "oxide-renovate[bot]" <146848827+oxide-renovate[bot]@users.noreply.github.com> Date: Sun, 21 Jul 2024 22:30:03 -0700 Subject: [PATCH 1/5] Update Rust crate openssl to v0.10.66 (#6139) --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 56bcc9c2cc..7dbbab5b3e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6185,9 +6185,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.65" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2823eb4c6453ed64055057ea8bd416eda38c71018723869dd043a3b1186115e" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ "bitflags 2.5.0", "cfg-if", From 26959bfc1a073c91a920bd521da13a980d137e3f Mon Sep 17 00:00:00 2001 From: "oxide-renovate[bot]" <146848827+oxide-renovate[bot]@users.noreply.github.com> Date: Sun, 21 Jul 2024 22:30:28 -0700 Subject: [PATCH 2/5] Update Rust crate peg to 0.8.4 (#6140) --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7dbbab5b3e..6be52e1c41 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6808,9 +6808,9 @@ dependencies = [ [[package]] name = "peg" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a625d12ad770914cbf7eff6f9314c3ef803bfe364a1b20bc36ddf56673e71e5" +checksum = "295283b02df346d1ef66052a757869b2876ac29a6bb0ac3f5f7cd44aebe40e8f" dependencies = [ "peg-macros", "peg-runtime", @@ -6818,9 +6818,9 @@ dependencies = [ [[package]] name = "peg-macros" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f241d42067ed3ab6a4fece1db720838e1418f36d868585a27931f95d6bc03582" +checksum = "bdad6a1d9cf116a059582ce415d5f5566aabcd4008646779dab7fdc2a9a9d426" dependencies = [ "peg-runtime", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 49225ca63e..1e9cc6ba0e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -422,7 +422,7 @@ partial-io = { version = "0.5.4", features = ["proptest1", "tokio1"] } parse-size = "1.0.0" paste = "1.0.15" percent-encoding = "2.3.1" -peg = "0.8.3" +peg = "0.8.4" pem = "3.0" petgraph = "0.6.5" postgres-protocol = "0.6.6" From 6f25cfe51624403f2c561c38d01c7b9acd1b0e96 Mon Sep 17 00:00:00 2001 From: "oxide-renovate[bot]" <146848827+oxide-renovate[bot]@users.noreply.github.com> Date: Mon, 22 Jul 2024 02:04:39 -0700 Subject: [PATCH 3/5] Update Rust crate syn to v2.0.72 (#6142) --- Cargo.lock | 152 +++++++++++++++++++------------------- workspace-hack/Cargo.toml | 4 +- 2 files changed, 78 insertions(+), 78 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6be52e1c41..c140347448 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -166,7 +166,7 @@ dependencies = [ "omicron-workspace-hack", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -273,7 +273,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -295,7 +295,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -306,7 +306,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -359,7 +359,7 @@ dependencies = [ "quote", "serde", "serde_tokenstream", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -517,7 +517,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.71", + "syn 2.0.72", "which", ] @@ -550,7 +550,7 @@ checksum = "1657dce144574f921af10a92876a96f0ca05dd830900598d21d91c8e4cf78f74" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1064,7 +1064,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1576,7 +1576,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1600,7 +1600,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1611,7 +1611,7 @@ checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" dependencies = [ "darling_core", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1645,7 +1645,7 @@ dependencies = [ "quote", "serde", "serde_tokenstream", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1689,7 +1689,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1722,7 +1722,7 @@ checksum = "5fe87ce4529967e0ba1dcf8450bab64d97dfd5010a6256187ffe2e43e6f0e049" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1743,7 +1743,7 @@ checksum = "62d671cc41a825ebabc75757b62d3d168c577f9149b2d49ece1dad1f72119d25" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1764,7 +1764,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1774,7 +1774,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1787,7 +1787,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1851,7 +1851,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -1860,7 +1860,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -2130,7 +2130,7 @@ dependencies = [ "quote", "serde", "serde_tokenstream", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -2537,7 +2537,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -2649,7 +2649,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -3920,7 +3920,7 @@ version = "0.1.0" source = "git+https://github.com/oxidecomputer/opte?rev=3dc9a3dd8d3c623f0cf2c659c7119ce0c026a96d#3dc9a3dd8d3c623f0cf2c659c7119ce0c026a96d" dependencies = [ "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -4413,7 +4413,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -4790,7 +4790,7 @@ dependencies = [ "omicron-workspace-hack", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -5016,7 +5016,7 @@ version = "0.1.0" dependencies = [ "omicron-workspace-hack", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -5187,7 +5187,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -6060,7 +6060,7 @@ dependencies = [ "string_cache", "subtle", "syn 1.0.109", - "syn 2.0.71", + "syn 2.0.72", "time", "time-macros", "tokio", @@ -6206,7 +6206,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -6357,7 +6357,7 @@ dependencies = [ "oximeter-macro-impl", "oximeter-timeseries-macro", "prettyplease", - "syn 2.0.71", + "syn 2.0.72", "toml 0.8.15", "uuid", ] @@ -6490,7 +6490,7 @@ dependencies = [ "serde_json", "slog-error-chain", "strum", - "syn 2.0.71", + "syn 2.0.72", "thiserror", "toml 0.8.15", "trybuild", @@ -6529,7 +6529,7 @@ dependencies = [ "omicron-workspace-hack", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -6565,7 +6565,7 @@ dependencies = [ "oximeter-impl", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -6721,7 +6721,7 @@ dependencies = [ "regex", "regex-syntax 0.8.3", "structmeta 0.3.0", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -6889,7 +6889,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -6959,7 +6959,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -7223,7 +7223,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -7319,7 +7319,7 @@ dependencies = [ "schemars", "serde", "serde_json", - "syn 2.0.71", + "syn 2.0.72", "thiserror", "typify", "unicode-ident", @@ -7339,7 +7339,7 @@ dependencies = [ "serde_json", "serde_tokenstream", "serde_yaml", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -7830,7 +7830,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -8084,7 +8084,7 @@ dependencies = [ "regex", "relative-path", "rustc_version 0.4.0", - "syn 2.0.71", + "syn 2.0.72", "unicode-ident", ] @@ -8476,7 +8476,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -8502,7 +8502,7 @@ checksum = "7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -8622,7 +8622,7 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -8633,7 +8633,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -8683,7 +8683,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -8704,7 +8704,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -8746,7 +8746,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -9112,7 +9112,7 @@ source = "git+https://github.com/oxidecomputer/slog-error-chain?branch=main#15f6 dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -9239,7 +9239,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -9337,7 +9337,7 @@ checksum = "01b2e185515564f15375f593fb966b5718bc624ba77fe49fa4616ad619690554" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -9347,7 +9347,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ff9eaf853dec4c8802325d8b6d3dffa86cc707fd7a1a4cdbf416e13b061787a" dependencies = [ "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -9433,7 +9433,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive 0.2.0", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -9445,7 +9445,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta-derive 0.3.0", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -9456,7 +9456,7 @@ checksum = "a60bcaff7397072dca0017d1db428e30d5002e00b6847703e2e42005c95fbe00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -9467,7 +9467,7 @@ checksum = "152a0b65a590ff6c3da95cabe2353ee04e6167c896b28e3b14478c2636c922fc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -9502,7 +9502,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -9515,7 +9515,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -9562,9 +9562,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.71" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -9738,7 +9738,7 @@ dependencies = [ "proc-macro2", "quote", "structmeta 0.2.0", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -9769,7 +9769,7 @@ checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -9906,7 +9906,7 @@ checksum = "8d9ef545650e79f30233c0003bcc2504d7efac6dad25fca40744de773fe2049c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -9977,7 +9977,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -10254,7 +10254,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -10531,7 +10531,7 @@ dependencies = [ "semver 1.0.23", "serde", "serde_json", - "syn 2.0.71", + "syn 2.0.72", "thiserror", "unicode-ident", ] @@ -10548,7 +10548,7 @@ dependencies = [ "serde", "serde_json", "serde_tokenstream", - "syn 2.0.71", + "syn 2.0.72", "typify-impl", ] @@ -10765,7 +10765,7 @@ dependencies = [ "proc-macro2", "quote", "serde_tokenstream", - "syn 2.0.71", + "syn 2.0.72", "usdt-impl", ] @@ -10783,7 +10783,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.71", + "syn 2.0.72", "thiserror", "thread-id", "version_check", @@ -10799,7 +10799,7 @@ dependencies = [ "proc-macro2", "quote", "serde_tokenstream", - "syn 2.0.71", + "syn 2.0.72", "usdt-impl", ] @@ -10978,7 +10978,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", "wasm-bindgen-shared", ] @@ -11012,7 +11012,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -11618,7 +11618,7 @@ checksum = "125139de3f6b9d625c39e2efdd73d41bdac468ccd556556440e322be0e1bbd91" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -11629,7 +11629,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] @@ -11649,7 +11649,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.71", + "syn 2.0.72", ] [[package]] diff --git a/workspace-hack/Cargo.toml b/workspace-hack/Cargo.toml index e1f2a986bd..dbb4a51c43 100644 --- a/workspace-hack/Cargo.toml +++ b/workspace-hack/Cargo.toml @@ -102,7 +102,7 @@ smallvec = { version = "1.13.2", default-features = false, features = ["const_ne spin = { version = "0.9.8" } string_cache = { version = "0.8.7" } subtle = { version = "2.5.0" } -syn-f595c2ba2a3f28df = { package = "syn", version = "2.0.71", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] } +syn-f595c2ba2a3f28df = { package = "syn", version = "2.0.72", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] } time = { version = "0.3.36", features = ["formatting", "local-offset", "macros", "parsing"] } tokio = { version = "1.38.1", features = ["full", "test-util"] } tokio-postgres = { version = "0.7.10", features = ["with-chrono-0_4", "with-serde_json-1", "with-uuid-1"] } @@ -208,7 +208,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.71", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] } +syn-f595c2ba2a3f28df = { package = "syn", version = "2.0.72", features = ["extra-traits", "fold", "full", "visit", "visit-mut"] } time = { version = "0.3.36", features = ["formatting", "local-offset", "macros", "parsing"] } time-macros = { version = "0.2.18", default-features = false, features = ["formatting", "parsing"] } tokio = { version = "1.38.1", features = ["full", "test-util"] } From 28c9a8b5e836950d0611f7a4e7318232c09223bd Mon Sep 17 00:00:00 2001 From: Ryan Goodfellow Date: Mon, 22 Jul 2024 07:02:18 -0700 Subject: [PATCH 4/5] tweak NTP parameters (#6017) --- zone-setup/src/bin/zone-setup.rs | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/zone-setup/src/bin/zone-setup.rs b/zone-setup/src/bin/zone-setup.rs index 3239129d3c..75864ec0ea 100644 --- a/zone-setup/src/bin/zone-setup.rs +++ b/zone-setup/src/bin/zone-setup.rs @@ -515,16 +515,13 @@ logdir /var/log/chrony log measurements statistics tracking # makestep -# We allow chrony to step the system clock if we are more than a day out, -# regardless of how many clock updates have occurred since boot. -# The boundary NTP servers are configured with local reference mode, which -# means that if they start up without external connectivity, they will appear -# as authoritative servers even if they are advertising January 1987 -# (which is the default system clock on a gimlet after boot). -# This configuration allows a one-off adjustment once RSS begins and the -# boundary servers are synchronised, after which the clock will advance -# monotonically forwards. -makestep 86400 -1 +# We allow chrony to step the system clock up to three times on startup if we +# are more than a second out. Even though boundary NTP servers are configured +# with local reference mode, they will not appear as authoritative servers +# until they synchronize upstream. This configuration allows us to converge +# quickly once the boundary servers converge. After this the clock will advance +# monotonically forward. +makestep 1.0 3 # When a leap second occurs we slew the clock over approximately 37 seconds. leapsecmode slew @@ -588,8 +585,10 @@ maxslewrate 2708.333 let new_config = if *is_boundary { for s in servers { - let str_line = - format!("pool {} iburst maxdelay 0.1 maxsources 16\n", s); + let str_line = format!( + "pool {} iburst maxdelay 0.1 minpoll 0 maxpoll 3 maxsources 16\n", + s + ); contents.push_str(&str_line) } contents From e346fd10066c076eb75f5e11818dcb3e73fe1208 Mon Sep 17 00:00:00 2001 From: Rain Date: Mon, 22 Jul 2024 12:07:44 -0700 Subject: [PATCH 5/5] [oximeter] turn API into a trait (#6130) Use the OpenAPI manager to manage this trait as well. An interesting question is the standalone Nexus impl also defined by Oximeter -- should that switch to using the internal API crate? As things stand we'd have to write tons of methods that just error out, but I have some thoughts on how to make that easier on the Dropshot side. For now we've decided to leave it as-is, but it's a good data point to consider for future Dropshot improvements. --- Cargo.lock | 15 ++ Cargo.toml | 3 + dev-tools/openapi-manager/Cargo.toml | 1 + dev-tools/openapi-manager/src/spec.rs | 10 ++ openapi/oximeter.json | 4 + oximeter/api/Cargo.toml | 16 ++ oximeter/api/src/lib.rs | 79 +++++++++ oximeter/collector/Cargo.toml | 1 + oximeter/collector/src/bin/oximeter.rs | 17 -- oximeter/collector/src/http_entrypoints.rs | 163 +++++++----------- .../tests/output/cmd-oximeter-noargs-stderr | 1 - .../tests/output/cmd-oximeter-openapi-stderr | 0 oximeter/collector/tests/test_commands.rs | 45 +---- 13 files changed, 189 insertions(+), 166 deletions(-) create mode 100644 oximeter/api/Cargo.toml create mode 100644 oximeter/api/src/lib.rs delete mode 100644 oximeter/collector/tests/output/cmd-oximeter-openapi-stderr diff --git a/Cargo.lock b/Cargo.lock index c140347448..7831b5701c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6166,6 +6166,7 @@ dependencies = [ "openapi-lint", "openapiv3", "owo-colors", + "oximeter-api", "serde_json", "similar", "supports-color", @@ -6362,6 +6363,19 @@ dependencies = [ "uuid", ] +[[package]] +name = "oximeter-api" +version = "0.1.0" +dependencies = [ + "chrono", + "dropshot", + "omicron-common", + "omicron-workspace-hack", + "schemars", + "serde", + "uuid", +] + [[package]] name = "oximeter-client" version = "0.1.0" @@ -6398,6 +6412,7 @@ dependencies = [ "openapi-lint", "openapiv3", "oximeter", + "oximeter-api", "oximeter-client", "oximeter-db", "rand 0.8.5", diff --git a/Cargo.toml b/Cargo.toml index 1e9cc6ba0e..8cc8260f66 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,6 +63,7 @@ members = [ "nexus/test-utils-macros", "nexus/test-utils", "nexus/types", + "oximeter/api", "oximeter/collector", "oximeter/db", "oximeter/impl", @@ -164,6 +165,7 @@ default-members = [ "nexus/test-utils-macros", "nexus/test-utils", "nexus/types", + "oximeter/api", "oximeter/collector", "oximeter/db", "oximeter/impl", @@ -408,6 +410,7 @@ opte-ioctl = { git = "https://github.com/oxidecomputer/opte", rev = "3dc9a3dd8d3 oso = "0.27" owo-colors = "4.0.0" oximeter = { path = "oximeter/oximeter" } +oximeter-api = { path = "oximeter/api" } oximeter-client = { path = "clients/oximeter-client" } oximeter-db = { path = "oximeter/db/", default-features = false } oximeter-collector = { path = "oximeter/collector" } diff --git a/dev-tools/openapi-manager/Cargo.toml b/dev-tools/openapi-manager/Cargo.toml index dc07dae0e2..94be112895 100644 --- a/dev-tools/openapi-manager/Cargo.toml +++ b/dev-tools/openapi-manager/Cargo.toml @@ -24,6 +24,7 @@ omicron-workspace-hack.workspace = true openapiv3.workspace = true openapi-lint.workspace = true owo-colors.workspace = true +oximeter-api.workspace = true serde_json.workspace = true similar.workspace = true supports-color.workspace = true diff --git a/dev-tools/openapi-manager/src/spec.rs b/dev-tools/openapi-manager/src/spec.rs index e8ebc23550..cb3b0e3e5c 100644 --- a/dev-tools/openapi-manager/src/spec.rs +++ b/dev-tools/openapi-manager/src/spec.rs @@ -66,6 +66,16 @@ pub fn all_apis() -> Vec { filename: "nexus-internal.json", extra_validation: None, }, + ApiSpec { + title: "Oxide Oximeter API", + version: "0.0.1", + description: "API for interacting with oximeter", + boundary: ApiBoundary::Internal, + api_description: + oximeter_api::oximeter_api_mod::stub_api_description, + filename: "oximeter.json", + extra_validation: None, + }, ApiSpec { title: "Oxide Technician Port Control Service", version: "0.0.1", diff --git a/openapi/oximeter.json b/openapi/oximeter.json index d4a37957ab..f596ac6ee6 100644 --- a/openapi/oximeter.json +++ b/openapi/oximeter.json @@ -12,6 +12,7 @@ "paths": { "/info": { "get": { + "summary": "Return identifying information about this collector.", "operationId": "collector_info", "responses": { "200": { @@ -35,6 +36,7 @@ }, "/producers": { "get": { + "summary": "List all producers.", "operationId": "producers_list", "parameters": [ { @@ -81,6 +83,7 @@ } }, "post": { + "summary": "Handle a request from Nexus to register a new producer with this collector.", "operationId": "producers_post", "requestBody": { "content": { @@ -107,6 +110,7 @@ }, "/producers/{producer_id}": { "delete": { + "summary": "Delete a producer by ID.", "operationId": "producer_delete", "parameters": [ { diff --git a/oximeter/api/Cargo.toml b/oximeter/api/Cargo.toml new file mode 100644 index 0000000000..72189aa645 --- /dev/null +++ b/oximeter/api/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "oximeter-api" +version = "0.1.0" +edition = "2021" + +[lints] +workspace = true + +[dependencies] +chrono.workspace = true +dropshot.workspace = true +omicron-common.workspace = true +omicron-workspace-hack.workspace = true +schemars.workspace = true +serde.workspace = true +uuid.workspace = true diff --git a/oximeter/api/src/lib.rs b/oximeter/api/src/lib.rs new file mode 100644 index 0000000000..3cda501fa7 --- /dev/null +++ b/oximeter/api/src/lib.rs @@ -0,0 +1,79 @@ +// 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/. + +use chrono::{DateTime, Utc}; +use dropshot::{ + EmptyScanParams, HttpError, HttpResponseDeleted, HttpResponseOk, + HttpResponseUpdatedNoContent, PaginationParams, Query, RequestContext, + ResultsPage, TypedBody, +}; +use omicron_common::api::internal::nexus::ProducerEndpoint; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; +use uuid::Uuid; + +#[dropshot::api_description { + module = "oximeter_api_mod", +}] +pub trait OximeterApi { + type Context; + + /// Handle a request from Nexus to register a new producer with this collector. + #[endpoint { + method = POST, + path = "/producers", + }] + async fn producers_post( + request_context: RequestContext, + body: TypedBody, + ) -> Result; + + /// List all producers. + #[endpoint { + method = GET, + path = "/producers", + }] + async fn producers_list( + request_context: RequestContext, + query: Query>, + ) -> Result>, HttpError>; + + /// Delete a producer by ID. + #[endpoint { + method = DELETE, + path = "/producers/{producer_id}", + }] + async fn producer_delete( + request_context: RequestContext, + path: dropshot::Path, + ) -> Result; + + /// Return identifying information about this collector. + #[endpoint { + method = GET, + path = "/info", + }] + async fn collector_info( + request_context: RequestContext, + ) -> Result, HttpError>; +} + +/// Parameters for paginating the list of producers. +#[derive(Clone, Copy, Debug, Deserialize, JsonSchema, Serialize)] +pub struct ProducerPage { + pub id: Uuid, +} + +#[derive(Clone, Copy, Debug, Deserialize, JsonSchema, Serialize)] +pub struct ProducerIdPathParams { + pub producer_id: Uuid, +} + +#[derive(Clone, Copy, Debug, Deserialize, JsonSchema, Serialize)] +pub struct CollectorInfo { + /// The collector's UUID. + pub id: Uuid, + /// Last time we refreshed our producer list with Nexus. + pub last_refresh: Option>, +} diff --git a/oximeter/collector/Cargo.toml b/oximeter/collector/Cargo.toml index 01f484f5f4..cd1e012e5c 100644 --- a/oximeter/collector/Cargo.toml +++ b/oximeter/collector/Cargo.toml @@ -19,6 +19,7 @@ internal-dns.workspace = true nexus-types.workspace = true omicron-common.workspace = true oximeter.workspace = true +oximeter-api.workspace = true oximeter-client.workspace = true oximeter-db.workspace = true rand.workspace = true diff --git a/oximeter/collector/src/bin/oximeter.rs b/oximeter/collector/src/bin/oximeter.rs index d97ae5e72e..efbc53cace 100644 --- a/oximeter/collector/src/bin/oximeter.rs +++ b/oximeter/collector/src/bin/oximeter.rs @@ -10,7 +10,6 @@ use anyhow::{anyhow, Context}; use clap::Parser; use omicron_common::cmd::fatal; use omicron_common::cmd::CmdError; -use oximeter_collector::oximeter_api; use oximeter_collector::standalone_nexus_api; use oximeter_collector::Config; use oximeter_collector::Oximeter; @@ -23,16 +22,6 @@ use std::net::SocketAddrV6; use std::path::PathBuf; use uuid::Uuid; -pub fn run_openapi() -> Result<(), String> { - oximeter_api() - .openapi("Oxide Oximeter API", "0.0.1") - .description("API for interacting with oximeter") - .contact_url("https://oxide.computer") - .contact_email("api@oxide.computer") - .write(&mut std::io::stdout()) - .map_err(|e| e.to_string()) -} - pub fn run_standalone_openapi() -> Result<(), String> { standalone_nexus_api() .openapi("Oxide Nexus API", "0.0.1") @@ -47,9 +36,6 @@ pub fn run_standalone_openapi() -> Result<(), String> { #[derive(Parser)] #[clap(name = "oximeter", about = "See README.adoc for more information")] enum Args { - /// Print the external OpenAPI Spec document and exit - Openapi, - /// Start an Oximeter server Run { /// Path to TOML file with configuration for the server @@ -133,9 +119,6 @@ async fn main() { async fn do_run() -> Result<(), CmdError> { let args = Args::parse(); match args { - Args::Openapi => { - run_openapi().map_err(|err| CmdError::Failure(anyhow!(err))) - } Args::Run { config_file, id, address } => { let config = Config::from_file(config_file).unwrap(); let args = OximeterArguments { id, address }; diff --git a/oximeter/collector/src/http_entrypoints.rs b/oximeter/collector/src/http_entrypoints.rs index e876ed047d..daf75bbbd1 100644 --- a/oximeter/collector/src/http_entrypoints.rs +++ b/oximeter/collector/src/http_entrypoints.rs @@ -7,9 +7,6 @@ // Copyright 2023 Oxide Computer Company use crate::OximeterAgent; -use chrono::DateTime; -use chrono::Utc; -use dropshot::endpoint; use dropshot::ApiDescription; use dropshot::EmptyScanParams; use dropshot::HttpError; @@ -23,117 +20,73 @@ use dropshot::ResultsPage; use dropshot::TypedBody; use dropshot::WhichPage; use omicron_common::api::internal::nexus::ProducerEndpoint; -use schemars::JsonSchema; -use serde::Deserialize; -use serde::Serialize; +use oximeter_api::*; use std::sync::Arc; -use uuid::Uuid; // Build the HTTP API internal to the control plane pub fn oximeter_api() -> ApiDescription> { - let mut api = ApiDescription::new(); - api.register(producers_post) - .expect("Could not register producers_post API handler"); - api.register(producers_list) - .expect("Could not register producers_list API handler"); - api.register(producer_delete) - .expect("Could not register producers_delete API handler"); - api.register(collector_info) - .expect("Could not register collector_info API handler"); - api + oximeter_api_mod::api_description::() + .expect("registered entrypoints") } -// Handle a request from Nexus to register a new producer with this collector. -#[endpoint { - method = POST, - path = "/producers", -}] -async fn producers_post( - request_context: RequestContext>, - body: TypedBody, -) -> Result { - let agent = request_context.context(); - let producer_info = body.into_inner(); - agent - .register_producer(producer_info) - .await - .map_err(HttpError::from) - .map(|_| HttpResponseUpdatedNoContent()) -} +enum OximeterApiImpl {} -// Parameters for paginating the list of producers. -#[derive(Clone, Copy, Debug, Deserialize, JsonSchema, Serialize)] -struct ProducerPage { - id: Uuid, -} +impl OximeterApi for OximeterApiImpl { + type Context = Arc; -// List all producers -#[endpoint { - method = GET, - path = "/producers", -}] -async fn producers_list( - request_context: RequestContext>, - query: Query>, -) -> Result>, HttpError> { - let agent = request_context.context(); - let pagination = query.into_inner(); - let limit = request_context.page_limit(&pagination)?.get() as usize; - let start = match &pagination.page { - WhichPage::First(..) => None, - WhichPage::Next(ProducerPage { id }) => Some(*id), - }; - let producers = agent.list_producers(start, limit).await; - ResultsPage::new( - producers, - &EmptyScanParams {}, - |info: &ProducerEndpoint, _| ProducerPage { id: info.id }, - ) - .map(HttpResponseOk) -} + async fn producers_post( + request_context: RequestContext, + body: TypedBody, + ) -> Result { + let agent = request_context.context(); + let producer_info = body.into_inner(); + agent + .register_producer(producer_info) + .await + .map_err(HttpError::from) + .map(|_| HttpResponseUpdatedNoContent()) + } -#[derive(Clone, Copy, Debug, Deserialize, JsonSchema, Serialize)] -struct ProducerIdPathParams { - producer_id: Uuid, -} + async fn producers_list( + request_context: RequestContext>, + query: Query>, + ) -> Result>, HttpError> { + let agent = request_context.context(); + let pagination = query.into_inner(); + let limit = request_context.page_limit(&pagination)?.get() as usize; + let start = match &pagination.page { + WhichPage::First(..) => None, + WhichPage::Next(ProducerPage { id }) => Some(*id), + }; + let producers = agent.list_producers(start, limit).await; + ResultsPage::new( + producers, + &EmptyScanParams {}, + |info: &ProducerEndpoint, _| ProducerPage { id: info.id }, + ) + .map(HttpResponseOk) + } -// Delete a producer by ID. -#[endpoint { - method = DELETE, - path = "/producers/{producer_id}", -}] -async fn producer_delete( - request_context: RequestContext>, - path: dropshot::Path, -) -> Result { - let agent = request_context.context(); - let producer_id = path.into_inner().producer_id; - agent - .delete_producer(producer_id) - .await - .map_err(HttpError::from) - .map(|_| HttpResponseDeleted()) -} - -#[derive(Clone, Copy, Debug, Deserialize, JsonSchema, Serialize)] -pub struct CollectorInfo { - /// The collector's UUID. - pub id: Uuid, - /// Last time we refreshed our producer list with Nexus. - pub last_refresh: Option>, -} + async fn producer_delete( + request_context: RequestContext, + path: dropshot::Path, + ) -> Result { + let agent = request_context.context(); + let producer_id = path.into_inner().producer_id; + agent + .delete_producer(producer_id) + .await + .map_err(HttpError::from) + .map(|_| HttpResponseDeleted()) + } -// Return identifying information about this collector -#[endpoint { - method = GET, - path = "/info", -}] -async fn collector_info( - request_context: RequestContext>, -) -> Result, HttpError> { - let agent = request_context.context(); - let id = agent.id; - let last_refresh = *agent.last_refresh_time.lock().unwrap(); - let info = CollectorInfo { id, last_refresh }; - Ok(HttpResponseOk(info)) + async fn collector_info( + request_context: RequestContext, + ) -> Result, HttpError> { + let agent = request_context.context(); + let id = agent.id; + let last_refresh = *agent.last_refresh_time.lock().unwrap(); + let info = CollectorInfo { id, last_refresh }; + Ok(HttpResponseOk(info)) + } } diff --git a/oximeter/collector/tests/output/cmd-oximeter-noargs-stderr b/oximeter/collector/tests/output/cmd-oximeter-noargs-stderr index 3f0fd4726d..e1330452b2 100644 --- a/oximeter/collector/tests/output/cmd-oximeter-noargs-stderr +++ b/oximeter/collector/tests/output/cmd-oximeter-noargs-stderr @@ -3,7 +3,6 @@ See README.adoc for more information Usage: oximeter Commands: - openapi Print the external OpenAPI Spec document and exit run Start an Oximeter server standalone Run `oximeter` in standalone mode for development standalone-openapi Print the fake Nexus's standalone API diff --git a/oximeter/collector/tests/output/cmd-oximeter-openapi-stderr b/oximeter/collector/tests/output/cmd-oximeter-openapi-stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/oximeter/collector/tests/test_commands.rs b/oximeter/collector/tests/test_commands.rs index d3d66be058..3a772d736c 100644 --- a/oximeter/collector/tests/test_commands.rs +++ b/oximeter/collector/tests/test_commands.rs @@ -4,14 +4,12 @@ // Copyright 2021 Oxide Computer Company -use std::{fs, path::PathBuf}; +use std::path::PathBuf; use expectorate::assert_contents; use omicron_test_utils::dev::test_cmds::{ - assert_exit_code, path_to_executable, run_command, temp_file_path, - EXIT_SUCCESS, EXIT_USAGE, + assert_exit_code, path_to_executable, run_command, EXIT_USAGE, }; -use openapiv3::OpenAPI; use subprocess::Exec; /// name of the "oximeter" executable @@ -21,15 +19,6 @@ fn path_to_oximeter() -> PathBuf { path_to_executable(CMD_OXIMETER) } -/// Write the requested string to a temporary file and return the path to that -/// file. -fn write_config(config: &str) -> PathBuf { - let file_path = temp_file_path("test_commands_config"); - eprintln!("writing temp config: {}", file_path.display()); - fs::write(&file_path, config).expect("failed to write config file"); - file_path -} - #[test] fn test_oximeter_no_args() { let exec = Exec::cmd(path_to_oximeter()); @@ -38,33 +27,3 @@ fn test_oximeter_no_args() { assert_contents("tests/output/cmd-oximeter-noargs-stdout", &stdout_text); assert_contents("tests/output/cmd-oximeter-noargs-stderr", &stderr_text); } - -#[test] -fn test_oximeter_openapi() { - // This is a little goofy: we need a config file for the program. - // (Arguably, --openapi shouldn't require a config file, but it's - // conceivable that the API metadata or the exposed endpoints would depend - // on the configuration.) We ship a config file in "examples", and we may - // as well use it here -- it would be a bug if that one didn't work for this - // purpose. However, it's not clear how to reliably locate it at runtime. - // But we do know where it is at compile time, so we load it then. - let config = include_str!("../../collector/config.toml"); - let config_path = write_config(config); - let exec = Exec::cmd(path_to_oximeter()).arg("openapi"); - let (exit_status, stdout_text, stderr_text) = run_command(exec); - fs::remove_file(&config_path).expect("failed to remove temporary file"); - assert_exit_code(exit_status, EXIT_SUCCESS, &stderr_text); - assert_contents("tests/output/cmd-oximeter-openapi-stderr", &stderr_text); - - let spec: OpenAPI = serde_json::from_str(&stdout_text) - .expect("stdout was not valid OpenAPI"); - - // Check for lint errors. - let errors = openapi_lint::validate(&spec); - assert!(errors.is_empty(), "{}", errors.join("\n\n")); - - // Confirm that the output hasn't changed. It's expected that we'll change - // this file as the API evolves, but pay attention to the diffs to ensure - // that the changes match your expectations. - assert_contents("../../openapi/oximeter.json", &stdout_text); -}