4545 scale_up_delay = Duration .from_seconds (60 ).to_proto (),
4646 scale_down_delay = Duration .from_seconds (300 ).to_proto (),
4747 ),
48- bootstrap = config_pb2 .BootstrapConfig (
49- worker_port = 10001 ,
48+ worker = config_pb2 .WorkerConfig (
49+ port = 10001 ,
5050 cache_dir = "/var/cache/iris" ,
51+ host = "0.0.0.0" ,
52+ port_range = "30000-40000" ,
5153 ),
5254)
5355
@@ -248,33 +250,31 @@ def validate_config(config: config_pb2.IrisClusterConfig) -> None:
248250 _validate_scale_group_resources (config )
249251 _validate_slice_templates (config )
250252 _validate_worker_settings (config )
251- _validate_bootstrap_defaults (config )
253+ _validate_worker_defaults (config )
252254
253255
254- def _validate_bootstrap_defaults (config : config_pb2 .IrisClusterConfig ) -> None :
255- """Validate bootstrap defaults required for worker-based platforms.
256+ def _validate_worker_defaults (config : config_pb2 .IrisClusterConfig ) -> None :
257+ """Validate worker defaults required for worker-based platforms.
256258
257- Local platform runs workers in-process and does not require bootstrap image/runtime.
259+ Local platform runs workers in-process and does not require a docker image/runtime.
258260 GCP/manual/CoreWeave create remote worker processes and must provide a worker image.
259261 """
260262 # Some unit tests validate partial proto configs directly (without load_config/apply_defaults).
261- # Only enforce bootstrap image checks once defaults/platform are explicitly present.
263+ # Only enforce worker image checks once defaults/platform are explicitly present.
262264 if not config .HasField ("defaults" ):
263265 return
264266
265267 platform_kind = config .platform .WhichOneof ("platform" )
266268 if platform_kind in (None , "local" ):
267269 return
268270
269- docker_image = config .defaults .bootstrap .docker_image .strip ()
271+ docker_image = config .defaults .worker .docker_image .strip ()
270272 if not docker_image :
271- raise ValueError (
272- "defaults.bootstrap.docker_image is required for non-local platforms " "(gcp/manual/coreweave)."
273- )
273+ raise ValueError ("defaults.worker.docker_image is required for non-local platforms (gcp/manual/coreweave)." )
274274
275- runtime = config .defaults .bootstrap .runtime .strip ()
275+ runtime = config .defaults .worker .runtime .strip ()
276276 if runtime and runtime not in {"docker" , "kubernetes" }:
277- raise ValueError (f"defaults.bootstrap .runtime must be one of docker/kubernetes, got { runtime !r} ." )
277+ raise ValueError (f"defaults.worker .runtime must be one of docker/kubernetes, got { runtime !r} ." )
278278
279279
280280def _scale_groups_to_config (scale_groups : dict [str , config_pb2 .ScaleGroupConfig ]) -> config_pb2 .IrisClusterConfig :
@@ -326,16 +326,16 @@ def _merge_proto_fields(target, source) -> None:
326326def _deep_merge_defaults (target : config_pb2 .DefaultsConfig , source : config_pb2 .DefaultsConfig ) -> None :
327327 """Deep merge source defaults into target, field by field.
328328
329- Sub-messages (timeouts, ssh, autoscaler, bootstrap ) are merged field-by-field
329+ Sub-messages (timeouts, ssh, autoscaler, worker ) are merged field-by-field
330330 so that partially-specified user configs overlay hardcoded defaults without
331- wiping unset siblings. Top-level scalar fields (e.g. default_task_image) are
332- merged via _merge_proto_fields which copies any explicitly-set value.
331+ wiping unset siblings. Top-level scalar fields are merged via
332+ _merge_proto_fields which copies any explicitly-set value.
333333
334334 Args:
335335 target: DefaultsConfig to merge into (modified in place)
336336 source: DefaultsConfig to merge from
337337 """
338- # Merge top-level scalar fields (e.g. default_task_image) .
338+ # Merge top-level scalar fields.
339339 # We skip message fields here since sub-messages need deep merging below.
340340 for field_desc in source .DESCRIPTOR .fields :
341341 if field_desc .message_type is not None :
@@ -348,11 +348,13 @@ def _deep_merge_defaults(target: config_pb2.DefaultsConfig, source: config_pb2.D
348348 _merge_proto_fields (target .ssh , source .ssh )
349349 if source .HasField ("autoscaler" ):
350350 _merge_proto_fields (target .autoscaler , source .autoscaler )
351- if source .HasField ("bootstrap" ):
352- _merge_proto_fields (target .bootstrap , source .bootstrap )
353- # Merge env_vars map separately (map fields don't use HasField)
354- for key , value in source .bootstrap .env_vars .items ():
355- target .bootstrap .env_vars [key ] = value
351+ if source .HasField ("worker" ):
352+ _merge_proto_fields (target .worker , source .worker )
353+ # Merge map fields separately (map fields don't support HasField)
354+ for key , value in source .worker .default_task_env .items ():
355+ target .worker .default_task_env [key ] = value
356+ for key , value in source .worker .worker_attributes .items ():
357+ target .worker .worker_attributes [key ] = value
356358
357359
358360def _validate_autoscaler_config (config : config_pb2 .AutoscalerConfig , context : str = "autoscaler" ) -> None :
@@ -619,12 +621,10 @@ def load_config(config_path: Path | str) -> config_pb2.IrisClusterConfig:
619621 # Expand environment variables in controller_address only.
620622 # Other fields (e.g., docker_image, ssh.key_file) are used as-is.
621623 # This is intentional - controller_address often needs $IRIS_CONTROLLER_ADDRESS for dynamic discovery.
622- if "bootstrap" in data and "controller_address" in data ["bootstrap" ]:
623- data ["bootstrap" ]["controller_address" ] = os .path .expandvars (data ["bootstrap" ]["controller_address" ])
624- if "defaults" in data and "bootstrap" in data ["defaults" ]:
625- defaults_bootstrap = data ["defaults" ]["bootstrap" ]
626- if "controller_address" in defaults_bootstrap :
627- defaults_bootstrap ["controller_address" ] = os .path .expandvars (defaults_bootstrap ["controller_address" ])
624+ if "defaults" in data and "worker" in data ["defaults" ]:
625+ defaults_worker = data ["defaults" ]["worker" ]
626+ if "controller_address" in defaults_worker :
627+ defaults_worker ["controller_address" ] = os .path .expandvars (defaults_worker ["controller_address" ])
628628
629629 _normalize_scale_group_resources (data )
630630 _expand_multi_zone_groups (data )
@@ -898,15 +898,15 @@ def as_local(self) -> IrisConfig:
898898 return IrisConfig (local_proto )
899899
900900 def controller_address (self ) -> str :
901- """Get controller address from bootstrap config, if set.
901+ """Get controller address from worker config, if set.
902902
903903 Returns:
904904 Controller address string, or empty string if not configured
905905 """
906906 # TODO: Derive controller address from controller.manual/local when unset.
907- bootstrap = self ._proto .defaults .bootstrap
908- if bootstrap .HasField ("controller_address" ):
909- return bootstrap .controller_address
907+ worker = self ._proto .defaults .worker
908+ if worker .HasField ("controller_address" ):
909+ return worker .controller_address
910910 return ""
911911
912912
@@ -915,7 +915,7 @@ def create_autoscaler(
915915 autoscaler_config : config_pb2 .AutoscalerConfig ,
916916 scale_groups : dict [str , config_pb2 .ScaleGroupConfig ],
917917 label_prefix : str ,
918- bootstrap_config : config_pb2 .BootstrapConfig | None = None ,
918+ base_worker_config : config_pb2 .WorkerConfig | None = None ,
919919 threads : ThreadContainer | None = None ,
920920):
921921 """Create autoscaler from Platform and explicit config.
@@ -925,7 +925,7 @@ def create_autoscaler(
925925 autoscaler_config: Autoscaler settings (already resolved with defaults)
926926 scale_groups: Map of scale group name to config
927927 label_prefix: Prefix for labels on managed resources
928- bootstrap_config: Worker bootstrap settings passed through to platform.create_slice().
928+ base_worker_config: Base worker configuration passed through to platform.create_slice().
929929 None disables bootstrap (test/local mode).
930930 threads: Thread container for background threads. Uses global default if not provided.
931931
@@ -975,5 +975,5 @@ def create_autoscaler(
975975 scale_groups = scaling_groups ,
976976 config = autoscaler_config ,
977977 platform = platform ,
978- bootstrap_config = bootstrap_config ,
978+ base_worker_config = base_worker_config ,
979979 )
0 commit comments