2929# Import grouped configurations
3030from .api import APIConfig
3131from .redis import RedisConfig
32- from .minio import MinIOConfig
32+ from .s3 import S3Config
3333from .security import SecurityConfig
3434from .resources import ResourcesConfig
3535from .logging import LoggingConfig
@@ -143,12 +143,13 @@ class Settings(BaseSettings):
143143 redis_socket_timeout : int = Field (default = 5 , ge = 1 )
144144 redis_socket_connect_timeout : int = Field (default = 5 , ge = 1 )
145145
146- # MinIO/S3 Configuration
147- minio_endpoint : str = Field (default = "localhost:9000" )
148- minio_access_key : str = Field (default = "test-access-key" , min_length = 3 )
149- minio_secret_key : str = Field (default = "test-secret-key" , min_length = 8 )
150- minio_secure : bool = Field (default = False )
151- minio_bucket : str = Field (default = "code-interpreter-files" )
146+ # S3 Storage Configuration
147+ s3_endpoint : str = Field (default = "localhost:3900" )
148+ s3_access_key : str = Field (default = "test-access-key" , min_length = 3 )
149+ s3_secret_key : str = Field (default = "test-secret-key" , min_length = 8 )
150+ s3_secure : bool = Field (default = False )
151+ s3_bucket : str = Field (default = "code-interpreter-files" )
152+ s3_region : str = Field (default = "garage" )
152153
153154 # Sandbox (nsjail) Configuration
154155 nsjail_binary : str = Field (
@@ -196,7 +197,7 @@ class Settings(BaseSettings):
196197 # Session Configuration
197198 session_ttl_hours : int = Field (default = 24 , ge = 1 , le = 168 )
198199 session_cleanup_interval_minutes : int = Field (default = 60 , ge = 1 , le = 1440 )
199- enable_orphan_minio_cleanup : bool = Field (default = True )
200+ enable_orphan_s3_cleanup : bool = Field (default = True )
200201
201202 # Sandbox Pool Configuration
202203 sandbox_pool_enabled : bool = Field (default = True )
@@ -250,24 +251,24 @@ class Settings(BaseSettings):
250251 default = 100 ,
251252 ge = 1 ,
252253 le = 500 ,
253- description = "Max state size (MB, raw bytes) for Redis storage. Larger states go directly to MinIO " ,
254+ description = "Max state size (MB, raw bytes) for Redis storage. Larger states go directly to S3 cold storage " ,
254255 )
255256
256- # State Archival Configuration - Hybrid Redis + MinIO storage
257+ # State Archival Configuration - Hybrid Redis + S3 storage
257258 state_archive_enabled : bool = Field (
258- default = True , description = "Enable archiving inactive states from Redis to MinIO "
259+ default = True , description = "Enable archiving inactive states from Redis to S3 "
259260 )
260261 state_archive_after_seconds : int = Field (
261262 default = 3600 ,
262263 ge = 300 ,
263264 le = 86400 ,
264- description = "Archive state to MinIO after this many seconds of inactivity. Default: 1 hour" ,
265+ description = "Archive state to S3 after this many seconds of inactivity. Default: 1 hour" ,
265266 )
266267 state_archive_ttl_days : int = Field (
267268 default = 1 ,
268269 ge = 1 ,
269270 le = 30 ,
270- description = "Keep archived states in MinIO for N days. Default: 1 (24 hours)" ,
271+ description = "Keep archived states in S3 for N days. Default: 1 (24 hours)" ,
271272 )
272273 state_archive_check_interval_seconds : int = Field (
273274 default = 300 ,
@@ -449,12 +450,12 @@ def parse_api_keys(cls, v):
449450 """Parse comma-separated API keys into a list."""
450451 return [key .strip () for key in v .split ("," ) if key .strip ()] if v else None
451452
452- @validator ("minio_endpoint " )
453- def validate_minio_endpoint (cls , v ):
454- """Ensure MinIO endpoint doesn't include protocol."""
453+ @validator ("s3_endpoint " )
454+ def validate_s3_endpoint (cls , v ):
455+ """Ensure S3 endpoint doesn't include protocol."""
455456 if v .startswith (("http://" , "https://" )):
456457 raise ValueError (
457- "MinIO endpoint should not include protocol (use minio_secure instead)"
458+ "S3 endpoint should not include protocol (use s3_secure instead)"
458459 )
459460 return v
460461
@@ -505,14 +506,15 @@ def redis(self) -> RedisConfig:
505506 )
506507
507508 @property
508- def minio (self ) -> MinIOConfig :
509- """Access MinIO configuration group."""
510- return MinIOConfig (
511- minio_endpoint = self .minio_endpoint ,
512- minio_access_key = self .minio_access_key ,
513- minio_secret_key = self .minio_secret_key ,
514- minio_secure = self .minio_secure ,
515- minio_bucket = self .minio_bucket ,
509+ def s3 (self ) -> S3Config :
510+ """Access S3 storage configuration group."""
511+ return S3Config (
512+ s3_endpoint = self .s3_endpoint ,
513+ s3_access_key = self .s3_access_key ,
514+ s3_secret_key = self .s3_secret_key ,
515+ s3_secure = self .s3_secure ,
516+ s3_bucket = self .s3_bucket ,
517+ s3_region = self .s3_region ,
516518 )
517519
518520 @property
@@ -539,7 +541,7 @@ def resources(self) -> ResourcesConfig:
539541 max_filename_length = self .max_filename_length ,
540542 session_ttl_hours = self .session_ttl_hours ,
541543 session_cleanup_interval_minutes = self .session_cleanup_interval_minutes ,
542- enable_orphan_minio_cleanup = self .enable_orphan_minio_cleanup ,
544+ enable_orphan_s3_cleanup = self .enable_orphan_s3_cleanup ,
543545 )
544546
545547 @property
@@ -612,7 +614,7 @@ def is_file_allowed(self, filename: str) -> bool:
612614 # Grouped configs
613615 "APIConfig" ,
614616 "RedisConfig" ,
615- "MinIOConfig " ,
617+ "S3Config " ,
616618 "SecurityConfig" ,
617619 "ResourcesConfig" ,
618620 "LoggingConfig" ,
0 commit comments