Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ PATH_add out/cockroachdb/bin
PATH_add out/clickhouse
PATH_add out/dendrite-stub/bin
PATH_add out/mgd/root/opt/oxide/mgd/bin
PATH_add out/lldp/root/opt/oxide/bin

if [ "$OMICRON_USE_FLAKE" = 1 ] && nix flake show &> /dev/null
then
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -538,8 +538,8 @@ newtype_derive = "0.1.6"
ntp-admin-api = { path = "ntp-admin/api" }
ntp-admin-client = { path = "clients/ntp-admin-client" }
ntp-admin-types = { path = "ntp-admin/types" }
mg-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "0df320d42b356e689a3c7a7600eec9b16770237a" }
ddm-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "0df320d42b356e689a3c7a7600eec9b16770237a" }
mg-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "9e94d6b79560c2e4639cba432fb0ed600e9a3ff8" }
ddm-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "9e94d6b79560c2e4639cba432fb0ed600e9a3ff8" }
multimap = "0.10.1"
nexus-auth = { path = "nexus/auth" }
nexus-background-task-interface = { path = "nexus/background-task-interface" }
Expand Down Expand Up @@ -666,7 +666,7 @@ ratatui = "0.29.0"
raw-cpuid = { git = "https://github.com/oxidecomputer/rust-cpuid.git", rev = "a4cf01df76f35430ff5d39dc2fe470bcb953503b" }
rayon = "1.10"
rcgen = "0.12.1"
rdb-types = { git = "https://github.com/oxidecomputer/maghemite", rev = "0df320d42b356e689a3c7a7600eec9b16770237a" }
rdb-types = { git = "https://github.com/oxidecomputer/maghemite", rev = "9e94d6b79560c2e4639cba432fb0ed600e9a3ff8" }
reconfigurator-cli = { path = "dev-tools/reconfigurator-cli" }
reedline = "0.40.0"
ref-cast = "1.0"
Expand Down
78 changes: 78 additions & 0 deletions dev-tools/downloader/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ enum Target {

/// Transceiver Control binary
TransceiverControl,

/// LLDP binary
LLDP,
}

#[derive(Parser)]
Expand Down Expand Up @@ -136,6 +139,7 @@ pub async fn run_cmd(args: DownloadArgs) -> Result<()> {
Target::Cockroach => downloader.download_cockroach().await,
Target::Console => downloader.download_console().await,
Target::DendriteStub => downloader.download_dendrite_stub().await,
Target::LLDP => downloader.download_lldp().await,
Target::MaghemiteMgd => downloader.download_maghemite_mgd().await,
Target::Softnpu => downloader.download_softnpu().await,
Target::TransceiverControl => {
Expand Down Expand Up @@ -870,6 +874,80 @@ impl Downloader<'_> {
Ok(())
}

async fn download_lldp(&self) -> std::result::Result<(), anyhow::Error> {
let download_dir = self.output_dir.join("downloads");
tokio::fs::create_dir_all(&download_dir).await?;

let checksums_path = self.versions_dir.join("lldp_checksums");
let [lldp_sha2, lldp_linux_sha2] = get_values_from_file(
["CIDL_SHA256", "LINUX_SHA256"],
&checksums_path,
)
.await?;
let commit_path = self.versions_dir.join("lldp_openapi_version");
let [commit] = get_values_from_file(["COMMIT"], &commit_path).await?;

let repo = "oxidecomputer/lldp";
let base_url = format!("{BUILDOMAT_URL}/{repo}/image/{commit}");

let filename = "lldp.tar.gz";
let tarball_path = download_dir.join(filename);
download_file_and_verify(
&self.log,
&tarball_path,
&format!("{base_url}/{filename}"),
ChecksumAlgorithm::Sha2,
&lldp_sha2,
)
.await?;
unpack_tarball(&self.log, &tarball_path, &download_dir).await?;

let destination_dir = self.output_dir.join("lldp");
let _ = tokio::fs::remove_dir_all(&destination_dir).await;
tokio::fs::create_dir_all(&destination_dir).await?;
copy_dir_all(
&download_dir.join("root"),
&destination_dir.join("root"),
)?;

let binary_dir = destination_dir.join("root/opt/oxide/lldp/bin");

match os_name()? {
Os::Linux => {
let filename = "lldp";
let path = download_dir.join(filename);
download_file_and_verify(
&self.log,
&path,
&format!(
"{BUILDOMAT_URL}/{repo}/linux/{commit}/{filename}"
),
ChecksumAlgorithm::Sha2,
&lldp_linux_sha2,
)
.await?;
set_permissions(&path, 0o755).await?;
tokio::fs::copy(path, binary_dir.join(filename)).await?;
}
Os::Mac => {
info!(self.log, "Building lldp from source for macOS");

let binaries = [("lldp", &["--no-default-features"][..])];

let built_binaries =
self.build_from_git("lldp", &commit, &binaries).await?;

// Copy built binary to binary_dir
let dest = binary_dir.join("lldp");
tokio::fs::copy(&built_binaries[0], &dest).await?;
set_permissions(&dest, 0o755).await?;
}
Os::Illumos => (),
}

Ok(())
}

async fn download_maghemite_mgd(&self) -> Result<()> {
let download_dir = self.output_dir.join("downloads");
tokio::fs::create_dir_all(&download_dir).await?;
Expand Down
1 change: 1 addition & 0 deletions dev-tools/ls-apis/tests/api_dependencies.out
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Downstairs Controller (debugging only) (client: dsc-client)

Management Gateway Service (client: gateway-client)
consumed by: dpd (dendrite/dpd) via 1 path
consumed by: mgd (maghemite/mgd) via 1 path
consumed by: omicron-nexus (omicron/nexus) via 4 paths
consumed by: omicron-sled-agent (omicron/sled-agent) via 1 path
consumed by: wicketd (omicron/wicketd) via 3 paths
Expand Down
4 changes: 2 additions & 2 deletions dev-tools/omdb/tests/successes.out
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ task: "bfd_manager"
configured period: every <REDACTED_DURATION>s
last completed activation: <REDACTED ITERATIONS>, triggered by <TRIGGERED_BY_REDACTED>
started at <REDACTED_TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
last completion reported error: failed to resolve addresses for Dendrite services: proto error: no records found for Query { name: Name("_dendrite._tcp.control-plane.oxide.internal."), query_type: SRV, query_class: IN }
last completion reported error: failed to resolve addresses for Maghemite: proto error: no records found for Query { name: Name("_mgd._tcp.control-plane.oxide.internal."), query_type: SRV, query_class: IN }

task: "blueprint_planner"
configured period: every <REDACTED_DURATION>m
Expand Down Expand Up @@ -1141,7 +1141,7 @@ task: "bfd_manager"
configured period: every <REDACTED_DURATION>s
last completed activation: <REDACTED ITERATIONS>, triggered by <TRIGGERED_BY_REDACTED>
started at <REDACTED_TIMESTAMP> (<REDACTED DURATION>s ago) and ran for <REDACTED DURATION>ms
last completion reported error: failed to resolve addresses for Dendrite services: proto error: no records found for Query { name: Name("_dendrite._tcp.control-plane.oxide.internal."), query_type: SRV, query_class: IN }
last completion reported error: failed to resolve addresses for Maghemite: proto error: no records found for Query { name: Name("_mgd._tcp.control-plane.oxide.internal."), query_type: SRV, query_class: IN }

task: "blueprint_planner"
configured period: every <REDACTED_DURATION>m
Expand Down
Loading