diff --git a/Cargo.lock b/Cargo.lock index b571d1b290..15cdf4454c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -436,7 +436,17 @@ dependencies = [ [[package]] name = "bhyve_api" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis?rev=40e8d8e280c312e44047ff9d6b3b261e4537977a#40e8d8e280c312e44047ff9d6b3b261e4537977a" +source = "git+https://github.com/oxidecomputer/propolis?rev=e7ce7a1dbe2d410b787df2e52478229b008b4750#e7ce7a1dbe2d410b787df2e52478229b008b4750" +dependencies = [ + "bhyve_api_sys", + "libc", + "num_enum", +] + +[[package]] +name = "bhyve_api_sys" +version = "0.0.0" +source = "git+https://github.com/oxidecomputer/propolis?rev=e7ce7a1dbe2d410b787df2e52478229b008b4750#e7ce7a1dbe2d410b787df2e52478229b008b4750" dependencies = [ "libc", "num_enum", @@ -1335,7 +1345,7 @@ dependencies = [ [[package]] name = "crucible-agent-client" version = "0.0.1" -source = "git+https://github.com/oxidecomputer/crucible?rev=fb671895e8adb3cab5e801bbbe8728997178aba4#fb671895e8adb3cab5e801bbbe8728997178aba4" +source = "git+https://github.com/oxidecomputer/crucible?rev=3a3e806bfc2eea3519cfc0ec14ec4e745f275cd6#3a3e806bfc2eea3519cfc0ec14ec4e745f275cd6" dependencies = [ "anyhow", "chrono", @@ -1350,19 +1360,7 @@ dependencies = [ [[package]] name = "crucible-client-types" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/crucible?rev=894d44988c56713105bbbd07900d628781ab4dda#894d44988c56713105bbbd07900d628781ab4dda" -dependencies = [ - "base64 0.21.0", - "schemars", - "serde", - "serde_json", - "uuid", -] - -[[package]] -name = "crucible-client-types" -version = "0.1.0" -source = "git+https://github.com/oxidecomputer/crucible?rev=fb671895e8adb3cab5e801bbbe8728997178aba4#fb671895e8adb3cab5e801bbbe8728997178aba4" +source = "git+https://github.com/oxidecomputer/crucible?rev=3a3e806bfc2eea3519cfc0ec14ec4e745f275cd6#3a3e806bfc2eea3519cfc0ec14ec4e745f275cd6" dependencies = [ "base64 0.21.0", "schemars", @@ -1374,7 +1372,7 @@ dependencies = [ [[package]] name = "crucible-pantry-client" version = "0.0.1" -source = "git+https://github.com/oxidecomputer/crucible?rev=fb671895e8adb3cab5e801bbbe8728997178aba4#fb671895e8adb3cab5e801bbbe8728997178aba4" +source = "git+https://github.com/oxidecomputer/crucible?rev=3a3e806bfc2eea3519cfc0ec14ec4e745f275cd6#3a3e806bfc2eea3519cfc0ec14ec4e745f275cd6" dependencies = [ "anyhow", "chrono", @@ -1390,7 +1388,7 @@ dependencies = [ [[package]] name = "crucible-smf" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/crucible?rev=fb671895e8adb3cab5e801bbbe8728997178aba4#fb671895e8adb3cab5e801bbbe8728997178aba4" +source = "git+https://github.com/oxidecomputer/crucible?rev=3a3e806bfc2eea3519cfc0ec14ec4e745f275cd6#3a3e806bfc2eea3519cfc0ec14ec4e745f275cd6" dependencies = [ "libc", "num-derive", @@ -1794,7 +1792,7 @@ checksum = "7e1a8646b2c125eeb9a84ef0faa6d2d102ea0d5da60b824ade2743263117b848" [[package]] name = "dladm" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis?rev=40e8d8e280c312e44047ff9d6b3b261e4537977a#40e8d8e280c312e44047ff9d6b3b261e4537977a" +source = "git+https://github.com/oxidecomputer/propolis?rev=e7ce7a1dbe2d410b787df2e52478229b008b4750#e7ce7a1dbe2d410b787df2e52478229b008b4750" dependencies = [ "libc", "num_enum", @@ -4486,7 +4484,7 @@ dependencies = [ "chrono", "clap 4.2.2", "crucible-agent-client", - "crucible-client-types 0.1.0 (git+https://github.com/oxidecomputer/crucible?rev=fb671895e8adb3cab5e801bbbe8728997178aba4)", + "crucible-client-types", "ddm-admin-client", "dns-server", "dns-service-client", @@ -5595,7 +5593,7 @@ checksum = "8bccbff07d5ed689c4087d20d7307a52ab6141edeedf487c3876a55b86cf63df" [[package]] name = "propolis" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/propolis?rev=40e8d8e280c312e44047ff9d6b3b261e4537977a#40e8d8e280c312e44047ff9d6b3b261e4537977a" +source = "git+https://github.com/oxidecomputer/propolis?rev=e7ce7a1dbe2d410b787df2e52478229b008b4750#e7ce7a1dbe2d410b787df2e52478229b008b4750" dependencies = [ "anyhow", "bhyve_api", @@ -5626,10 +5624,10 @@ dependencies = [ [[package]] name = "propolis-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/propolis?rev=40e8d8e280c312e44047ff9d6b3b261e4537977a#40e8d8e280c312e44047ff9d6b3b261e4537977a" +source = "git+https://github.com/oxidecomputer/propolis?rev=e7ce7a1dbe2d410b787df2e52478229b008b4750#e7ce7a1dbe2d410b787df2e52478229b008b4750" dependencies = [ "base64 0.21.0", - "crucible-client-types 0.1.0 (git+https://github.com/oxidecomputer/crucible?rev=894d44988c56713105bbbd07900d628781ab4dda)", + "crucible-client-types", "progenitor", "propolis_types", "rand 0.8.5", @@ -5647,7 +5645,7 @@ dependencies = [ [[package]] name = "propolis-server" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/propolis?rev=40e8d8e280c312e44047ff9d6b3b261e4537977a#40e8d8e280c312e44047ff9d6b3b261e4537977a" +source = "git+https://github.com/oxidecomputer/propolis?rev=e7ce7a1dbe2d410b787df2e52478229b008b4750#e7ce7a1dbe2d410b787df2e52478229b008b4750" dependencies = [ "anyhow", "async-trait", @@ -5690,7 +5688,7 @@ dependencies = [ [[package]] name = "propolis-server-config" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis?rev=40e8d8e280c312e44047ff9d6b3b261e4537977a#40e8d8e280c312e44047ff9d6b3b261e4537977a" +source = "git+https://github.com/oxidecomputer/propolis?rev=e7ce7a1dbe2d410b787df2e52478229b008b4750#e7ce7a1dbe2d410b787df2e52478229b008b4750" dependencies = [ "serde", "serde_derive", @@ -5701,7 +5699,7 @@ dependencies = [ [[package]] name = "propolis_types" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis?rev=40e8d8e280c312e44047ff9d6b3b261e4537977a#40e8d8e280c312e44047ff9d6b3b261e4537977a" +source = "git+https://github.com/oxidecomputer/propolis?rev=e7ce7a1dbe2d410b787df2e52478229b008b4750#e7ce7a1dbe2d410b787df2e52478229b008b4750" dependencies = [ "schemars", "serde", @@ -8506,7 +8504,20 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "viona_api" version = "0.0.0" -source = "git+https://github.com/oxidecomputer/propolis?rev=40e8d8e280c312e44047ff9d6b3b261e4537977a#40e8d8e280c312e44047ff9d6b3b261e4537977a" +source = "git+https://github.com/oxidecomputer/propolis?rev=e7ce7a1dbe2d410b787df2e52478229b008b4750#e7ce7a1dbe2d410b787df2e52478229b008b4750" +dependencies = [ + "libc", + "num_enum", + "viona_api_sys", +] + +[[package]] +name = "viona_api_sys" +version = "0.0.0" +source = "git+https://github.com/oxidecomputer/propolis?rev=e7ce7a1dbe2d410b787df2e52478229b008b4750#e7ce7a1dbe2d410b787df2e52478229b008b4750" +dependencies = [ + "libc", +] [[package]] name = "vsss-rs" diff --git a/Cargo.toml b/Cargo.toml index 08daca6e71..ae49c343e2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -138,10 +138,10 @@ cookie = "0.16" criterion = { version = "0.4", features = [ "async_tokio" ] } crossbeam = "0.8" crossterm = { version = "0.26.1", features = ["event-stream"] } -crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "fb671895e8adb3cab5e801bbbe8728997178aba4" } -crucible-client-types = { git = "https://github.com/oxidecomputer/crucible", rev = "fb671895e8adb3cab5e801bbbe8728997178aba4" } -crucible-pantry-client = { git = "https://github.com/oxidecomputer/crucible", rev = "fb671895e8adb3cab5e801bbbe8728997178aba4" } -crucible-smf = { git = "https://github.com/oxidecomputer/crucible", rev = "fb671895e8adb3cab5e801bbbe8728997178aba4" } +crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "3a3e806bfc2eea3519cfc0ec14ec4e745f275cd6" } +crucible-client-types = { git = "https://github.com/oxidecomputer/crucible", rev = "3a3e806bfc2eea3519cfc0ec14ec4e745f275cd6" } +crucible-pantry-client = { git = "https://github.com/oxidecomputer/crucible", rev = "3a3e806bfc2eea3519cfc0ec14ec4e745f275cd6" } +crucible-smf = { git = "https://github.com/oxidecomputer/crucible", rev = "3a3e806bfc2eea3519cfc0ec14ec4e745f275cd6" } datatest-stable = "0.1.3" display-error-chain = "0.1.1" ddm-admin-client = { path = "ddm-admin-client" } @@ -243,8 +243,8 @@ pretty-hex = "0.3.0" proc-macro2 = "1.0" progenitor = { git = "https://github.com/oxidecomputer/progenitor", branch = "main" } progenitor-client = { git = "https://github.com/oxidecomputer/progenitor", branch = "main" } -propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "40e8d8e280c312e44047ff9d6b3b261e4537977a", features = [ "generated-migration" ] } -propolis-server = { git = "https://github.com/oxidecomputer/propolis", rev = "40e8d8e280c312e44047ff9d6b3b261e4537977a", default-features = false, features = ["mock-only"] } +propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "e7ce7a1dbe2d410b787df2e52478229b008b4750", features = [ "generated-migration" ] } +propolis-server = { git = "https://github.com/oxidecomputer/propolis", rev = "e7ce7a1dbe2d410b787df2e52478229b008b4750", default-features = false, features = ["mock-only"] } proptest = "1.1.0" quote = "1.0" rand = "0.8.5" diff --git a/nexus/src/app/sagas/import_blocks_from_url.rs b/nexus/src/app/sagas/import_blocks_from_url.rs index 86022f431b..a623a4636f 100644 --- a/nexus/src/app/sagas/import_blocks_from_url.rs +++ b/nexus/src/app/sagas/import_blocks_from_url.rs @@ -313,11 +313,15 @@ async fn sibfu_wait_for_import_from_url( endpoint, ); - client + let response = client .job_result_ok(&job_id) .await .map_err(|e| ActionError::action_failed(e.to_string()))?; + if !response.job_result_ok { + return Err(ActionError::action_failed(format!("Job {job_id} failed"))); + } + Ok(()) } diff --git a/package-manifest.toml b/package-manifest.toml index 4577e71ff2..baca4e80da 100644 --- a/package-manifest.toml +++ b/package-manifest.toml @@ -221,10 +221,10 @@ only_for_targets.image = "standard" # 3. Use source.type = "manual" instead of "prebuilt" source.type = "prebuilt" source.repo = "crucible" -source.commit = "fb671895e8adb3cab5e801bbbe8728997178aba4" +source.commit = "3a3e806bfc2eea3519cfc0ec14ec4e745f275cd6" # The SHA256 digest is automatically posted to: # https://buildomat.eng.oxide.computer/public/file/oxidecomputer/crucible/image//crucible.sha256.txt -source.sha256 = "227761dcba9372619c71fcf7137a7a98c4d618192cbaa6f41031c4429ab99c04" +source.sha256 = "52a08b6637b7701549f1b0b0979f8fbb64f2dd6942b954ffa27c15b265cad143" output.type = "zone" [package.crucible-pantry] @@ -232,10 +232,10 @@ service_name = "crucible_pantry" only_for_targets.image = "standard" source.type = "prebuilt" source.repo = "crucible" -source.commit = "fb671895e8adb3cab5e801bbbe8728997178aba4" +source.commit = "3a3e806bfc2eea3519cfc0ec14ec4e745f275cd6" # The SHA256 digest is automatically posted to: # https://buildomat.eng.oxide.computer/public/file/oxidecomputer/crucible/image//crucible-pantry.sha256.txt -source.sha256 = "bf648339cfd010bad65186584fe34108cc1f27162c62e11f1d18b1fe89a43ddc" +source.sha256 = "31027320798cf77f5175415839d722bcf5d7a52fd6bbc327625028b81b709c2b" output.type = "zone" # Refer to @@ -246,10 +246,10 @@ service_name = "propolis-server" only_for_targets.image = "standard" source.type = "prebuilt" source.repo = "propolis" -source.commit = "880a031fbdd7417cd3a4643f8bf419d8d5ea8224" +source.commit = "e7ce7a1dbe2d410b787df2e52478229b008b4750" # The SHA256 digest is automatically posted to: # https://buildomat.eng.oxide.computer/public/file/oxidecomputer/propolis/image//propolis-server.sha256.txt -source.sha256 = "93265033a62a998ebc2d64ed3c0f0d4a97c16d34132d3d59660f5430a24990e9" +source.sha256 = "d4782227629464288a6d1cfdd7bdef135c179ddd2b0d573e785e758b7d063285" output.type = "zone" [package.maghemite] diff --git a/sled-agent/src/sim/http_entrypoints_pantry.rs b/sled-agent/src/sim/http_entrypoints_pantry.rs index ecda289332..46686a74e2 100644 --- a/sled-agent/src/sim/http_entrypoints_pantry.rs +++ b/sled-agent/src/sim/http_entrypoints_pantry.rs @@ -110,6 +110,11 @@ async fn is_job_finished( Ok(HttpResponseOk(JobPollResponse { job_is_finished })) } +#[derive(Serialize, JsonSchema)] +pub struct JobResultOkResponse { + pub job_result_ok: bool, +} + /// Block on returning a Pantry background job result, then return 200 OK if the /// job executed OK, 500 otherwise. #[endpoint { @@ -119,15 +124,16 @@ async fn is_job_finished( async fn job_result_ok( rc: RequestContext>, path: TypedPath, -) -> Result, HttpError> { +) -> Result, HttpError> { let path = path.into_inner(); let pantry = rc.context(); let job_result = pantry.get_job_result(path.id).await?; match job_result { - Ok(_) => Ok(HttpResponseOk(())), - + Ok(job_result_ok) => { + Ok(HttpResponseOk(JobResultOkResponse { job_result_ok })) + } Err(e) => Err(HttpError::for_internal_error(e.to_string())), } } diff --git a/sled-agent/src/sim/storage.rs b/sled-agent/src/sim/storage.rs index 96386979e6..79da8cae22 100644 --- a/sled-agent/src/sim/storage.rs +++ b/sled-agent/src/sim/storage.rs @@ -640,13 +640,13 @@ impl Pantry { pub async fn get_job_result( &self, job_id: String, - ) -> Result, HttpError> { + ) -> Result, HttpError> { let mut jobs = self.jobs.lock().await; if !jobs.contains(&job_id) { return Err(HttpError::for_not_found(None, job_id)); } jobs.remove(&job_id); - Ok(Ok(())) + Ok(Ok(true)) } pub async fn import_from_url(