66
77from dotenv import load_dotenv
88from eval_protocol .directory_utils import find_eval_protocol_dir
9- from eval_protocol .types .remote_rollout_processor import ElasticSearchConfig
9+ from eval_protocol .types .remote_rollout_processor import ElasticsearchConfig
1010from eval_protocol .logging .elasticsearch_index_manager import ElasticsearchIndexManager
1111
1212logger = logging .getLogger (__name__ )
@@ -24,15 +24,15 @@ class ElasticsearchSetup:
2424 def __init__ (self ):
2525 self .eval_protocol_dir = find_eval_protocol_dir ()
2626
27- def setup_elasticsearch (self , index_name : str = "default-logs" ) -> ElasticSearchConfig :
27+ def setup_elasticsearch (self , index_name : str = "default-logs" ) -> ElasticsearchConfig :
2828 """
2929 Set up Elasticsearch, handling both local and remote scenarios.
3030
3131 Args:
3232 index_name: Name of the Elasticsearch index to use for logging
3333
3434 Returns:
35- ElasticSearchConfig for the running instance with the specified index name.
35+ ElasticsearchConfig for the running instance with the specified index name.
3636 """
3737 elastic_start_local_dir = os .path .join (self .eval_protocol_dir , "elastic-start-local" )
3838 env_file_path = os .path .join (elastic_start_local_dir , ".env" )
@@ -48,11 +48,11 @@ def setup_elasticsearch(self, index_name: str = "default-logs") -> ElasticSearch
4848 self .create_logging_index (index_name )
4949
5050 # Return config with the specified index name
51- return ElasticSearchConfig (url = config .url , api_key = config .api_key , index_name = index_name )
51+ return ElasticsearchConfig (url = config .url , api_key = config .api_key , index_name = index_name )
5252
5353 def _setup_existing_docker_elasticsearch (
5454 self , elastic_start_local_dir : str , env_file_path : str
55- ) -> ElasticSearchConfig :
55+ ) -> ElasticsearchConfig :
5656 """Set up Elasticsearch using existing Docker start.sh script."""
5757 from eval_protocol .utils .subprocess_utils import run_script_and_wait
5858
@@ -63,7 +63,7 @@ def _setup_existing_docker_elasticsearch(
6363 )
6464 return self ._parse_elastic_env_file (env_file_path )
6565
66- def _setup_initialized_docker_elasticsearch (self , env_file_path : str ) -> ElasticSearchConfig :
66+ def _setup_initialized_docker_elasticsearch (self , env_file_path : str ) -> ElasticsearchConfig :
6767 """Set up Elasticsearch by initializing Docker setup from scratch with retry logic."""
6868 max_retries = 2
6969 for attempt in range (max_retries ):
@@ -126,7 +126,7 @@ def _handle_existing_elasticsearch_container(self, output: str) -> bool:
126126 return False
127127 return False
128128
129- def _parse_elastic_env_file (self , env_file_path : str ) -> ElasticSearchConfig :
129+ def _parse_elastic_env_file (self , env_file_path : str ) -> ElasticsearchConfig :
130130 """Parse ES_LOCAL_API_KEY and ES_LOCAL_URL from .env file."""
131131 loaded = load_dotenv (env_file_path )
132132 if not loaded :
@@ -138,7 +138,7 @@ def _parse_elastic_env_file(self, env_file_path: str) -> ElasticSearchConfig:
138138 if not url or not api_key :
139139 raise ElasticsearchSetupError ("Failed to parse ES_LOCAL_API_KEY and ES_LOCAL_URL from .env file" )
140140
141- return ElasticSearchConfig (url = url , api_key = api_key , index_name = "default-logs" )
141+ return ElasticsearchConfig (url = url , api_key = api_key , index_name = "default-logs" )
142142
143143 def create_logging_index (self , index_name : str ) -> bool :
144144 """Create an Elasticsearch index with proper mapping for logging data.
0 commit comments