Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjstone committed Oct 6, 2023
1 parent b2c01e7 commit 327578c
Show file tree
Hide file tree
Showing 17 changed files with 156 additions and 1,172 deletions.
6 changes: 3 additions & 3 deletions sled-agent/src/bootstrap/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use super::BootstrapError;
use super::RssAccessError;
use crate::bootstrap::params::RackInitializeRequest;
use crate::bootstrap::rack_ops::{RackInitId, RackResetId};
use crate::storage_manager::StorageResources;
use crate::updates::ConfigUpdates;
use crate::updates::{Component, UpdateManager};
use bootstore::schemes::v0 as bootstore;
Expand All @@ -25,6 +24,7 @@ use omicron_common::api::external::Error;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use sled_hardware::Baseboard;
use sled_storage::manager::StorageHandle;
use slog::Logger;
use std::net::Ipv6Addr;
use tokio::sync::mpsc::error::TrySendError;
Expand All @@ -33,7 +33,7 @@ use tokio::sync::{mpsc, oneshot};
pub(crate) struct BootstrapServerContext {
pub(crate) base_log: Logger,
pub(crate) global_zone_bootstrap_ip: Ipv6Addr,
pub(crate) storage_resources: StorageResources,
pub(crate) storage_manager: StorageHandle,
pub(crate) bootstore_node_handle: bootstore::NodeHandle,
pub(crate) baseboard: Baseboard,
pub(crate) rss_access: RssAccess,
Expand All @@ -50,7 +50,7 @@ impl BootstrapServerContext {
self.rss_access.start_initializing(
&self.base_log,
self.global_zone_bootstrap_ip,
&self.storage_resources,
&self.storage_manager,
&self.bootstore_node_handle,
request,
)
Expand Down
12 changes: 6 additions & 6 deletions sled-agent/src/bootstrap/rack_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ use crate::bootstrap::http_entrypoints::RackOperationStatus;
use crate::bootstrap::params::RackInitializeRequest;
use crate::bootstrap::rss_handle::RssHandle;
use crate::rack_setup::service::SetupServiceError;
use crate::storage_manager::StorageResources;
use bootstore::schemes::v0 as bootstore;
use schemars::JsonSchema;
use serde::Deserialize;
use serde::Serialize;
use sled_storage::manager::StorageHandle;
use slog::Logger;
use std::mem;
use std::net::Ipv6Addr;
Expand Down Expand Up @@ -171,7 +171,7 @@ impl RssAccess {
&self,
parent_log: &Logger,
global_zone_bootstrap_ip: Ipv6Addr,
storage_resources: &StorageResources,
storage_manager: &StorageHandle,
bootstore_node_handle: &bootstore::NodeHandle,
request: RackInitializeRequest,
) -> Result<RackInitId, RssAccessError> {
Expand Down Expand Up @@ -207,14 +207,14 @@ impl RssAccess {
mem::drop(status);

let parent_log = parent_log.clone();
let storage_resources = storage_resources.clone();
let storage_manager = storage_manager.clone();
let bootstore_node_handle = bootstore_node_handle.clone();
let status = Arc::clone(&self.status);
tokio::spawn(async move {
let result = rack_initialize(
&parent_log,
global_zone_bootstrap_ip,
storage_resources,
storage_manager,
bootstore_node_handle,
request,
)
Expand Down Expand Up @@ -342,15 +342,15 @@ enum RssStatus {
async fn rack_initialize(
parent_log: &Logger,
global_zone_bootstrap_ip: Ipv6Addr,
storage_resources: StorageResources,
storage_manager: StorageHandle,
bootstore_node_handle: bootstore::NodeHandle,
request: RackInitializeRequest,
) -> Result<(), SetupServiceError> {
RssHandle::run_rss(
parent_log,
request,
global_zone_bootstrap_ip,
storage_resources,
storage_manager,
bootstore_node_handle,
)
.await
Expand Down
6 changes: 3 additions & 3 deletions sled-agent/src/bootstrap/rss_handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ use super::params::StartSledAgentRequest;
use crate::rack_setup::config::SetupServiceConfig;
use crate::rack_setup::service::RackSetupService;
use crate::rack_setup::service::SetupServiceError;
use crate::storage_manager::StorageResources;
use ::bootstrap_agent_client::Client as BootstrapAgentClient;
use bootstore::schemes::v0 as bootstore;
use futures::stream::FuturesUnordered;
use futures::StreamExt;
use omicron_common::backoff::retry_notify;
use omicron_common::backoff::retry_policy_local;
use omicron_common::backoff::BackoffError;
use sled_storage::manager::StorageHandle;
use slog::Logger;
use std::net::Ipv6Addr;
use std::net::SocketAddrV6;
Expand Down Expand Up @@ -46,15 +46,15 @@ impl RssHandle {
log: &Logger,
config: SetupServiceConfig,
our_bootstrap_address: Ipv6Addr,
storage_resources: StorageResources,
storage_manager: StorageHandle,
bootstore: bootstore::NodeHandle,
) -> Result<(), SetupServiceError> {
let (tx, rx) = rss_channel(our_bootstrap_address);

let rss = RackSetupService::new(
log.new(o!("component" => "RSS")),
config,
storage_resources,
storage_manager,
tx,
bootstore,
);
Expand Down
Loading

0 comments on commit 327578c

Please sign in to comment.