Skip to content

Commit

Permalink
prototype Omicron debugger (oxidecomputer#4084)
Browse files Browse the repository at this point in the history
  • Loading branch information
davepacheco authored Sep 14, 2023
1 parent 980c5be commit aceb744
Show file tree
Hide file tree
Showing 24 changed files with 1,437 additions and 119 deletions.
65 changes: 65 additions & 0 deletions Cargo.lock

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

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ members = [
"nexus/test-utils-macros",
"nexus/test-utils",
"nexus/types",
"omdb",
"oxide-client",
"oximeter-client",
"oximeter/collector",
Expand Down Expand Up @@ -97,6 +98,7 @@ default-members = [
"nexus/db-queries",
"nexus/defaults",
"nexus/types",
"omdb",
"oxide-client",
"oximeter-client",
"oximeter/collector",
Expand Down Expand Up @@ -151,7 +153,7 @@ chacha20poly1305 = "0.10.1"
ciborium = "0.2.1"
cfg-if = "1.0"
chrono = { version = "0.4", features = [ "serde" ] }
clap = { version = "4.4", features = ["derive"] }
clap = { version = "4.4", features = ["derive", "env"] }
cookie = "0.16"
criterion = { version = "0.5.1", features = [ "async_tokio" ] }
crossbeam = "0.8"
Expand Down Expand Up @@ -233,6 +235,7 @@ omicron-common = { path = "common" }
omicron-dev-tools = { path = "dev-tools" }
omicron-gateway = { path = "gateway" }
omicron-nexus = { path = "nexus" }
omicron-omdb = { path = "omdb" }
omicron-package = { path = "package" }
omicron-rpaths = { path = "rpaths" }
omicron-sled-agent = { path = "sled-agent" }
Expand Down Expand Up @@ -330,6 +333,7 @@ strum = { version = "0.25", features = [ "derive" ] }
subprocess = "0.2.9"
libsw = { version = "3.3.0", features = ["tokio"] }
syn = { version = "2.0" }
tabled = "0.14"
tar = "0.4"
tempdir = "0.3"
tempfile = "3.6"
Expand Down
1 change: 1 addition & 0 deletions common/src/api/external/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,7 @@ impl TryFrom<i64> for Generation {
pub enum ResourceType {
AddressLot,
AddressLotBlock,
BackgroundTask,
Fleet,
Silo,
SiloUser,
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/src/bin/omicron-dev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async fn main() -> Result<(), anyhow::Error> {
Ok(())
}

/// Manage a local CockroachDB database for Omicron development
/// Tools for working with a local Omicron deployment
#[derive(Debug, Parser)]
#[clap(version)]
enum OmicronDb {
Expand Down
2 changes: 1 addition & 1 deletion dev-tools/tests/output/cmd-omicron-dev-noargs-stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Manage a local CockroachDB database for Omicron development
Tools for working with a local Omicron deployment

Usage: omicron-dev <COMMAND>

Expand Down
6 changes: 6 additions & 0 deletions nexus-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ impl From<std::time::Duration> for types::Duration {
}
}

impl From<types::Duration> for std::time::Duration {
fn from(s: types::Duration) -> Self {
std::time::Duration::from_nanos(s.secs * 1000000000 + s.nanos as u64)
}
}

impl From<omicron_common::address::IpRange> for types::IpRange {
fn from(r: omicron_common::address::IpRange) -> Self {
use omicron_common::address::IpRange;
Expand Down
2 changes: 1 addition & 1 deletion nexus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ omicron-rpaths.workspace = true

[dependencies]
anyhow.workspace = true
assert_matches.workspace = true
async-trait.workspace = true
base64.workspace = true
bb8.workspace = true
Expand Down Expand Up @@ -91,7 +92,6 @@ oximeter-producer.workspace = true
rustls = { workspace = true }

[dev-dependencies]
assert_matches.workspace = true
async-bb8-diesel.workspace = true
criterion.workspace = true
diesel.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion nexus/db-model/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ semver.workspace = true
serde.workspace = true
serde_json.workspace = true
steno.workspace = true
strum.workspace = true
uuid.workspace = true

db-macros.workspace = true
Expand All @@ -38,4 +39,3 @@ sled-agent-client.workspace = true

[dev-dependencies]
expectorate.workspace = true
strum.workspace = true
3 changes: 2 additions & 1 deletion nexus/db-model/src/service_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ use super::impl_enum_type;
use external_api::shared::ServiceUsingCertificate;
use nexus_types::{external_api, internal_api};
use serde::{Deserialize, Serialize};
use strum::EnumIter;

impl_enum_type!(
#[derive(Clone, SqlType, Debug, QueryId)]
#[diesel(postgres_type(name = "service_kind"))]
pub struct ServiceKindEnum;

#[derive(Clone, Copy, Debug, Eq, AsExpression, FromSqlRow, Serialize, Deserialize, PartialEq)]
#[derive(Clone, Copy, Debug, Eq, AsExpression, FromSqlRow, Serialize, Deserialize, PartialEq, EnumIter)]
#[diesel(sql_type = ServiceKindEnum)]
pub enum ServiceKind;

Expand Down
4 changes: 4 additions & 0 deletions nexus/db-model/src/sled.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ impl Sled {
pub fn address_with_port(&self, port: u16) -> SocketAddrV6 {
SocketAddrV6::new(self.ip(), port, 0, 0)
}

pub fn serial_number(&self) -> &str {
&self.serial_number
}
}

impl From<Sled> for views::Sled {
Expand Down
2 changes: 1 addition & 1 deletion nexus/db-queries/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ petgraph.workspace = true
rcgen.workspace = true
regex.workspace = true
rustls.workspace = true
strum.workspace = true
subprocess.workspace = true
tempfile.workspace = true
term.workspace = true
strum.workspace = true
Loading

0 comments on commit aceb744

Please sign in to comment.