From 8efa3c6ac6615ff029f13dc84d554c63bda0302d Mon Sep 17 00:00:00 2001 From: Patrick Mooney Date: Tue, 15 Apr 2025 22:01:25 -0500 Subject: [PATCH] Use latest Omicron zone packaging --- Cargo.lock | 401 ++++++++----------------- Cargo.toml | 3 +- packaging/propolis-package/Cargo.toml | 4 +- packaging/propolis-package/src/main.rs | 139 ++------- 4 files changed, 156 insertions(+), 391 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5547a81de..b6a511bc1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -183,6 +183,18 @@ dependencies = [ "password-hash", ] +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + [[package]] name = "ascii" version = "1.1.0" @@ -436,6 +448,21 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "blake3" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389a099b34312839e16420d499a9cad9650541715937ffbdd40d36f49e77eeb3" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "memmap2", + "rayon-core", +] + [[package]] name = "block-buffer" version = "0.9.0" @@ -717,6 +744,12 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "constant_time_eq" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" + [[package]] name = "convert_case" version = "0.4.0" @@ -856,7 +889,7 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "rayon", - "reqwest 0.12.7", + "reqwest", "ringbuffer", "schemars", "semver 1.0.26", @@ -1302,9 +1335,9 @@ dependencies = [ "form_urlencoded", "futures", "hostname 0.4.0", - "http 1.2.0", + "http", "http-body-util", - "hyper 1.6.0", + "hyper", "hyper-util", "indexmap 2.8.0", "multer", @@ -1753,7 +1786,7 @@ dependencies = [ "omicron-workspace-hack", "progenitor 0.9.1", "rand 0.8.5", - "reqwest 0.12.7", + "reqwest", "schemars", "serde", "serde_json", @@ -1869,25 +1902,6 @@ dependencies = [ "scroll", ] -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap 2.8.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "h2" version = "0.4.6" @@ -1899,7 +1913,7 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.2.0", + "http", "indexmap 2.8.0", "slab", "tokio", @@ -2052,17 +2066,6 @@ dependencies = [ "windows", ] -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - [[package]] name = "http" version = "1.2.0" @@ -2074,17 +2077,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - [[package]] name = "http-body" version = "1.0.1" @@ -2092,7 +2084,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.2.0", + "http", ] [[package]] @@ -2103,8 +2095,8 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http 1.2.0", - "http-body 1.0.1", + "http", + "http-body", "pin-project-lite", ] @@ -2147,30 +2139,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" -[[package]] -name = "hyper" -version = "0.14.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - [[package]] name = "hyper" version = "1.6.0" @@ -2180,9 +2148,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.6", - "http 1.2.0", - "http-body 1.0.1", + "h2", + "http", + "http-body", "httparse", "httpdate", "itoa", @@ -2192,20 +2160,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http 0.2.12", - "hyper 0.14.28", - "rustls 0.21.12", - "tokio", - "tokio-rustls 0.24.1", -] - [[package]] name = "hyper-rustls" version = "0.27.3" @@ -2213,15 +2167,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", - "http 1.2.0", - "hyper 1.6.0", + "http", + "hyper", "hyper-util", "rustls 0.23.10", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", "tower-service", - "webpki-roots 0.26.3", + "webpki-roots", ] [[package]] @@ -2232,7 +2186,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.6.0", + "hyper", "hyper-util", "native-tls", "tokio", @@ -2249,9 +2203,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.2.0", - "http-body 1.0.1", - "hyper 1.6.0", + "http", + "http-body", + "hyper", "pin-project-lite", "socket2", "tokio", @@ -2459,7 +2413,7 @@ dependencies = [ "crucible-smf", "dropshot", "futures", - "http 1.2.0", + "http", "ipnetwork", "itertools 0.14.0", "libc", @@ -2523,19 +2477,6 @@ dependencies = [ "serde", ] -[[package]] -name = "indicatif" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" -dependencies = [ - "console", - "instant", - "number_prefix", - "portable-atomic", - "unicode-width", -] - [[package]] name = "ingot" version = "0.1.0" @@ -2601,7 +2542,7 @@ dependencies = [ "omicron-common", "omicron-workspace-hack", "qorb", - "reqwest 0.12.7", + "reqwest", "slog", "thiserror 1.0.64", ] @@ -2969,6 +2910,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "memmap2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +dependencies = [ + "libc", +] + [[package]] name = "memmem" version = "0.1.1" @@ -2993,7 +2943,7 @@ dependencies = [ "chrono", "percent-encoding", "progenitor 0.8.0", - "reqwest 0.12.7", + "reqwest", "schemars", "serde", "serde_json", @@ -3064,11 +3014,11 @@ dependencies = [ "bytes", "encoding_rs", "futures-util", - "http 1.2.0", + "http", "httparse", "memchr", "mime", - "spin 0.9.8", + "spin", "version_check", ] @@ -3135,7 +3085,7 @@ dependencies = [ "oxnet", "progenitor 0.9.1", "regress", - "reqwest 0.12.7", + "reqwest", "schemars", "serde", "serde_json", @@ -3182,7 +3132,7 @@ dependencies = [ "dropshot", "futures", "gateway-client", - "http 1.2.0", + "http", "humantime", "id-map", "illumos-utils", @@ -3426,12 +3376,6 @@ dependencies = [ "libc", ] -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - [[package]] name = "nvpair" version = "0.0.0" @@ -3486,7 +3430,7 @@ dependencies = [ "dropshot", "futures", "hex", - "http 1.2.0", + "http", "ipnetwork", "macaddr", "mg-admin-client", @@ -3497,7 +3441,7 @@ dependencies = [ "progenitor-client 0.9.1", "rand 0.8.5", "regress", - "reqwest 0.12.7", + "reqwest", "schemars", "semver 1.0.26", "serde", @@ -3546,27 +3490,33 @@ checksum = "e22821954cca73148cdd1547a540ac79a3f27b6d55b518490437bb9867212828" [[package]] name = "omicron-zone-package" -version = "0.9.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "620c53207d39a385f298444337d575690e0d9e793561d471ba7a614dc213e372" +checksum = "254a0dd69a6af676e4727a56e692a1bfcb6a0991a42f8840da4ef6ecf826faac" dependencies = [ "anyhow", "async-trait", + "blake3", + "camino", + "camino-tempfile", "chrono", "filetime", "flate2", + "futures", "futures-util", "hex", - "reqwest 0.11.27", - "ring 0.16.20", + "reqwest", "semver 1.0.26", "serde", "serde_derive", + "serde_json", + "sha2 0.10.8", + "slog", "tar", - "tempfile", "thiserror 1.0.64", "tokio", "toml 0.7.8", + "topological-sort", "walkdir", ] @@ -4083,8 +4033,8 @@ dependencies = [ "oximeter", "propolis-client", "rand 0.8.5", - "reqwest 0.12.7", - "ring 0.17.14", + "reqwest", + "ring", "serde", "serde_derive", "serde_json", @@ -4154,14 +4104,14 @@ dependencies = [ "cpuid_utils", "dropshot", "futures", - "http 1.2.0", + "http", "itertools 0.13.0", "omicron-common", "oximeter", "oximeter-producer", "phd-testcase", "propolis-client", - "reqwest 0.12.7", + "reqwest", "slog", "slog-term", "strum 0.26.3", @@ -4294,12 +4244,6 @@ name = "poptrie" version = "0.1.0" source = "git+https://github.com/oxidecomputer/poptrie?branch=multipath#ca52bef3f87ff1a67d81b3c6e601dcb5fdbcc165" -[[package]] -name = "portable-atomic" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" - [[package]] name = "postcard" version = "1.0.9" @@ -4446,7 +4390,7 @@ dependencies = [ "bytes", "futures-core", "percent-encoding", - "reqwest 0.12.7", + "reqwest", "serde", "serde_json", "serde_urlencoded", @@ -4461,7 +4405,7 @@ dependencies = [ "bytes", "futures-core", "percent-encoding", - "reqwest 0.12.7", + "reqwest", "serde", "serde_json", "serde_urlencoded", @@ -4474,7 +4418,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d85934a440963a69f9f04f48507ff6e7aa2952a5b2d8f96cc37fa3dd5c270f66" dependencies = [ "heck 0.5.0", - "http 1.2.0", + "http", "indexmap 2.8.0", "openapiv3", "proc-macro2", @@ -4496,7 +4440,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37adc80a94c9cae890e82deeeecc9d8f2a5cb153256caaf1bf0f03611e537214" dependencies = [ "heck 0.5.0", - "http 1.2.0", + "http", "indexmap 2.8.0", "openapiv3", "proc-macro2", @@ -4607,7 +4551,7 @@ dependencies = [ "newtype-uuid", "propolis-client", "propolis-config-toml", - "reqwest 0.12.7", + "reqwest", "serde", "serde_json", "slog", @@ -4630,7 +4574,7 @@ dependencies = [ "progenitor-client 0.9.1", "propolis_api_types", "rand 0.8.5", - "reqwest 0.12.7", + "reqwest", "schemars", "serde", "serde_json", @@ -4664,12 +4608,12 @@ dependencies = [ "clap", "dropshot", "futures", - "hyper 1.6.0", + "hyper", "progenitor 0.9.1", "propolis_api_types", "propolis_types", "rand 0.8.5", - "reqwest 0.12.7", + "reqwest", "schemars", "semver 1.0.26", "serde", @@ -4690,8 +4634,10 @@ name = "propolis-package" version = "0.1.0" dependencies = [ "anyhow", - "indicatif", + "camino", "omicron-zone-package", + "slog", + "slog-term", "tokio", ] @@ -4716,7 +4662,7 @@ dependencies = [ "expectorate", "futures", "hex", - "hyper 1.6.0", + "hyper", "internal-dns-resolver", "internal-dns-types", "itertools 0.13.0", @@ -4732,10 +4678,10 @@ dependencies = [ "propolis_api_types", "propolis_types", "proptest", - "reqwest 0.12.7", + "reqwest", "rfb", "rgb_frame", - "ring 0.17.14", + "ring", "ron", "schemars", "semver 1.0.26", @@ -4900,7 +4846,7 @@ checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ "bytes", "rand 0.8.5", - "ring 0.17.14", + "ring", "rustc-hash", "rustls 0.23.10", "slab", @@ -5115,49 +5061,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "reqwest" -version = "0.11.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" -dependencies = [ - "base64 0.21.7", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.28", - "hyper-rustls 0.24.2", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls 0.21.12", - "rustls-pemfile 1.0.4", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 0.1.2", - "system-configuration 0.5.1", - "tokio", - "tokio-rustls 0.24.1", - "tokio-util", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams", - "web-sys", - "webpki-roots 0.25.4", - "winreg", -] - [[package]] name = "reqwest" version = "0.12.7" @@ -5170,12 +5073,12 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.4.6", - "http 1.2.0", - "http-body 1.0.1", + "h2", + "http", + "http-body", "http-body-util", - "hyper 1.6.0", - "hyper-rustls 0.27.3", + "hyper", + "hyper-rustls", "hyper-tls", "hyper-util", "ipnet", @@ -5193,8 +5096,8 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.1", - "system-configuration 0.6.1", + "sync_wrapper", + "system-configuration", "tokio", "tokio-native-tls", "tokio-rustls 0.26.0", @@ -5205,7 +5108,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.26.3", + "webpki-roots", "windows-registry", ] @@ -5249,21 +5152,6 @@ dependencies = [ "strum 0.26.3", ] -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - [[package]] name = "ring" version = "0.17.14" @@ -5274,7 +5162,7 @@ dependencies = [ "cfg-if", "getrandom 0.2.14", "libc", - "untrusted 0.9.0", + "untrusted", "windows-sys 0.52.0", ] @@ -5346,7 +5234,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.17.14", + "ring", "rustls-webpki 0.101.7", "sct", ] @@ -5358,7 +5246,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", - "ring 0.17.14", + "ring", "rustls-pki-types", "rustls-webpki 0.102.4", "subtle", @@ -5372,7 +5260,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ "once_cell", - "ring 0.17.14", + "ring", "rustls-pki-types", "rustls-webpki 0.102.4", "subtle", @@ -5410,8 +5298,8 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.14", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -5420,9 +5308,9 @@ version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ - "ring 0.17.14", + "ring", "rustls-pki-types", - "untrusted 0.9.0", + "untrusted", ] [[package]] @@ -5545,8 +5433,8 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.14", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -6084,12 +5972,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -6272,12 +6154,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - [[package]] name = "sync_wrapper" version = "1.0.1" @@ -6310,17 +6186,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys 0.5.0", -] - [[package]] name = "system-configuration" version = "0.6.1" @@ -6329,17 +6194,7 @@ checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags 2.6.0", "core-foundation", - "system-configuration-sys 0.6.0", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", + "system-configuration-sys", ] [[package]] @@ -6783,6 +6638,12 @@ dependencies = [ "winnow 0.7.4", ] +[[package]] +name = "topological-sort" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" + [[package]] name = "tower-service" version = "0.3.2" @@ -6924,7 +6785,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.2.0", + "http", "httparse", "log", "rand 0.8.5", @@ -7101,12 +6962,6 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" @@ -7519,12 +7374,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - [[package]] name = "webpki-roots" version = "0.26.3" diff --git a/Cargo.toml b/Cargo.toml index df7cccd2a..f0677b4a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -79,7 +79,7 @@ internal-dns-resolver = { git = "https://github.com/oxidecomputer/omicron", bran internal-dns-types = { git = "https://github.com/oxidecomputer/omicron", branch = "main" } nexus-client = { git = "https://github.com/oxidecomputer/omicron", branch = "main" } omicron-common = { git = "https://github.com/oxidecomputer/omicron", branch = "main" } -omicron-zone-package = "0.9.0" +omicron-zone-package = "0.12.1" oximeter-instruments = { git = "https://github.com/oxidecomputer/omicron", branch = "main", default-features = false, features = ["kstat"] } oximeter-producer = { git = "https://github.com/oxidecomputer/omicron", branch = "main" } oximeter = { git = "https://github.com/oxidecomputer/omicron", branch = "main" } @@ -123,7 +123,6 @@ flate2 = "1.0.28" hex = "0.4.3" http = "1.1.0" hyper = "1.0" -indicatif = "0.17.3" inventory = "0.3.0" itertools = "0.13.0" kstat-rs = "0.2.4" diff --git a/packaging/propolis-package/Cargo.toml b/packaging/propolis-package/Cargo.toml index 3fbd4c6c2..52b16abae 100644 --- a/packaging/propolis-package/Cargo.toml +++ b/packaging/propolis-package/Cargo.toml @@ -10,6 +10,8 @@ doctest = false [dependencies] anyhow.workspace = true -indicatif.workspace = true +camino.workspace = true omicron-zone-package.workspace = true +slog.workspace = true +slog-term.workspace = true tokio.workspace = true diff --git a/packaging/propolis-package/src/main.rs b/packaging/propolis-package/src/main.rs index 428cbea1b..68adc2da6 100644 --- a/packaging/propolis-package/src/main.rs +++ b/packaging/propolis-package/src/main.rs @@ -2,141 +2,56 @@ // 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 anyhow::anyhow; -use anyhow::Context; -use anyhow::Result; -use indicatif::MultiProgress; -use indicatif::ProgressBar; -use indicatif::ProgressStyle; -use omicron_zone_package::progress::Progress; -use omicron_zone_package::target::Target; -use std::collections::BTreeMap; +use anyhow::{anyhow, Context, Result}; +use camino::Utf8Path; +use omicron_zone_package::config::{self, PackageName}; +use omicron_zone_package::package::BuildConfig; +use omicron_zone_package::progress; +use slog::{o, Drain, Logger}; use std::fs::create_dir_all; -use std::path::Path; -use std::time::Duration; -const PKG_NAME: &str = "propolis-server"; +const PKG_NAME: PackageName = PackageName::new_const("propolis-server"); -fn in_progress_style() -> ProgressStyle { - ProgressStyle::default_bar() - .template( - "[{elapsed_precise}] {bar:40.cyan/blue} {pos:>7}/{len:7} {msg}", - ) - .expect("Invalid template") - .progress_chars("#>.") -} - -fn completed_progress_style() -> ProgressStyle { - ProgressStyle::default_bar() - .template("[{elapsed_precise}] {bar:40.cyan/blue} {pos:>7}/{len:7} {msg:.green}") - .expect("Invalid template") - .progress_chars("#>.") -} - -/// Progress UI for the package creation. -struct ProgressUI { - /// Shared handle for managing all progress bars. - multi: MultiProgress, - - /// Progress bar for the overall package creation. - pkg_pb: ProgressBar, -} - -impl ProgressUI { - fn new(total: u64) -> Self { - // Create overall handle for managing all progress bars. - let multi = MultiProgress::new(); - - // We start off with one main progress bar for the overall package - // creation. Sub-tasks (e.g. blob download) will dynamically create - // their own progress bars via `Progress::sub_progress()`. - let pkg_pb = multi.add(ProgressBar::new(total)); - pkg_pb.set_style(in_progress_style()); - - // Don't want to appear stuck while copying large files (e.g. blobs) - // so enable steady ticks to keep the elapsed time moving. - pkg_pb.enable_steady_tick(Duration::from_millis(500)); - - Self { multi, pkg_pb } +struct PrintProgress(slog::Logger); +impl Default for PrintProgress { + fn default() -> Self { + let deco = slog_term::PlainDecorator::new(std::io::stdout()); + let drain = slog_term::CompactFormat::new(deco).build(); + Self(Logger::root(std::sync::Mutex::new(drain).fuse(), o!())) } } - -impl Progress for ProgressUI { - fn set_message(&self, msg: std::borrow::Cow<'static, str>) { - self.pkg_pb.set_message(msg); +impl progress::Progress for PrintProgress { + fn get_log(&self) -> &Logger { + &self.0 } - fn increment(&self, delta: u64) { - self.pkg_pb.inc(delta); - } - - fn sub_progress(&self, total: u64) -> Box { - let sub_pb = self.multi.add(ProgressBar::new(total)); - sub_pb.set_style(in_progress_style()); - - Box::new(SubProgress::new(self.multi.clone(), sub_pb)) - } -} - -/// Progress UI for a sub-task (e.g. downloading blobs). -struct SubProgress { - /// Shared handle for managing all progress bars. - multi: MultiProgress, - - /// Progress bar for this specific sub-task. - pb: ProgressBar, -} - -impl SubProgress { - fn new(multi: MultiProgress, pb: ProgressBar) -> Self { - Self { multi, pb } - } -} - -impl Progress for SubProgress { fn set_message(&self, msg: std::borrow::Cow<'static, str>) { - self.pb.set_message(msg); - } - - fn increment(&self, delta: u64) { - self.pb.inc(delta); - } -} - -impl Drop for SubProgress { - fn drop(&mut self) { - // Sub-task has completed, so remove the progress bar. - self.multi.remove(&self.pb); + slog::info!(self.0, "package progress"; "msg" => msg.as_ref()); } } #[tokio::main] async fn main() -> Result<()> { - let cfg = - omicron_zone_package::config::parse("packaging/package-manifest.toml")?; + let cfg = config::parse("packaging/package-manifest.toml")?; - let output_dir = Path::new("out"); + let output_dir = Utf8Path::new("out"); create_dir_all(output_dir)?; // We only expect a single package so just look it directly let pkg = cfg .packages - .get(PKG_NAME) + .get(&PKG_NAME) .with_context(|| anyhow!("missing propolis-server package"))?; - let target = Target(BTreeMap::new()); - let progress = ProgressUI::new(pkg.get_total_work_for_target(&target)?); - - pkg.create_with_progress_for_target( - &progress, &target, PKG_NAME, output_dir, + let progress = PrintProgress::default(); + println!("Building {PKG_NAME} package..."); + pkg.create( + &PKG_NAME, + output_dir, + &BuildConfig { progress: &progress, ..Default::default() }, ) .await?; - progress.pkg_pb.set_style(completed_progress_style()); - progress.pkg_pb.finish_with_message(format!( - "done: {}", - pkg.get_output_file(PKG_NAME) - )); - + println!("Done!"); Ok(()) }