Skip to content

Commit 24f7cc0

Browse files
authored
Add faux-mgs binary to the switch zone (#6164)
Closes #6153
1 parent 1bb75f2 commit 24f7cc0

File tree

5 files changed

+64
-38
lines changed

5 files changed

+64
-38
lines changed

Cargo.lock

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,16 @@ fs-err = "2.11.0"
321321
futures = "0.3.30"
322322
gateway-api = { path = "gateway-api" }
323323
gateway-client = { path = "clients/gateway-client" }
324-
gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "c85a4ca043aaa389df12aac5348d8a3feda28762", default-features = false, features = ["std"] }
325-
gateway-sp-comms = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "c85a4ca043aaa389df12aac5348d8a3feda28762" }
324+
# If you're updating the pinned revision of these MGS dependencies, you should
325+
# also update the git commit revision for the `omicron-faux-mgs` package in
326+
# `package-manifest.toml`. Failure to do so won't cause incorrect behavior, but
327+
# does mean the `faux-mgs` shipped with the switch zone would be out of date
328+
# relative to the MGS proper shipped in that same switch zone. (Generally this
329+
# is "fine", because SP/MGS communication maintains forwards and backwards
330+
# compatibility, but will mean that faux-mgs might be missing new
331+
# functionality.)
332+
gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "319e7b92db69792ab8efa4c68554ad0cf83adf93", default-features = false, features = ["std"] }
333+
gateway-sp-comms = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "319e7b92db69792ab8efa4c68554ad0cf83adf93" }
326334
gateway-test-utils = { path = "gateway-test-utils" }
327335
gateway-types = { path = "gateway-types" }
328336
gethostname = "0.4.3"

package-manifest.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,22 @@ output.type = "zone"
489489

490490
# Packages not built within Omicron, but which must be imported.
491491

