Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid tight coupling between Omicron and Propolis Dropshot versions #7057

Merged
merged 7 commits into from
Nov 14, 2024
Merged
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
18 changes: 9 additions & 9 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -520,10 +520,10 @@ prettyplease = { version = "0.2.25", features = ["verbatim"] }
proc-macro2 = "1.0"
progenitor = "0.8.0"
progenitor-client = "0.8.0"
bhyve_api = { git = "https://github.com/oxidecomputer/propolis", rev = "86101eaf80b55e7f405b5cafe9b0de0e9f331656" }
propolis_api_types = { git = "https://github.com/oxidecomputer/propolis", rev = "86101eaf80b55e7f405b5cafe9b0de0e9f331656" }
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "86101eaf80b55e7f405b5cafe9b0de0e9f331656" }
propolis-mock-server = { git = "https://github.com/oxidecomputer/propolis", rev = "86101eaf80b55e7f405b5cafe9b0de0e9f331656" }
bhyve_api = { git = "https://github.com/oxidecomputer/propolis", rev = "aadc0998c0f07f08ab15a95c006074291734800f" }
propolis_api_types = { git = "https://github.com/oxidecomputer/propolis", rev = "aadc0998c0f07f08ab15a95c006074291734800f" }
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "aadc0998c0f07f08ab15a95c006074291734800f" }
propolis-mock-server = { git = "https://github.com/oxidecomputer/propolis", rev = "aadc0998c0f07f08ab15a95c006074291734800f" }
proptest = "1.5.0"
qorb = "0.2.0"
quote = "1.0"
Expand Down
4 changes: 2 additions & 2 deletions package-manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -621,10 +621,10 @@ service_name = "propolis-server"
only_for_targets.image = "standard"
source.type = "prebuilt"
source.repo = "propolis"
source.commit = "86101eaf80b55e7f405b5cafe9b0de0e9f331656"
source.commit = "aadc0998c0f07f08ab15a95c006074291734800f"
# The SHA256 digest is automatically posted to:
# https://buildomat.eng.oxide.computer/public/file/oxidecomputer/propolis/image/<commit>/propolis-server.sha256.txt
source.sha256 = "8dd411d6f2db23f93c2340cce11aa194da8dcb8cfd20081a614a5722ffbfe255"
source.sha256 = "3cd889201aaa8cc5b916fc8f8176ab5529e2fc1d5d57165ad9a660eb48affef9"
output.type = "zone"

[package.mg-ddm-gz]
Expand Down
20 changes: 4 additions & 16 deletions sled-agent/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2102,29 +2102,17 @@ mod tests {
// TODO: factor out, this is also in sled-agent-sim.
fn propolis_mock_server(
log: &Logger,
) -> (HttpServer<Arc<propolis_mock_server::Context>>, PropolisClient) {
) -> (propolis_mock_server::Server, PropolisClient) {
let propolis_bind_address =
SocketAddr::new(Ipv6Addr::LOCALHOST.into(), 0); // allocate port
let dropshot_config = dropshot::ConfigDropshot {
let dropshot_config = propolis_mock_server::Config {
bind_address: propolis_bind_address,
..Default::default()
};
let propolis_log = log.new(o!("component" => "propolis-server-mock"));
let private =
Arc::new(propolis_mock_server::Context::new(propolis_log));
info!(log, "Starting mock propolis-server...");
let dropshot_log = log.new(o!("component" => "dropshot"));
let mock_api = propolis_mock_server::api();

let srv = dropshot::HttpServerStarter::new(
&dropshot_config,
mock_api,
private,
&dropshot_log,
)
.expect("couldn't create mock propolis-server")
.start();

let srv = propolis_mock_server::start(dropshot_config, log.clone())
.expect("couldn't create mock propolis-server");
let client = propolis_client::Client::new(&format!(
"http://{}",
srv.local_addr()
Expand Down
29 changes: 10 additions & 19 deletions sled-agent/src/sim/sled_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::sim::simulatable::Simulatable;
use crate::updates::UpdateManager;
use anyhow::bail;
use anyhow::Context;
use dropshot::{HttpError, HttpServer};
use dropshot::HttpError;
use futures::lock::Mutex;
use nexus_sled_agent_shared::inventory::{
Inventory, InventoryDataset, InventoryDisk, InventoryZpool,
Expand All @@ -43,7 +43,6 @@ use oxnet::Ipv6Net;
use propolis_client::{
types::VolumeConstructionRequest, Client as PropolisClient,
};
use propolis_mock_server::Context as PropolisContext;
use sled_agent_types::disk::DiskStateRequested;
use sled_agent_types::early_networking::{
EarlyNetworkConfig, EarlyNetworkConfigBody,
Expand Down Expand Up @@ -81,7 +80,7 @@ pub struct SledAgent {
disk_id_to_region_ids: Mutex<HashMap<String, Vec<Uuid>>>,
pub v2p_mappings: Mutex<HashSet<VirtualNetworkInterfaceHost>>,
mock_propolis:
Mutex<Option<(HttpServer<Arc<PropolisContext>>, PropolisClient)>>,
Mutex<Option<(propolis_mock_server::Server, PropolisClient)>>,
/// lists of external IPs assigned to instances
pub external_ips:
Mutex<HashMap<PropolisUuid, HashSet<InstanceExternalIpBody>>>,
Expand Down Expand Up @@ -797,26 +796,18 @@ impl SledAgent {
}
let propolis_bind_address =
SocketAddr::new(Ipv6Addr::LOCALHOST.into(), 0);
let dropshot_config = dropshot::ConfigDropshot {
let dropshot_config = propolis_mock_server::Config {
bind_address: propolis_bind_address,
..Default::default()
};
let propolis_log = log.new(o!("component" => "propolis-server-mock"));
let private = Arc::new(PropolisContext::new(propolis_log));
info!(log, "Starting mock propolis-server...");
let dropshot_log = log.new(o!("component" => "dropshot"));
let mock_api = propolis_mock_server::api();

let srv = dropshot::HttpServerStarter::new(
&dropshot_config,
mock_api,
private,
&dropshot_log,
)
.map_err(|error| {
Error::unavail(&format!("initializing propolis-server: {}", error))
})?
.start();
let srv = propolis_mock_server::start(dropshot_config, log.clone())
.map_err(|error| {
Error::unavail(&format!(
"initializing propolis-server: {}",
error
))
})?;
let addr = srv.local_addr();
let client = propolis_client::Client::new(&format!("http://{}", addr));
*mock_lock = Some((srv, client));
Expand Down
Loading