refactor: remove crate re-export aliases from lib.rs (#18737)
This commit is contained in:
@@ -1,18 +1,15 @@
|
||||
use std::{sync::Arc, time::Duration};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use smg_mcp::{config::McpServerConfig, manager::McpManager};
|
||||
use tracing::{debug, error, info, warn};
|
||||
use wfaas::{
|
||||
BackoffStrategy, FailureAction, RetryPolicy, StepDefinition, StepExecutor, StepId, StepResult,
|
||||
WorkflowContext, WorkflowDefinition, WorkflowError, WorkflowResult,
|
||||
};
|
||||
|
||||
use super::workflow_data::McpWorkflowData;
|
||||
use crate::{
|
||||
app_context::AppContext,
|
||||
mcp::{config::McpServerConfig, manager::McpManager},
|
||||
observability::metrics::Metrics,
|
||||
workflow::{
|
||||
BackoffStrategy, FailureAction, RetryPolicy, StepDefinition, StepExecutor, StepId,
|
||||
StepResult, WorkflowContext, WorkflowDefinition, WorkflowError, WorkflowResult,
|
||||
},
|
||||
};
|
||||
use crate::{app_context::AppContext, observability::metrics::Metrics};
|
||||
|
||||
/// MCP server connection configuration
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
|
||||
@@ -12,6 +12,10 @@ use std::{sync::Arc, time::Duration};
|
||||
use async_trait::async_trait;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tracing::{error, info};
|
||||
use wfaas::{
|
||||
BackoffStrategy, FailureAction, RetryPolicy, StepDefinition, StepExecutor, StepId, StepResult,
|
||||
WorkflowContext, WorkflowDefinition, WorkflowError, WorkflowResult,
|
||||
};
|
||||
|
||||
use super::workflow_data::TokenizerWorkflowData;
|
||||
use crate::{
|
||||
@@ -23,10 +27,6 @@ use crate::{
|
||||
registry::LoadOutcome,
|
||||
traits::Tokenizer,
|
||||
},
|
||||
workflow::{
|
||||
BackoffStrategy, FailureAction, RetryPolicy, StepDefinition, StepExecutor, StepId,
|
||||
StepResult, WorkflowContext, WorkflowDefinition, WorkflowError, WorkflowResult,
|
||||
},
|
||||
};
|
||||
|
||||
/// Configuration for adding a tokenizer
|
||||
|
||||
@@ -9,15 +9,15 @@ use sha2::{Digest, Sha256};
|
||||
use tracing::{debug, info, warn};
|
||||
use uuid::Uuid;
|
||||
use wasmtime::{component::Component, Config, Engine};
|
||||
use wfaas::{
|
||||
BackoffStrategy, FailureAction, RetryPolicy, StepDefinition, StepExecutor, StepId, StepResult,
|
||||
WorkflowContext, WorkflowDefinition, WorkflowError, WorkflowResult,
|
||||
};
|
||||
|
||||
use super::workflow_data::WasmRegistrationWorkflowData;
|
||||
use crate::{
|
||||
app_context::AppContext,
|
||||
wasm::module::{WasmModule, WasmModuleDescriptor, WasmModuleMeta},
|
||||
workflow::{
|
||||
BackoffStrategy, FailureAction, RetryPolicy, StepDefinition, StepExecutor, StepId,
|
||||
StepResult, WorkflowContext, WorkflowDefinition, WorkflowError, WorkflowResult,
|
||||
},
|
||||
};
|
||||
|
||||
/// WASM module registration request
|
||||
|
||||
@@ -3,15 +3,13 @@ use std::{sync::Arc, time::Duration};
|
||||
use async_trait::async_trait;
|
||||
use tracing::{debug, info};
|
||||
use uuid::Uuid;
|
||||
use wfaas::{
|
||||
FailureAction, StepDefinition, StepExecutor, StepId, StepResult, WorkflowContext,
|
||||
WorkflowDefinition, WorkflowError, WorkflowResult,
|
||||
};
|
||||
|
||||
use super::workflow_data::WasmRemovalWorkflowData;
|
||||
use crate::{
|
||||
app_context::AppContext,
|
||||
workflow::{
|
||||
FailureAction, StepDefinition, StepExecutor, StepId, StepResult, WorkflowContext,
|
||||
WorkflowDefinition, WorkflowError, WorkflowResult,
|
||||
},
|
||||
};
|
||||
use crate::app_context::AppContext;
|
||||
|
||||
/// WASM module removal request
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
|
||||
@@ -4,15 +4,13 @@ use std::{collections::HashMap, sync::Arc, time::Duration};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use tracing::{debug, info};
|
||||
use wfaas::{StepExecutor, StepResult, WorkflowContext, WorkflowError, WorkflowResult};
|
||||
|
||||
use crate::{
|
||||
core::{
|
||||
circuit_breaker::CircuitBreakerConfig,
|
||||
steps::workflow_data::{ExternalWorkerWorkflowData, WorkerList},
|
||||
worker::{HealthConfig, RuntimeType, WorkerType},
|
||||
BasicWorkerBuilder, ConnectionMode, Worker,
|
||||
},
|
||||
workflow::{StepExecutor, StepResult, WorkflowContext, WorkflowError, WorkflowResult},
|
||||
use crate::core::{
|
||||
circuit_breaker::CircuitBreakerConfig,
|
||||
steps::workflow_data::{ExternalWorkerWorkflowData, WorkerList},
|
||||
worker::{HealthConfig, RuntimeType, WorkerType},
|
||||
BasicWorkerBuilder, ConnectionMode, Worker,
|
||||
};
|
||||
|
||||
/// Normalize URL for external APIs (ensure https://).
|
||||
|
||||
@@ -8,14 +8,12 @@ use regex::Regex;
|
||||
use reqwest::Client;
|
||||
use serde::Deserialize;
|
||||
use tracing::{debug, info};
|
||||
use wfaas::{StepExecutor, StepId, StepResult, WorkflowContext, WorkflowError, WorkflowResult};
|
||||
|
||||
use crate::{
|
||||
core::{
|
||||
model_card::{ModelCard, ProviderType},
|
||||
model_type::ModelType,
|
||||
steps::workflow_data::ExternalWorkerWorkflowData,
|
||||
},
|
||||
workflow::{StepExecutor, StepId, StepResult, WorkflowContext, WorkflowError, WorkflowResult},
|
||||
use crate::core::{
|
||||
model_card::{ModelCard, ProviderType},
|
||||
model_type::ModelType,
|
||||
steps::workflow_data::ExternalWorkerWorkflowData,
|
||||
};
|
||||
|
||||
// HTTP client for API calls
|
||||
|
||||
+2
-3
@@ -13,13 +13,12 @@ pub use discover_models::{
|
||||
group_models_into_cards, infer_model_type_from_id, DiscoverModelsStep, ModelInfo,
|
||||
ModelsResponse,
|
||||
};
|
||||
use wfaas::{BackoffStrategy, FailureAction, RetryPolicy, StepDefinition, WorkflowDefinition};
|
||||
|
||||
use super::shared::{ActivateWorkersStep, RegisterWorkersStep, UpdatePoliciesStep};
|
||||
use crate::{
|
||||
app_context::AppContext,
|
||||
core::steps::workflow_data::ExternalWorkerWorkflowData,
|
||||
app_context::AppContext, core::steps::workflow_data::ExternalWorkerWorkflowData,
|
||||
protocols::worker_spec::WorkerConfigRequest,
|
||||
workflow::{BackoffStrategy, FailureAction, RetryPolicy, StepDefinition, WorkflowDefinition},
|
||||
};
|
||||
|
||||
/// Create external worker registration workflow definition.
|
||||
|
||||
@@ -4,6 +4,7 @@ use std::{collections::HashMap, sync::Arc, time::Duration};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use tracing::debug;
|
||||
use wfaas::{StepExecutor, StepId, StepResult, WorkflowContext, WorkflowError, WorkflowResult};
|
||||
|
||||
use crate::{
|
||||
app_context::AppContext,
|
||||
@@ -15,7 +16,6 @@ use crate::{
|
||||
BasicWorkerBuilder, ConnectionMode, DPAwareWorkerBuilder, Worker, UNKNOWN_MODEL_ID,
|
||||
},
|
||||
protocols::worker_spec::WorkerConfigRequest,
|
||||
workflow::{StepExecutor, StepId, StepResult, WorkflowContext, WorkflowError, WorkflowResult},
|
||||
};
|
||||
|
||||
/// Step 3: Create worker object(s) with merged configuration + metadata.
|
||||
|
||||
@@ -5,12 +5,12 @@ use std::time::Duration;
|
||||
use async_trait::async_trait;
|
||||
use reqwest::Client;
|
||||
use tracing::debug;
|
||||
use wfaas::{StepExecutor, StepId, StepResult, WorkflowContext, WorkflowError, WorkflowResult};
|
||||
|
||||
use super::strip_protocol;
|
||||
use crate::{
|
||||
core::{steps::workflow_data::LocalWorkerWorkflowData, ConnectionMode},
|
||||
routers::grpc::client::GrpcClient,
|
||||
workflow::{StepExecutor, StepId, StepResult, WorkflowContext, WorkflowError, WorkflowResult},
|
||||
};
|
||||
|
||||
/// Try HTTP health check.
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
|
||||
use async_trait::async_trait;
|
||||
use tracing::debug;
|
||||
use wfaas::{StepExecutor, StepId, StepResult, WorkflowContext, WorkflowError, WorkflowResult};
|
||||
|
||||
use super::discover_metadata::get_server_info;
|
||||
use crate::{
|
||||
core::{steps::workflow_data::LocalWorkerWorkflowData, UNKNOWN_MODEL_ID},
|
||||
workflow::{StepExecutor, StepId, StepResult, WorkflowContext, WorkflowError, WorkflowResult},
|
||||
};
|
||||
use crate::core::{steps::workflow_data::LocalWorkerWorkflowData, UNKNOWN_MODEL_ID};
|
||||
|
||||
/// DP (Data Parallel) information for a worker.
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
|
||||
@@ -8,12 +8,12 @@ use reqwest::Client;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::Value;
|
||||
use tracing::{debug, warn};
|
||||
use wfaas::{StepExecutor, StepResult, WorkflowContext, WorkflowError, WorkflowResult};
|
||||
|
||||
use super::strip_protocol;
|
||||
use crate::{
|
||||
core::{steps::workflow_data::LocalWorkerWorkflowData, ConnectionMode},
|
||||
routers::grpc::client::GrpcClient,
|
||||
workflow::{StepExecutor, StepResult, WorkflowContext, WorkflowError, WorkflowResult},
|
||||
};
|
||||
|
||||
// HTTP client for metadata fetching
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
|
||||
use async_trait::async_trait;
|
||||
use tracing::debug;
|
||||
use wfaas::{StepExecutor, StepId, StepResult, WorkflowContext, WorkflowError, WorkflowResult};
|
||||
|
||||
use super::find_workers_by_url;
|
||||
use crate::{
|
||||
core::steps::workflow_data::WorkerUpdateWorkflowData,
|
||||
workflow::{StepExecutor, StepId, StepResult, WorkflowContext, WorkflowError, WorkflowResult},
|
||||
};
|
||||
use crate::core::steps::workflow_data::WorkerUpdateWorkflowData;
|
||||
|
||||
/// Step to find workers to update based on URL.
|
||||
///
|
||||
|
||||
@@ -4,12 +4,10 @@ use std::collections::HashSet;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use tracing::debug;
|
||||
use wfaas::{StepExecutor, StepId, StepResult, WorkflowContext, WorkflowError, WorkflowResult};
|
||||
|
||||
use super::find_workers_by_url;
|
||||
use crate::{
|
||||
core::steps::workflow_data::{WorkerList, WorkerRemovalWorkflowData},
|
||||
workflow::{StepExecutor, StepId, StepResult, WorkflowContext, WorkflowError, WorkflowResult},
|
||||
};
|
||||
use crate::core::steps::workflow_data::{WorkerList, WorkerRemovalWorkflowData};
|
||||
|
||||
/// Request structure for worker removal.
|
||||
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
|
||||
|
||||
@@ -33,6 +33,7 @@ pub use submit_tokenizer_job::SubmitTokenizerJobStep;
|
||||
pub use update_policies_for_worker::UpdatePoliciesForWorkerStep;
|
||||
pub use update_remaining_policies::UpdateRemainingPoliciesStep;
|
||||
pub use update_worker_properties::UpdateWorkerPropertiesStep;
|
||||
use wfaas::{BackoffStrategy, FailureAction, RetryPolicy, StepDefinition, WorkflowDefinition};
|
||||
|
||||
use super::shared::{ActivateWorkersStep, RegisterWorkersStep, UpdatePoliciesStep};
|
||||
use crate::{
|
||||
@@ -45,7 +46,6 @@ use crate::{
|
||||
Worker, WorkerRegistry,
|
||||
},
|
||||
protocols::worker_spec::{WorkerConfigRequest, WorkerUpdateRequest},
|
||||
workflow::{BackoffStrategy, FailureAction, RetryPolicy, StepDefinition, WorkflowDefinition},
|
||||
};
|
||||
|
||||
/// Find workers by URL, supporting both DP-aware (prefix match) and regular (exact match) modes.
|
||||
|
||||
@@ -2,11 +2,9 @@
|
||||
|
||||
use async_trait::async_trait;
|
||||
use tracing::debug;
|
||||
use wfaas::{StepExecutor, StepResult, WorkflowContext, WorkflowError, WorkflowResult};
|
||||
|
||||
use crate::{
|
||||
core::steps::workflow_data::WorkerRemovalWorkflowData,
|
||||
workflow::{StepExecutor, StepResult, WorkflowContext, WorkflowError, WorkflowResult},
|
||||
};
|
||||
use crate::core::steps::workflow_data::WorkerRemovalWorkflowData;
|
||||
|
||||
/// Step to remove workers from the policy registry.
|
||||
///
|
||||
|
||||
@@ -4,11 +4,10 @@ use std::collections::HashSet;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use tracing::{debug, warn};
|
||||
use wfaas::{StepExecutor, StepResult, WorkflowContext, WorkflowError, WorkflowResult};
|
||||
|
||||
use crate::{
|
||||
core::steps::workflow_data::WorkerRemovalWorkflowData,
|
||||
observability::metrics::Metrics,
|
||||
workflow::{StepExecutor, StepResult, WorkflowContext, WorkflowError, WorkflowResult},
|
||||
core::steps::workflow_data::WorkerRemovalWorkflowData, observability::metrics::Metrics,
|
||||
};
|
||||
|
||||
/// Step to remove workers from the worker registry.
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
use async_trait::async_trait;
|
||||
use tracing::{debug, info, warn};
|
||||
use wfaas::{StepExecutor, StepResult, WorkflowContext, WorkflowError, WorkflowResult};
|
||||
|
||||
use crate::{
|
||||
core::{
|
||||
@@ -13,7 +14,6 @@ use crate::{
|
||||
Job,
|
||||
},
|
||||
tokenizer::TokenizerRegistry,
|
||||
workflow::{StepExecutor, StepResult, WorkflowContext, WorkflowError, WorkflowResult},
|
||||
};
|
||||
|
||||
/// Step: Submit tokenizer registration job for the worker's model
|
||||
|
||||
@@ -4,11 +4,9 @@ use std::collections::HashSet;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use tracing::debug;
|
||||
use wfaas::{StepExecutor, StepResult, WorkflowContext, WorkflowError, WorkflowResult};
|
||||
|
||||
use crate::{
|
||||
core::steps::workflow_data::WorkerUpdateWorkflowData,
|
||||
workflow::{StepExecutor, StepResult, WorkflowContext, WorkflowError, WorkflowResult},
|
||||
};
|
||||
use crate::core::steps::workflow_data::WorkerUpdateWorkflowData;
|
||||
|
||||
/// Step to update policies for updated workers.
|
||||
///
|
||||
|
||||
@@ -2,11 +2,9 @@
|
||||
|
||||
use async_trait::async_trait;
|
||||
use tracing::{debug, info};
|
||||
use wfaas::{StepExecutor, StepResult, WorkflowContext, WorkflowError, WorkflowResult};
|
||||
|
||||
use crate::{
|
||||
core::steps::workflow_data::WorkerRemovalWorkflowData,
|
||||
workflow::{StepExecutor, StepResult, WorkflowContext, WorkflowError, WorkflowResult},
|
||||
};
|
||||
use crate::core::steps::workflow_data::WorkerRemovalWorkflowData;
|
||||
|
||||
/// Step to update cache-aware policies for remaining workers.
|
||||
///
|
||||
|
||||
@@ -4,12 +4,10 @@ use std::sync::Arc;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use tracing::{debug, info};
|
||||
use wfaas::{StepExecutor, StepResult, WorkflowContext, WorkflowError, WorkflowResult};
|
||||
|
||||
use crate::{
|
||||
core::{
|
||||
steps::workflow_data::WorkerUpdateWorkflowData, BasicWorkerBuilder, HealthConfig, Worker,
|
||||
},
|
||||
workflow::{StepExecutor, StepResult, WorkflowContext, WorkflowError, WorkflowResult},
|
||||
use crate::core::{
|
||||
steps::workflow_data::WorkerUpdateWorkflowData, BasicWorkerBuilder, HealthConfig, Worker,
|
||||
};
|
||||
|
||||
/// Step to update worker properties.
|
||||
|
||||
@@ -2,14 +2,12 @@
|
||||
|
||||
use async_trait::async_trait;
|
||||
use tracing::info;
|
||||
|
||||
use crate::{
|
||||
core::steps::workflow_data::WorkerRegistrationData,
|
||||
workflow::{
|
||||
StepExecutor, StepResult, WorkflowContext, WorkflowData, WorkflowError, WorkflowResult,
|
||||
},
|
||||
use wfaas::{
|
||||
StepExecutor, StepResult, WorkflowContext, WorkflowData, WorkflowError, WorkflowResult,
|
||||
};
|
||||
|
||||
use crate::core::steps::workflow_data::WorkerRegistrationData;
|
||||
|
||||
/// Unified step to activate workers by marking them as healthy.
|
||||
///
|
||||
/// This is the final step in any worker registration workflow.
|
||||
|
||||
@@ -4,15 +4,12 @@ use std::{collections::HashSet, sync::Arc};
|
||||
|
||||
use async_trait::async_trait;
|
||||
use tracing::debug;
|
||||
|
||||
use crate::{
|
||||
core::steps::workflow_data::WorkerRegistrationData,
|
||||
observability::metrics::Metrics,
|
||||
workflow::{
|
||||
StepExecutor, StepResult, WorkflowContext, WorkflowData, WorkflowError, WorkflowResult,
|
||||
},
|
||||
use wfaas::{
|
||||
StepExecutor, StepResult, WorkflowContext, WorkflowData, WorkflowError, WorkflowResult,
|
||||
};
|
||||
|
||||
use crate::{core::steps::workflow_data::WorkerRegistrationData, observability::metrics::Metrics};
|
||||
|
||||
/// Unified step to register workers in the registry.
|
||||
///
|
||||
/// Works with both single workers and batches. Always expects `workers` key
|
||||
|
||||
@@ -4,14 +4,12 @@ use std::sync::Arc;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use tracing::{debug, warn};
|
||||
|
||||
use crate::{
|
||||
core::{steps::workflow_data::WorkerRegistrationData, Worker},
|
||||
workflow::{
|
||||
StepExecutor, StepResult, WorkflowContext, WorkflowData, WorkflowError, WorkflowResult,
|
||||
},
|
||||
use wfaas::{
|
||||
StepExecutor, StepResult, WorkflowContext, WorkflowData, WorkflowError, WorkflowResult,
|
||||
};
|
||||
|
||||
use crate::core::{steps::workflow_data::WorkerRegistrationData, Worker};
|
||||
|
||||
/// Unified step to update policy registry for registered workers.
|
||||
///
|
||||
/// Handles both local workers (same model, possibly DP-aware) and
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use wfaas::{WorkflowData, WorkflowError};
|
||||
|
||||
use super::{
|
||||
mcp_registration::McpServerConfigRequest, tokenizer_registration::TokenizerConfigRequest,
|
||||
@@ -30,7 +31,6 @@ use crate::{
|
||||
WorkerConfigRequest as ProtocolWorkerConfigRequest,
|
||||
WorkerUpdateRequest as ProtocolWorkerUpdateRequest,
|
||||
},
|
||||
workflow::{WorkflowData, WorkflowError},
|
||||
};
|
||||
|
||||
// ============================================================================
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use wfaas::{EventSubscriber, InMemoryStore, WorkflowEngine};
|
||||
|
||||
use super::{
|
||||
create_external_worker_workflow, create_local_worker_workflow,
|
||||
create_mcp_registration_workflow, create_tokenizer_registration_workflow,
|
||||
@@ -13,10 +15,7 @@ use super::{
|
||||
LocalWorkerWorkflowData, McpWorkflowData, TokenizerWorkflowData, WasmRegistrationWorkflowData,
|
||||
WasmRemovalWorkflowData, WorkerRemovalWorkflowData, WorkerUpdateWorkflowData,
|
||||
};
|
||||
use crate::{
|
||||
config::RouterConfig,
|
||||
workflow::{EventSubscriber, InMemoryStore, WorkflowEngine},
|
||||
};
|
||||
use crate::config::RouterConfig;
|
||||
|
||||
/// Type alias for local worker workflow engine
|
||||
pub type LocalWorkerEngine =
|
||||
|
||||
Reference in New Issue
Block a user