492+
[package.omicron-faux-mgs]
493+
# This package bundles a `faux-mgs` binary into `/usr/bin` in the switch zone,
494+
# allowing `pilot sp ...` to work without needing to manually scp a `faux-mgs`
495+
# binary in during support operations. (On rare occasions a support operator may
496+
# still need to do that to get a more recent faux-mgs.)
497+
service_name = "faux_mgs"
498+
only_for_targets.image = "standard"
499+
source.type = "prebuilt"
500+
source.repo = "management-gateway-service"
501+
# In general, this commit should match the pinned revision of `gateway-sp-comms`
502+
# in `Cargo.toml`.
503+
source.commit = "319e7b92db69792ab8efa4c68554ad0cf83adf93"
504+
source.sha256 = "f4cbc480c8cfc2605c13b319291e69cbf8c213bb9c625ff79d339f90a7124358"
505+
output.type = "zone"
506+
output.intermediate_only = true
507+
492508
# Refer to
493509
# https://github.com/oxidecomputer/crucible/blob/main/package/README.md
494510
# for instructions on building this manually.
@@ -728,6 +744,7 @@ only_for_targets.switch = "asic"
728744
only_for_targets.image = "standard"
729745
source.type = "composite"
730746
source.packages = [
747+
"omicron-faux-mgs.tar.gz",
731748
"omicron-gateway-asic.tar.gz",
732749
"dendrite-asic.tar.gz",
733750
"lldp.tar.gz",

package/src/bin/omicron-package.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,14 +430,15 @@ async fn download_prebuilt(
430430
}
431431

432432
let digest = context.finish();
433-
if digest.as_ref() != expected_digest {
434-
bail!(
435-
"Digest mismatch downloading {package_name}: Saw {}, expected {}",
433+
if digest.as_ref() == expected_digest {
434+
Ok(())
435+
} else {
436+
Err(anyhow!("Failed validating download of {url}").context(format!(
437+
"Digest mismatch on {package_name}: Saw {}, expected {}",
436438
hex::encode(digest.as_ref()),
437439
hex::encode(expected_digest)
438-
);
440+
)))
439441
}
440-
Ok(())
441442
}
442443

443444
// Ensures a package exists, either by creating it or downloading it.
@@ -484,7 +485,7 @@ async fn ensure_package(
484485
let msg = format!("Failed to download prebuilt ({attempts_left} attempts remaining)");
485486
progress.set_error_message(msg.into());
486487
if attempts_left == 0 {
487-
bail!("Failed to download package: {err}");
488+
return Err(err);
488489
}
489490
tokio::time::sleep(config.retry_duration).await;
490491
progress.reset();

workspace-hack/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ base16ct = { version = "0.2.0", default-features = false, features = ["alloc"] }
2424
bit-set = { version = "0.5.3" }
2525
bit-vec = { version = "0.6.3" }
2626
bitflags-dff4ba8e3ae991db = { package = "bitflags", version = "1.3.2" }
27-
bitflags-f595c2ba2a3f28df = { package = "bitflags", version = "2.5.0", default-features = false, features = ["serde", "std"] }
27+
bitflags-f595c2ba2a3f28df = { package = "bitflags", version = "2.6.0", default-features = false, features = ["serde", "std"] }
2828
bstr-6f8ce4dd05d13bba = { package = "bstr", version = "0.2.17" }
2929
bstr-dff4ba8e3ae991db = { package = "bstr", version = "1.9.1" }
3030
byteorder = { version = "1.5.0" }
@@ -54,7 +54,7 @@ futures-io = { version = "0.3.30", default-features = false, features = ["std"]
5454
futures-sink = { version = "0.3.30" }
5555
futures-task = { version = "0.3.30", default-features = false, features = ["std"] }
5656
futures-util = { version = "0.3.30", features = ["channel", "io", "sink"] }
57-
gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "c85a4ca043aaa389df12aac5348d8a3feda28762", features = ["std"] }
57+
gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "319e7b92db69792ab8efa4c68554ad0cf83adf93", features = ["std"] }
5858
generic-array = { version = "0.14.7", default-features = false, features = ["more_lengths", "zeroize"] }
5959
getrandom = { version = "0.2.14", default-features = false, features = ["js", "rdrand", "std"] }
6060
group = { version = "0.13.0", default-features = false, features = ["alloc"] }
@@ -129,7 +129,7 @@ base16ct = { version = "0.2.0", default-features = false, features = ["alloc"] }
129129
bit-set = { version = "0.5.3" }
130130
bit-vec = { version = "0.6.3" }
131131
bitflags-dff4ba8e3ae991db = { package = "bitflags", version = "1.3.2" }
132-
bitflags-f595c2ba2a3f28df = { package = "bitflags", version = "2.5.0", default-features = false, features = ["serde", "std"] }
132+
bitflags-f595c2ba2a3f28df = { package = "bitflags", version = "2.6.0", default-features = false, features = ["serde", "std"] }
133133
bstr-6f8ce4dd05d13bba = { package = "bstr", version = "0.2.17" }
134134
bstr-dff4ba8e3ae991db = { package = "bstr", version = "1.9.1" }
135135
byteorder = { version = "1.5.0" }
@@ -159,7 +159,7 @@ futures-io = { version = "0.3.30", default-features = false, features = ["std"]
159159
futures-sink = { version = "0.3.30" }
160160
futures-task = { version = "0.3.30", default-features = false, features = ["std"] }
161161
futures-util = { version = "0.3.30", features = ["channel", "io", "sink"] }
162-
gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "c85a4ca043aaa389df12aac5348d8a3feda28762", features = ["std"] }
162+
gateway-messages = { git = "https://github.com/oxidecomputer/management-gateway-service", rev = "319e7b92db69792ab8efa4c68554ad0cf83adf93", features = ["std"] }
163163
generic-array = { version = "0.14.7", default-features = false, features = ["more_lengths", "zeroize"] }
164164
getrandom = { version = "0.2.14", default-features = false, features = ["js", "rdrand", "std"] }
165165
group = { version = "0.13.0", default-features = false, features = ["alloc"] }

0 commit comments

Comments
 (0)