Skip to content

Commit

Permalink
Update crucible (#2889)
Browse files Browse the repository at this point in the history
  • Loading branch information
smklein authored Apr 20, 2023
1 parent dee9d45 commit bd66f33
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 44 deletions.
63 changes: 37 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion nexus/src/app/sagas/import_blocks_from_url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}

Expand Down
12 changes: 6 additions & 6 deletions package-manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -221,21 +221,21 @@ 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/<commit>/crucible.sha256.txt
source.sha256 = "227761dcba9372619c71fcf7137a7a98c4d618192cbaa6f41031c4429ab99c04"
source.sha256 = "52a08b6637b7701549f1b0b0979f8fbb64f2dd6942b954ffa27c15b265cad143"
output.type = "zone"

[package.crucible-pantry]
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/<commit>/crucible-pantry.sha256.txt
source.sha256 = "bf648339cfd010bad65186584fe34108cc1f27162c62e11f1d18b1fe89a43ddc"
source.sha256 = "31027320798cf77f5175415839d722bcf5d7a52fd6bbc327625028b81b709c2b"
output.type = "zone"

# Refer to
Expand All @@ -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/<commit>/propolis-server.sha256.txt
source.sha256 = "93265033a62a998ebc2d64ed3c0f0d4a97c16d34132d3d59660f5430a24990e9"
source.sha256 = "d4782227629464288a6d1cfdd7bdef135c179ddd2b0d573e785e758b7d063285"
output.type = "zone"

[package.maghemite]
Expand Down
12 changes: 9 additions & 3 deletions sled-agent/src/sim/http_entrypoints_pantry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -119,15 +124,16 @@ async fn is_job_finished(
async fn job_result_ok(
rc: RequestContext<Arc<Pantry>>,
path: TypedPath<JobPath>,
) -> Result<HttpResponseOk<()>, HttpError> {
) -> Result<HttpResponseOk<JobResultOkResponse>, 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())),
}
}
Expand Down
4 changes: 2 additions & 2 deletions sled-agent/src/sim/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,13 +640,13 @@ impl Pantry {
pub async fn get_job_result(
&self,
job_id: String,
) -> Result<Result<()>, HttpError> {
) -> Result<Result<bool>, 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(
Expand Down

0 comments on commit bd66f33

Please sign in to comment.