diff --git a/Cargo.lock b/Cargo.lock index 800281763..844b66dd3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -206,6 +206,12 @@ dependencies = [ "password-hash", ] +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + [[package]] name = "arrayvec" version = "0.7.4" @@ -395,6 +401,21 @@ dependencies = [ "digest", ] +[[package]] +name = "blake3" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "memmap2", + "rayon", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -502,6 +523,16 @@ dependencies = [ "serde", ] +[[package]] +name = "camino-tempfile" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb905055fa81e4d427f919b2cd0d76a998267de7d225ea767a1894743a5263c2" +dependencies = [ + "camino", + "tempfile", +] + [[package]] name = "cc" version = "1.0.83" @@ -647,6 +678,12 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + [[package]] name = "convert_case" version = "0.4.0" @@ -1056,6 +1093,7 @@ name = "crucible-package" version = "0.1.0" dependencies = [ "anyhow", + "camino", "crucible-workspace-hack", "omicron-zone-package", "tokio", @@ -1144,6 +1182,7 @@ dependencies = [ name = "crucible-workspace-hack" version = "0.1.0" dependencies = [ + "arrayvec", "bitflags 2.5.0", "bytes", "cc", @@ -2567,6 +2606,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "memmap2" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.9.0" @@ -3070,15 +3118,19 @@ checksum = "e22821954cca73148cdd1547a540ac79a3f27b6d55b518490437bb9867212828" [[package]] name = "omicron-zone-package" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e0b92149236c16677cda6e1efb8bde8f7b5f838344c65c621888f8251170ce" +checksum = "e75ad9eb79bb6a1ec78d2eecf36c67fffcf56264d779c456c6e2cd4b257ee9fe" dependencies = [ "anyhow", "async-trait", + "blake3", + "camino", + "camino-tempfile", "chrono", "filetime", "flate2", + "futures", "futures-util", "hex", "reqwest", @@ -3086,8 +3138,9 @@ dependencies = [ "semver 1.0.23", "serde", "serde_derive", + "serde_json", + "slog", "tar", - "tempfile", "thiserror", "tokio", "toml 0.7.8", diff --git a/Cargo.toml b/Cargo.toml index 8cbcb3da5..142c24c78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,6 +39,7 @@ base64 = "0.22.1" bincode = "1.3" byte-unit = "5.1.4" bytes = { version = "1", features = ["serde"] } +camino = { version = "1.1", features = ["serde1"] } cfg-if = { version = "1" } chrono = { version = "0.4", features = [ "serde" ] } clap = { version = "4.5", features = ["derive", "env", "wrap_help"] } @@ -65,7 +66,7 @@ nix = { version = "0.28", features = [ "feature", "uio" ] } num_enum = "0.7" num-derive = "0.4" num-traits = "0.2" -omicron-zone-package = "0.10.0" +omicron-zone-package = "0.11.0" openapiv3 = "2.0.0" opentelemetry = "0.22.0" opentelemetry-jaeger = { version = "0.20.0" } diff --git a/package/Cargo.toml b/package/Cargo.toml index 38fe92837..b8d6c2d21 100644 --- a/package/Cargo.toml +++ b/package/Cargo.toml @@ -5,6 +5,7 @@ edition = "2021" [dependencies] anyhow.workspace = true +camino.workspace = true +crucible-workspace-hack.workspace = true omicron-zone-package.workspace = true tokio.workspace = true -crucible-workspace-hack.workspace = true diff --git a/package/src/main.rs b/package/src/main.rs index 060005f6a..ca8b77b2f 100644 --- a/package/src/main.rs +++ b/package/src/main.rs @@ -1,16 +1,16 @@ // Copyright 2022 Oxide Computer Company use anyhow::Result; +use camino::Utf8Path; use omicron_zone_package::config; use omicron_zone_package::target::Target; use std::fs::create_dir_all; -use std::path::Path; #[tokio::main] async fn main() -> Result<()> { let cfg = config::parse("package-manifest.toml")?; - let output_dir = Path::new("out"); + let output_dir = Utf8Path::new("out"); create_dir_all(output_dir)?; let packages = cfg.packages_to_deploy(&Target::default()); @@ -19,9 +19,9 @@ async fn main() -> Result<()> { for batch in package_iter { for (name, package) in &batch { println!("Building '{name}'"); - package - .create_for_target(&Target::default(), name, output_dir) - .await?; + let build_config = + omicron_zone_package::package::BuildConfig::default(); + package.create(name, output_dir, &build_config).await?; } } diff --git a/workspace-hack/Cargo.toml b/workspace-hack/Cargo.toml index a15a8c431..7d8a508f5 100644 --- a/workspace-hack/Cargo.toml +++ b/workspace-hack/Cargo.toml @@ -14,6 +14,7 @@ publish = false ### BEGIN HAKARI SECTION [dependencies] +arrayvec = { version = "0.7", default-features = false, features = ["std"] } bitflags = { version = "2", default-features = false, features = ["serde", "std"] } bytes = { version = "1", features = ["serde"] } chrono = { version = "0.4", features = ["serde"] }