Skip to content

Commit

Permalink
move sled-agent dropshot config to toml file; bump request max size t…
Browse files Browse the repository at this point in the history
…o allow for host OS images
  • Loading branch information
jgallagher committed Dec 7, 2023
1 parent af908e3 commit 865d281
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 3 deletions.
6 changes: 6 additions & 0 deletions sled-agent/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use crate::updates::ConfigUpdates;
use camino::{Utf8Path, Utf8PathBuf};
use dropshot::ConfigDropshot;
use dropshot::ConfigLogging;
use illumos_utils::dladm::Dladm;
use illumos_utils::dladm::FindPhysicalLinkError;
Expand Down Expand Up @@ -44,6 +45,11 @@ pub struct SoftPortConfig {
#[derive(Clone, Debug, Deserialize)]
#[serde(deny_unknown_fields)]
pub struct Config {
/// Configuration for the sled agent dropshot server
///
/// If the `bind_address` is set, it will be ignored. The remaining fields
/// will be respected.
pub dropshot: ConfigDropshot,
/// Configuration for the sled agent debug log
pub log: ConfigLogging,
/// The sled's mode of operation (auto detect or force gimlet/scrimlet).
Expand Down
7 changes: 4 additions & 3 deletions sled-agent/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ impl Server {
.await
.map_err(|e| e.to_string())?;

let mut dropshot_config = dropshot::ConfigDropshot::default();
dropshot_config.request_body_max_bytes = 1024 * 1024;
dropshot_config.bind_address = SocketAddr::V6(sled_address);
let dropshot_config = dropshot::ConfigDropshot {
bind_address: SocketAddr::V6(sled_address),
..config.dropshot
};
let dropshot_log = log.new(o!("component" => "dropshot (SledAgent)"));
let http_server = dropshot::HttpServerStarter::new(
&dropshot_config,
Expand Down
5 changes: 5 additions & 0 deletions smf/sled-agent/gimlet-standalone/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ swap_device_size_gb = 256

data_links = ["net0", "net1"]

[dropshot]
# Host OS images are just over 800 MiB currently; set this to 2 GiB to give some
# breathing room.
request_body_max_bytes = 2_147_483_648

[log]
level = "info"
mode = "file"
Expand Down
5 changes: 5 additions & 0 deletions smf/sled-agent/gimlet/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ swap_device_size_gb = 256

data_links = ["cxgbe0", "cxgbe1"]

[dropshot]
# Host OS images are just over 800 MiB currently; set this to 2 GiB to give some
# breathing room.
request_body_max_bytes = 2_147_483_648

[log]
level = "info"
mode = "file"
Expand Down
5 changes: 5 additions & 0 deletions smf/sled-agent/non-gimlet/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ switch_zone_maghemite_links = ["tfportrear0_0"]

data_links = ["net0", "net1"]

[dropshot]
# Host OS images are just over 800 MiB currently; set this to 2 GiB to give some
# breathing room.
request_body_max_bytes = 2_147_483_648

[log]
level = "info"
mode = "file"
Expand Down

0 comments on commit 865d281

Please sign in to comment.