Skip to content

Commit

Permalink
Merge branch 'main' into felixmcfelix/floating-ip
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMcFelix committed Dec 5, 2023
2 parents 43ef99d + 0a781f9 commit 52b9157
Show file tree
Hide file tree
Showing 96 changed files with 1,978 additions and 574 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/hakari.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
with:
toolchain: stable
- name: Install cargo-hakari
uses: taiki-e/install-action@21526ba3bb38834e625c185ae4f2f942f1fb8f27 # v2
uses: taiki-e/install-action@d211c4be5a95cbcd52a0870dda7d63a107a58368 # v2
with:
tool: cargo-hakari
- name: Check workspace-hack Cargo.toml is up-to-date
Expand Down
61 changes: 25 additions & 36 deletions Cargo.lock

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

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,17 @@ cookie = "0.18"
criterion = { version = "0.5.1", features = [ "async_tokio" ] }
crossbeam = "0.8"
crossterm = { version = "0.27.0", features = ["event-stream"] }
crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "51a3121c8318fc7ac97d74f917ce1d37962e785f" }
crucible-pantry-client = { git = "https://github.com/oxidecomputer/crucible", rev = "51a3121c8318fc7ac97d74f917ce1d37962e785f" }
crucible-smf = { git = "https://github.com/oxidecomputer/crucible", rev = "51a3121c8318fc7ac97d74f917ce1d37962e785f" }
crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "945f040d259ca8013d3fb26f510453da7cd7b1a6" }
crucible-pantry-client = { git = "https://github.com/oxidecomputer/crucible", rev = "945f040d259ca8013d3fb26f510453da7cd7b1a6" }
crucible-smf = { git = "https://github.com/oxidecomputer/crucible", rev = "945f040d259ca8013d3fb26f510453da7cd7b1a6" }
curve25519-dalek = "4"
datatest-stable = "0.2.3"
display-error-chain = "0.2.0"
ddm-admin-client = { path = "clients/ddm-admin-client" }
db-macros = { path = "nexus/db-macros" }
debug-ignore = "1.0.5"
derive_more = "0.99.17"
derive-where = "1.2.5"
derive-where = "1.2.6"
diesel = { version = "2.1.4", features = ["postgres", "r2d2", "chrono", "serde_json", "network-address", "uuid"] }
diesel-dtrace = { git = "https://github.com/oxidecomputer/diesel-dtrace", branch = "main" }
dns-server = { path = "dns-server" }
Expand Down Expand Up @@ -263,7 +263,7 @@ oxide-client = { path = "clients/oxide-client" }
oxide-vpc = { git = "https://github.com/oxidecomputer/opte", rev = "24ceba1969269e4d81bda83d8968d7d7f713c46b", features = [ "api", "std" ] }
once_cell = "1.18.0"
openapi-lint = { git = "https://github.com/oxidecomputer/openapi-lint", branch = "main" }
openapiv3 = "1.0"
openapiv3 = "2.0.0-rc.1"
# must match samael's crate!
openssl = "0.10"
openssl-sys = "0.9"
Expand Down Expand Up @@ -292,9 +292,9 @@ pretty-hex = "0.4.0"
proc-macro2 = "1.0"
progenitor = { git = "https://github.com/oxidecomputer/progenitor", branch = "main" }
progenitor-client = { git = "https://github.com/oxidecomputer/progenitor", branch = "main" }
bhyve_api = { git = "https://github.com/oxidecomputer/propolis", rev = "54398875a2125227d13827d4236dce943c019b1c" }
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "54398875a2125227d13827d4236dce943c019b1c" }
propolis-mock-server = { git = "https://github.com/oxidecomputer/propolis", rev = "54398875a2125227d13827d4236dce943c019b1c" }
bhyve_api = { git = "https://github.com/oxidecomputer/propolis", rev = "3e1d129151c3621d28ead5c6e5760693ba6e7fec" }
propolis-client = { git = "https://github.com/oxidecomputer/propolis", rev = "3e1d129151c3621d28ead5c6e5760693ba6e7fec" }
propolis-mock-server = { git = "https://github.com/oxidecomputer/propolis", rev = "3e1d129151c3621d28ead5c6e5760693ba6e7fec" }
proptest = "1.4.0"
quote = "1.0"
rand = "0.8.5"
Expand Down
24 changes: 20 additions & 4 deletions common/src/nexus_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ pub struct BackgroundTaskConfig {
pub nat_cleanup: NatCleanupConfig,
/// configuration for inventory tasks
pub inventory: InventoryConfig,
/// configuration for phantom disks task
pub phantom_disks: PhantomDiskConfig,
}

