Skip to content

Commit

Permalink
Use crucible-client-types instead of crucible (#1553)
Browse files Browse the repository at this point in the history
Instead of including the entire crucible library, use the new
crucible-client-types crate that exports only the things that
the sled-agent needs.

Update crucible and propolis versions.

Update Cargo.toml comment for propolis-client and crucible-client-types

Added new field for CrucibleOpts

Co-authored-by: Alan Hanson <[email protected]>
  • Loading branch information
leftwo and Alan Hanson authored Aug 8, 2022
1 parent d72a148 commit 63315ba
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 350 deletions.
385 changes: 54 additions & 331 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,18 @@ opt-level = 3
panic = "abort"

#
# It's common during development to use a local copy of dropshot, propolis
# or steno in the parent directory. If you want to use those, uncomment
# one of these blocks.
# It's common during development to use a local copy of dropshot, propolis,
# crucible, or steno in the parent directory. If you want to use those,
# uncomment one of these blocks.
#
#[patch."https://github.com/oxidecomputer/dropshot"]
#dropshot = { path = "../dropshot/dropshot" }
#[patch."https://github.com/oxidecomputer/steno"]
#steno = { path = "../steno" }
#[patch."https://github.com/oxidecomputer/propolis"]
#propolis-client = { path = "../propolis/client" }
#propolis-server = { path = "../propolis/server" }
#propolis-client = { path = "../propolis/lib/propolis-client" }
#[patch."https://github.com/oxidecomputer/crucible"]
#crucible = { path = "../crucible/upstairs" }
#crucible-client-typess = { path = "../crucible/crucible-client-typess" }

#
# Local client generation during development.
Expand Down
2 changes: 1 addition & 1 deletion nexus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ base64 = "0.13.0"
bb8 = "0.8.0"
clap = { version = "3.2", features = ["derive"] }
cookie = "0.16"
crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "2add0de8489f1d4de901bfe98fc28b0a6efcc3ea" }
crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "1d67a53042f19ff7ca30dd20a04da94b7715ed7c" }
diesel = { version = "2.0.0-rc.1", features = ["postgres", "r2d2", "chrono", "serde_json", "network-address", "uuid"] }
diesel-dtrace = { git = "https://github.com/oxidecomputer/diesel-dtrace", rev = "b9262a79db59f0727ca28ca9baed6fc6e3cc31e7" }
fatfs = "0.3.5"
Expand Down
1 change: 1 addition & 0 deletions nexus/src/app/sagas/disk_create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ async fn sdc_regions_ensure(
// TODO open a control socket for the whole volume, not
// in the sub volumes
control: None,
read_only: false,
},
},
],
Expand Down
4 changes: 4 additions & 0 deletions openapi/sled-agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@
"lossy": {
"type": "boolean"
},
"read_only": {
"type": "boolean"
},
"root_cert_pem": {
"nullable": true,
"type": "string"
Expand All @@ -316,6 +319,7 @@
"required": [
"id",
"lossy",
"read_only",
"target"
]
},
Expand Down
8 changes: 4 additions & 4 deletions package-manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ zone = true
# 3. Use type = "manual" instead of the "prebuilt"
type = "prebuilt"
repo = "crucible"
commit = "2add0de8489f1d4de901bfe98fc28b0a6efcc3ea"
commit = "1d67a53042f19ff7ca30dd20a04da94b7715ed7c"
# The SHA256 digest is automatically posted to:
# https://buildomat.eng.oxide.computer/public/file/oxidecomputer/crucible/image/<commit>/crucible.sha256.txt
sha256 = "9940df1b070d4eb2305ad0b38380131b4a54cfc23b56e12ea1cbf9946b773fe9"
sha256 = "d43fcfabc3f6402cfdbe3a0d31d49ae903f76b5ddec955dcee63236e4a60fdb0"

# Refer to
# https://github.com/oxidecomputer/propolis/blob/master/package/README.md
Expand All @@ -114,10 +114,10 @@ zone = true
[external_package.propolis-server.source]
type = "prebuilt"
repo = "propolis"
commit = "13e23ff1ea51fc2b98f9e99099a46a40f805834e"
commit = "c59b1ac246b19130bd489cdce217e40a4e51c094"
# The SHA256 digest is automatically posted to:
# https://buildomat.eng.oxide.computer/public/file/oxidecomputer/propolis/image/<commit>/propolis-server.sha256.txt
sha256 = "866165e42cc8f969d0f5c758cc3d9971f27fa1f111091e0f2a33ea46b7f0af93"
sha256 = "0e75d9a22f1ff14b90d04d91e5642d654563cc82f69e2e9cca5a983668d25764"

[external_package.maghemite]
service_name = "mg-ddm"
Expand Down
10 changes: 3 additions & 7 deletions sled-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@ cfg-if = "1.0"
chrono = { version = "0.4", features = [ "serde" ] }
clap = { version = "3.2", features = ["derive"] }
# Only used by the simulated sled agent.
# TODO: This is probably overkill. We'd like to only depend on
# the "crucible-agent-client", but the VolumeConstructionRequest object
# does not exist there.
crucible = { git = "https://github.com/oxidecomputer/crucible", rev = "2add0de8489f1d4de901bfe98fc28b0a6efcc3ea" }
# Only used by the simulated sled agent.
crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "2add0de8489f1d4de901bfe98fc28b0a6efcc3ea" }
crucible-client-types = { git = "https://github.com/oxidecomputer/crucible", rev = "1d67a53042f19ff7ca30dd20a04da94b7715ed7c" }
crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "1d67a53042f19ff7ca30dd20a04da94b7715ed7c" }
ddm-admin-client = { path = "../ddm-admin-client" }
dropshot = { git = "https://github.com/oxidecomputer/dropshot", branch = "main", features = [ "usdt-probes" ] }
futures = "0.3.21"
Expand All @@ -34,7 +30,7 @@ oximeter-producer = { version = "0.1.0", path = "../oximeter/producer" }
p256 = "0.9.0"
percent-encoding = "2.1.0"
progenitor = { git = "https://github.com/oxidecomputer/progenitor" }
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "a9399a8007f9876e31ce152848e6ecc2a9e14283" }
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "c59b1ac246b19130bd489cdce217e40a4e51c094" }
rand = { version = "0.8.5", features = ["getrandom"] }
reqwest = { version = "0.11.8", default-features = false, features = ["rustls-tls", "stream"] }
schemars = { version = "0.8.10", features = [ "chrono", "uuid1" ] }
Expand Down
5 changes: 4 additions & 1 deletion sled-agent/src/sim/sled_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ impl SledAgent {
let target = DiskStateRequested::Attached(instance_id);

let id = match disk.volume_construction_request {
crucible::VolumeConstructionRequest::Volume { id, .. } => id,
crucible_client_types::VolumeConstructionRequest::Volume {
id,
..
} => id,
_ => panic!("Unexpected construction type"),
};
self.disks.sim_ensure(&id, initial_state, target).await?;
Expand Down

0 comments on commit 63315ba

Please sign in to comment.