Skip to content

Commit 1b3558c

Browse files
Update Rust crate dropshot to 0.16.0 (#1645)
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [dropshot](https://redirect.github.com/oxidecomputer/dropshot) | workspace.dependencies | minor | `0.12.0` -> `0.16.0` | --- ### Release Notes <details> <summary>oxidecomputer/dropshot (dropshot)</summary> ### [`v0.16.0`](https://redirect.github.com/oxidecomputer/dropshot/compare/v0.15.1...v0.16.0) [Compare Source](https://redirect.github.com/oxidecomputer/dropshot/compare/v0.15.1...v0.16.0) ### [`v0.15.1`](https://redirect.github.com/oxidecomputer/dropshot/compare/v0.15.0...v0.15.1) [Compare Source](https://redirect.github.com/oxidecomputer/dropshot/compare/v0.15.0...v0.15.1) ### [`v0.15.0`](https://redirect.github.com/oxidecomputer/dropshot/compare/v0.14.0...v0.15.0) [Compare Source](https://redirect.github.com/oxidecomputer/dropshot/compare/v0.14.0...v0.15.0) ### [`v0.14.0`](https://redirect.github.com/oxidecomputer/dropshot/compare/v0.13.0...v0.14.0) [Compare Source](https://redirect.github.com/oxidecomputer/dropshot/compare/v0.13.0...v0.14.0) ### [`v0.13.0`](https://redirect.github.com/oxidecomputer/dropshot/compare/v0.12.0...v0.13.0) [Compare Source](https://redirect.github.com/oxidecomputer/dropshot/compare/v0.12.0...v0.13.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 8pm,before 6am" in timezone America/Los_Angeles, Automerge - "after 8pm,before 6am" in timezone America/Los_Angeles. 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/oxidecomputer/crucible). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNzYuMiIsInVwZGF0ZWRJblZlciI6IjM5LjE4NS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Alan Hanson <alan@oxidecomputer.com>
1 parent 6e37930 commit 1b3558c

21 files changed

+260
-140
lines changed

Cargo.lock

+222-121
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ ringbuffer = "0.15.0"
8383
rusqlite = { version = "0.32" }
8484
rustls-pemfile = { version = "1.0.4" }
8585
schemars = { version = "0.8", features = [ "chrono", "uuid1" ] }
86+
semver = "1"
8687
serde = { version = "1", features = [ "derive" ] }
8788
serde_json = "1"
8889
sha2 = "0.10"
@@ -114,7 +115,7 @@ usdt = "0.5.0"
114115
uuid = { version = "1", features = [ "serde", "v4" ] }
115116

116117
# git
117-
dropshot = { version = "0.12.0", features = [ "usdt-probes" ] }
118+
dropshot = { version = "0.16.0", features = [ "usdt-probes" ] }
118119
omicron-common = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
119120
nexus-client = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }
120121
internal-dns = { git = "https://github.com/oxidecomputer/omicron", branch = "main" }

agent/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ http.workspace = true
1616
hyper.workspace = true
1717
omicron-common.workspace = true
1818
schemars.workspace = true
19+
semver.workspace = true
1920
serde.workspace = true
2021
serde_json.workspace = true
2122
slog.workspace = true

agent/src/main.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use anyhow::{anyhow, bail, Result};
44
use clap::Parser;
55
use dropshot::{ConfigLogging, ConfigLoggingIfExists, ConfigLoggingLevel};
6+
use semver::Version;
67
use slog::{debug, error, info, o, Logger};
78
use std::collections::HashSet;
89
use std::io::Write;
@@ -341,7 +342,8 @@ async fn main() -> Result<()> {
341342

342343
fn write_openapi<W: Write>(f: &mut W) -> Result<()> {
343344
let api = server::make_api()?;
344-
api.openapi("Crucible Agent", "0.0.0").write(f)?;
345+
api.openapi("Crucible Agent", Version::new(0, 0, 1))
346+
.write(f)?;
345347
Ok(())
346348
}
347349

agent/src/server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ pub async fn run_server(
352352
let server = dropshot::HttpServerStarter::new(
353353
&dropshot::ConfigDropshot {
354354
bind_address,
355-
request_body_max_bytes: 1024 * 10,
355+
default_request_body_max_bytes: 1024 * 10,
356356
default_handler_task_mode: HandlerTaskMode::Detached,
357357
log_headers: vec![],
358358
},

downstairs/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ reqwest.workspace = true
3737
ringbuffer.workspace = true
3838
rusqlite.workspace = true
3939
schemars.workspace = true
40+
semver.workspace = true
4041
serde.workspace = true
4142
serde_json.workspace = true
4243
sha2.workspace = true

downstairs/src/repair.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use dropshot::RequestContext;
1313
use dropshot::{endpoint, Path};
1414
use hyper::{Response, StatusCode};
1515
use schemars::JsonSchema;
16+
use semver::Version;
1617
use serde::Deserialize;
1718

1819
use super::*;
@@ -30,7 +31,8 @@ pub struct FileServerContext {
3031

3132
pub fn write_openapi<W: Write>(f: &mut W) -> Result<()> {
3233
let api = build_api();
33-
api.openapi("Downstairs Repair", "0.0.0").write(f)?;
34+
api.openapi("Downstairs Repair", Version::new(0, 0, 1))
35+
.write(f)?;
3436
Ok(())
3537
}
3638

@@ -57,7 +59,7 @@ pub fn repair_main(
5759
*/
5860
let config_dropshot = ConfigDropshot {
5961
bind_address: addr,
60-
request_body_max_bytes: 1024,
62+
default_request_body_max_bytes: 1024,
6163
default_handler_task_mode: HandlerTaskMode::Detached,
6264
log_headers: vec![],
6365
};

dsc/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dropshot.workspace = true
1717
rand.workspace = true
1818
rand_chacha.workspace = true
1919
schemars.workspace = true
20+
semver.workspace = true
2021
serde.workspace = true
2122
statistical.workspace = true
2223
tokio.workspace = true

dsc/src/control.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use dropshot::Path;
1111
use dropshot::RequestContext;
1212
use dropshot::{HttpResponseOk, HttpResponseUpdatedNoContent};
1313
use schemars::JsonSchema;
14+
use semver::Version;
1415
use serde::Deserialize;
1516
use std::sync::Arc;
1617

@@ -51,7 +52,7 @@ pub async fn begin(dsci: Arc<DscInfo>, addr: SocketAddr) -> Result<(), String> {
5152
// Setup dropshot
5253
let config_dropshot = ConfigDropshot {
5354
bind_address: addr,
54-
request_body_max_bytes: 1024,
55+
default_request_body_max_bytes: 1024,
5556
default_handler_task_mode: HandlerTaskMode::Detached,
5657
log_headers: vec![],
5758
};
@@ -588,14 +589,15 @@ async fn dsc_enable_random_max(
588589
#[cfg(test)]
589590
mod test {
590591
use openapiv3::OpenAPI;
592+
use semver::Version;
591593

592594
use super::build_api;
593595

594596
#[test]
595597
fn test_dsc_openapi() {
596598
let api = build_api();
597599
let mut raw = Vec::new();
598-
api.openapi("DownStairs Control", "0.0.0")
600+
api.openapi("DownStairs Control", Version::new(0, 0, 1))
599601
.write(&mut raw)
600602
.unwrap();
601603
let actual = String::from_utf8(raw).unwrap();

openapi/crucible-agent.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.3",
33
"info": {
44
"title": "Crucible Agent",
5-
"version": "0.0.0"
5+
"version": "0.0.1"
66
},
77
"paths": {
88
"/crucible/0/regions": {

openapi/crucible-control.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.3",
33
"info": {
44
"title": "Crucible Control",
5-
"version": "0.0.0"
5+
"version": "0.0.1"
66
},
77
"paths": {
88
"/info": {

openapi/crucible-pantry.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.3",
33
"info": {
44
"title": "Crucible Pantry",
5-
"version": "0.0.0"
5+
"version": "0.0.1"
66
},
77
"paths": {
88
"/crucible/pantry/0": {

openapi/downstairs-repair.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.3",
33
"info": {
44
"title": "Downstairs Repair",
5-
"version": "0.0.0"
5+
"version": "0.0.1"
66
},
77
"paths": {
88
"/extent/{eid}/files": {

openapi/dsc-control.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.0.3",
33
"info": {
44
"title": "DownStairs Control",
5-
"version": "0.0.0"
5+
"version": "0.0.1"
66
},
77
"paths": {
88
"/allrunning": {

pantry/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ futures.workspace = true
1515
http.workspace = true
1616
hyper.workspace = true
1717
schemars.workspace = true
18+
semver.workspace = true
1819
serde.workspace = true
1920
serde_json.workspace = true
2021
slog.workspace = true

pantry/src/main.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use anyhow::{anyhow, Result};
44
use clap::Parser;
5+
use semver::Version;
56
use std::io::Write;
67
use std::net::SocketAddr;
78
use std::path::PathBuf;
@@ -46,7 +47,8 @@ async fn main() -> Result<()> {
4647

4748
fn write_openapi<W: Write>(f: &mut W) -> Result<()> {
4849
let api = server::make_api().map_err(|e| anyhow!(e))?;
49-
api.openapi("Crucible Pantry", "0.0.0").write(f)?;
50+
api.openapi("Crucible Pantry", Version::new(0, 0, 1))
51+
.write(f)?;
5052
Ok(())
5153
}
5254

pantry/src/pantry.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ impl Pantry {
851851
"volume {} is no longer active!",
852852
volume_id
853853
)),
854-
hyper::StatusCode::GONE,
854+
dropshot::ClientErrorStatusCode::GONE,
855855
format!("volume {} is no longer active!", volume_id),
856856
))
857857
} else {

pantry/src/server.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ pub fn run_server(
469469
bind_address,
470470
// max import, multiplied by worst case base64 overhead, plus room
471471
// for metadata
472-
request_body_max_bytes: 1024
472+
default_request_body_max_bytes: 1024
473473
+ crate::pantry::PantryEntry::MAX_CHUNK_SIZE * 2,
474474
default_handler_task_mode: HandlerTaskMode::Detached,
475475
log_headers: vec![],

upstairs/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ rand.workspace = true
3939
rayon.workspace = true
4040
ringbuffer.workspace = true
4141
schemars.workspace = true
42+
semver.workspace = true
4243
serde.workspace = true
4344
serde_json.workspace = true
4445
slog.workspace = true

upstairs/src/control.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub async fn start(
3535
*/
3636
let config_dropshot = ConfigDropshot {
3737
bind_address: addr,
38-
request_body_max_bytes: 1024,
38+
default_request_body_max_bytes: 1024,
3939
default_handler_task_mode: HandlerTaskMode::Detached,
4040
log_headers: vec![],
4141
};
@@ -186,14 +186,15 @@ async fn downstairs_work_queue(
186186
#[cfg(test)]
187187
mod test {
188188
use openapiv3::OpenAPI;
189+
use semver::Version;
189190

190191
use super::build_api;
191192

192193
#[test]
193194
fn test_crucible_control_openapi() {
194195
let api = build_api();
195196
let mut raw = Vec::new();
196-
api.openapi("Crucible Control", "0.0.0")
197+
api.openapi("Crucible Control", Version::new(0, 0, 1))
197198
.write(&mut raw)
198199
.unwrap();
199200
let actual = String::from_utf8(raw).unwrap();

workspace-hack/Cargo.toml

+6-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ futures-core = { version = "0.3" }
3030
futures-executor = { version = "0.3" }
3131
futures-sink = { version = "0.3" }
3232
futures-util = { version = "0.3", features = ["channel", "io", "sink"] }
33-
getrandom = { version = "0.2", default-features = false, features = ["std"] }
3433
hex = { version = "0.4", features = ["serde"] }
3534
indexmap = { version = "2", features = ["serde"] }
3635
libc = { version = "0.2", features = ["extra_traits"] }
@@ -79,7 +78,6 @@ futures-core = { version = "0.3" }
7978
futures-executor = { version = "0.3" }
8079
futures-sink = { version = "0.3" }
8180
futures-util = { version = "0.3", features = ["channel", "io", "sink"] }
82-
getrandom = { version = "0.2", default-features = false, features = ["std"] }
8381
hex = { version = "0.4", features = ["serde"] }
8482
indexmap = { version = "2", features = ["serde"] }
8583
libc = { version = "0.2", features = ["extra_traits"] }
@@ -117,6 +115,7 @@ zerocopy = { version = "0.7", features = ["derive", "simd"] }
117115
[target.x86_64-unknown-linux-gnu.dependencies]
118116
bitflags-dff4ba8e3ae991db = { package = "bitflags", version = "1" }
119117
dof = { version = "0.3", default-features = false, features = ["des"] }
118+
getrandom = { version = "0.2", default-features = false, features = ["std"] }
120119
hyper = { version = "1", features = ["full"] }
121120
hyper-rustls = { version = "0.27", default-features = false, features = ["http1", "http2", "ring", "tls12", "webpki-tokio"] }
122121
hyper-util = { version = "0.1", features = ["full"] }
@@ -129,6 +128,7 @@ tokio-util = { version = "0.7", features = ["codec", "io"] }
129128

130129
[target.x86_64-unknown-linux-gnu.build-dependencies]
131130
dof = { version = "0.3", default-features = false, features = ["des"] }
131+
getrandom = { version = "0.2", default-features = false, features = ["std"] }
132132
hyper = { version = "1", features = ["full"] }
133133
hyper-rustls = { version = "0.27", default-features = false, features = ["http1", "http2", "ring", "tls12", "webpki-tokio"] }
134134
hyper-util = { version = "0.1", features = ["full"] }
@@ -140,6 +140,7 @@ spin = { version = "0.9", default-features = false, features = ["once", "spin_mu
140140
tokio-util = { version = "0.7", features = ["codec", "io"] }
141141

142142
[target.aarch64-apple-darwin.dependencies]
143+
getrandom = { version = "0.2", default-features = false, features = ["std"] }
143144
hyper = { version = "1", features = ["full"] }
144145
hyper-rustls = { version = "0.27", default-features = false, features = ["http1", "http2", "ring", "tls12", "webpki-tokio"] }
145146
hyper-util = { version = "0.1", features = ["full"] }
@@ -150,6 +151,7 @@ rustls-pki-types = { version = "1", features = ["std"] }
150151
tokio-util = { version = "0.7", features = ["codec", "io"] }
151152

152153
[target.aarch64-apple-darwin.build-dependencies]
154+
getrandom = { version = "0.2", default-features = false, features = ["std"] }
153155
hyper = { version = "1", features = ["full"] }
154156
hyper-rustls = { version = "0.27", default-features = false, features = ["http1", "http2", "ring", "tls12", "webpki-tokio"] }
155157
hyper-util = { version = "0.1", features = ["full"] }
@@ -162,6 +164,7 @@ tokio-util = { version = "0.7", features = ["codec", "io"] }
162164
[target.x86_64-unknown-illumos.dependencies]
163165
bitflags-dff4ba8e3ae991db = { package = "bitflags", version = "1" }
164166
dof = { version = "0.3", default-features = false, features = ["des"] }
167+
getrandom = { version = "0.2", default-features = false, features = ["std"] }
165168
hyper = { version = "1", features = ["full"] }
166169
hyper-rustls = { version = "0.27", default-features = false, features = ["http1", "http2", "ring", "tls12", "webpki-tokio"] }
167170
hyper-util = { version = "0.1", features = ["full"] }
@@ -175,6 +178,7 @@ toml_edit = { version = "0.19", features = ["serde"] }
175178

176179
[target.x86_64-unknown-illumos.build-dependencies]
177180
dof = { version = "0.3", default-features = false, features = ["des"] }
181+
getrandom = { version = "0.2", default-features = false, features = ["std"] }
178182
hyper = { version = "1", features = ["full"] }
179183
hyper-rustls = { version = "0.27", default-features = false, features = ["http1", "http2", "ring", "tls12", "webpki-tokio"] }
180184
hyper-util = { version = "0.1", features = ["full"] }

0 commit comments

Comments
 (0)