#[serde_as]
Expand Down Expand Up @@ -386,7 +388,7 @@ pub struct NatCleanupConfig {
pub struct InventoryConfig {
/// period (in seconds) for periodic activations of this background task
///
/// Each activation fetches information about all harware and software in
/// Each activation fetches information about all hardware and software in
/// the system and inserts it into the database. This generates a moderate
/// amount of data.
#[serde_as(as = "DurationSeconds<u64>")]
Expand All @@ -405,6 +407,14 @@ pub struct InventoryConfig {
pub disable: bool,
}

#[serde_as]
#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)]
pub struct PhantomDiskConfig {
/// period (in seconds) for periodic activations of this background task
#[serde_as(as = "DurationSeconds<u64>")]
pub period_secs: Duration,
}

/// Configuration for a nexus server
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct PackageConfig {
Expand Down Expand Up @@ -508,8 +518,9 @@ mod test {
BackgroundTaskConfig, Config, ConfigDropshotWithTls, ConsoleConfig,
Database, DeploymentConfig, DnsTasksConfig, DpdConfig,
ExternalEndpointsConfig, InternalDns, InventoryConfig, LoadError,
LoadErrorKind, MgdConfig, NatCleanupConfig, PackageConfig, SchemeName,
TimeseriesDbConfig, Tunables, UpdatesConfig,
LoadErrorKind, MgdConfig, NatCleanupConfig, PackageConfig,
PhantomDiskConfig, SchemeName, TimeseriesDbConfig, Tunables,
UpdatesConfig,
};
use crate::address::{Ipv6Subnet, RACK_PREFIX};
use crate::api::internal::shared::SwitchLocation;
Expand Down Expand Up @@ -663,6 +674,7 @@ mod test {
inventory.period_secs = 10
inventory.nkeep = 11
inventory.disable = false
phantom_disks.period_secs = 30
[default_region_allocation_strategy]
type = "random"
seed = 0
Expand Down Expand Up @@ -764,7 +776,10 @@ mod test {
period_secs: Duration::from_secs(10),
nkeep: 11,
disable: false,
}
},
phantom_disks: PhantomDiskConfig {
period_secs: Duration::from_secs(30),
},
},
default_region_allocation_strategy:
crate::nexus_config::RegionAllocationStrategy::Random {
Expand Down Expand Up @@ -822,6 +837,7 @@ mod test {
inventory.period_secs = 10
inventory.nkeep = 3
inventory.disable = false
phantom_disks.period_secs = 30
[default_region_allocation_strategy]
type = "random"
"##,
Expand Down
26 changes: 26 additions & 0 deletions dev-tools/omdb/src/bin/omdb/nexus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,32 @@ fn print_task_details(bgtask: &BackgroundTask, details: &serde_json::Value) {
);
}
};
} else if name == "phantom_disks" {
#[derive(Deserialize)]
struct TaskSuccess {
/// how many phantom disks were deleted ok
phantom_disk_deleted_ok: usize,

/// how many phantom disks could not be deleted
phantom_disk_deleted_err: usize,
}

match serde_json::from_value::<TaskSuccess>(details.clone()) {
Err(error) => eprintln!(
"warning: failed to interpret task details: {:?}: {:?}",
error, details
),
Ok(success) => {
println!(
" number of phantom disks deleted: {}",
success.phantom_disk_deleted_ok
);
println!(
" number of phantom disk delete errors: {}",
success.phantom_disk_deleted_err
);
}
};
} else {
println!(
"warning: unknown background task: {:?} \
Expand Down
Loading

0 comments on commit 52b9157

Please sign in to comment.