diff --git a/components/spider-storage/src/state/runtime.rs b/components/spider-storage/src/state/runtime.rs index bada722d0..53ad4c418 100644 --- a/components/spider-storage/src/state/runtime.rs +++ b/components/spider-storage/src/state/runtime.rs @@ -29,13 +29,13 @@ use crate::task_instance_pool::create_task_instance_pool; /// Runtime configuration for the storage service. #[derive(Clone, Debug, Deserialize)] pub struct RuntimeConfig { - pub db_config: DatabaseConfig, + pub db: DatabaseConfig, #[serde(default)] - pub ready_queue_config: ReadyQueueConfig, + pub ready_queue: ReadyQueueConfig, #[serde(default)] - pub task_instance_pool_config: TaskInstancePoolConfig, + pub task_instance_pool: TaskInstancePoolConfig, #[serde(default)] - pub job_cache_gc_config: JobCacheGcConfig, + pub job_cache_gc: JobCacheGcConfig, } /// Runtime state for the storage service. @@ -153,15 +153,15 @@ pub async fn create_runtime( StorageServerError, > { let cancellation_token = CancellationToken::new(); - let db = MariaDbStorageConnector::connect(&config.db_config).await?; + let db = MariaDbStorageConnector::connect(&config.db).await?; let session_id = db.session_id(); let (ready_queue_sender, ready_queue_receiver) = - create_ready_queue(&config.ready_queue_config).map_err(CacheError::from)?; + create_ready_queue(&config.ready_queue).map_err(CacheError::from)?; let (task_instance_pool_connector, task_instance_pool_join_handle) = create_task_instance_pool( ready_queue_sender.clone(), db.clone(), cancellation_token.clone(), - &config.task_instance_pool_config, + &config.task_instance_pool, ) .map_err(CacheError::from)?; @@ -174,7 +174,7 @@ pub async fn create_runtime( let (job_cache_gc_handle, job_cache_gc_join_handle) = create_job_cache_gc( job_cache.clone(), cancellation_token.clone(), - &config.job_cache_gc_config, + &config.job_cache_gc, ) .map_err(CacheError::from)?; let service_state = ServiceState::new(ServiceStateParams { diff --git a/components/spider-storage/tests/runtime_recovery_test.rs b/components/spider-storage/tests/runtime_recovery_test.rs index 012f0cee5..870c53ee2 100644 --- a/components/spider-storage/tests/runtime_recovery_test.rs +++ b/components/spider-storage/tests/runtime_recovery_test.rs @@ -201,10 +201,10 @@ async fn restarted_storage_cache_recovers_cleanup_ready_job() -> anyhow::Result< /// while other configurations set to default. fn create_runtime_config() -> RuntimeConfig { RuntimeConfig { - db_config: create_mariadb_config(), - ready_queue_config: ReadyQueueConfig::default(), - task_instance_pool_config: TaskInstancePoolConfig::default(), - job_cache_gc_config: JobCacheGcConfig::default(), + db: create_mariadb_config(), + ready_queue: ReadyQueueConfig::default(), + task_instance_pool: TaskInstancePoolConfig::default(), + job_cache_gc: JobCacheGcConfig::default(), } } diff --git a/tools/deployment/spider-helm/Chart.yaml b/tools/deployment/spider-helm/Chart.yaml index 5b15c1c84..4fa15b4e7 100644 --- a/tools/deployment/spider-helm/Chart.yaml +++ b/tools/deployment/spider-helm/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: "v2" name: "spider" description: "A Helm chart for the Spider Huntsman deployment" type: "application" -version: "0.1.9" +version: "0.1.10" appVersion: "0.1.0-dev" home: "https://github.com/y-scope/spider" sources: ["https://github.com/y-scope/spider"] diff --git a/tools/deployment/spider-helm/templates/configmap.yaml b/tools/deployment/spider-helm/templates/configmap.yaml index 4dfc7502c..7b3a38942 100644 --- a/tools/deployment/spider-helm/templates/configmap.yaml +++ b/tools/deployment/spider-helm/templates/configmap.yaml @@ -37,7 +37,7 @@ data: host: "0.0.0.0" port: {{ .Values.spiderConfig.storage.port }} runtime: - db_config: + db: host: {{ include "spider.databaseHost" . | quote }} max_connections: {{ .Values.spiderConfig.database.max_connections }} name: {{ .Values.spiderConfig.database.name | quote }} diff --git a/tools/deployment/spider-helm/values.yaml b/tools/deployment/spider-helm/values.yaml index 080e63673..086df268f 100644 --- a/tools/deployment/spider-helm/values.yaml +++ b/tools/deployment/spider-helm/values.yaml @@ -72,7 +72,7 @@ spiderConfig: log_level: "INFO" port: 50051 runtime: - ready_queue_config: + ready_queue: cleanup_capacity: 256 commit_capacity: 256 task_capacity: 1048576