@@ -377,7 +377,8 @@ def generate_bake_dict(
377377 extra_build_args = None ,
378378 nvcr_tag = False ,
379379 s3_cache_config = None ,
380- use_kubernetes_driver = False
380+ use_kubernetes_driver = False ,
381+ isaac_ros_platform = None
381382 ):
382383 """
383384 Generate a dictionary representing the docker buildx bake configuration.
@@ -391,12 +392,16 @@ def generate_bake_dict(
391392 :param extra_build_args: Dictionary of additional build args.
392393 :param s3_cache_config: Dictionary containing s3 cache configuration.
393394 :param use_kubernetes_driver: Boolean indicating if kubernetes driver is used.
395+ :param isaac_ros_platform: Isaac ROS platform identifier
396+ (e.g. 'amd64', 'arm64-jetpack', 'arm64-fastos').
397+ Defaults to file_arch for backward compatibility.
394398 """
395399 build_plan = {}
396- nvcr_url = "nvcr.io/nvidian /isaac-ros /ros"
400+ nvcr_url = "nvcr.io/nvidia /isaac/ros"
397401 dockerfile_list = self .dockerfiles_
398402 file_arch = 'arm64' if arch == 'aarch64' else 'amd64'
399- platform = file_arch # Use file_arch directly
403+ if isaac_ros_platform is None :
404+ isaac_ros_platform = file_arch # backward compat
400405 variables = dict (self .build_variables_ )
401406 variables .update ({
402407 'ARCH' : arch ,
@@ -429,13 +434,25 @@ def get_target(dockerfiles: List[Dockerfile]):
429434
430435 build_plan ['targets' ] = {}
431436 targets = build_plan ['targets' ]
437+ # Derive the distro suffix from the platform identifier to pre-source
438+ # the appropriate apt repository.
439+ _DISTRO_SUFFIX = {
440+ 'amd64' : '' ,
441+ 'arm64-jetpack' : '-jetpack' ,
442+ 'arm64-fastos' : '-fastos' ,
443+ }
444+ distro_suffix = _DISTRO_SUFFIX .get (isaac_ros_platform , '' )
445+
432446 for i , target in enumerate (dockerfile_list ):
433447 target_name = get_target (dockerfile_list [:i + 1 ])
434448 targets [target_name ] = {'name' : target_name }
435449 target_dict = targets [target_name ]
436450 target_dict ['context' ] = str (target .context_dir_ )
437451 target_dict ['dockerfile' ] = target .dockerfile_path_
438- target_dict ['args' ] = {'PLATFORM' : file_arch }
452+ target_dict ['args' ] = {
453+ 'PLATFORM' : file_arch ,
454+ 'ISAAC_DEBIAN_DISTRO_SUFFIX' : distro_suffix ,
455+ }
439456
440457 if use_s3_cache :
441458 bucket = s3_cache_config .get ('bucket' )
@@ -461,24 +478,26 @@ def get_target(dockerfiles: List[Dockerfile]):
461478 if i == 0 :
462479 # First target – set (if provided) BASE_IMAGE.
463480 target_dict ['tags' ] = [
464- f"{ cache_from_registry } /{ target_name } -{ platform } :latest"
481+ f"{ cache_from_registry } /{ target_name } -{ isaac_ros_platform } :latest"
465482 ]
466483 if base_image is not None :
467484 target_dict ['args' ]['BASE_IMAGE' ] = base_image
468485 else :
469486 depends_name = ImageBuildPlan (dockerfile_list [:i ]).target_name ()
470487 target_dict ['tags' ] = [
471- f"{ cache_from_registry } /{ target_name } -{ platform } :latest"
488+ f"{ cache_from_registry } /{ target_name } -{ isaac_ros_platform } :latest"
472489 ]
473490
474491 target_dict ['args' ].update ({
475492 'BASE_IMAGE' : (
476- f"{ cache_from_registry } /{ depends_name } -{ platform } :latest"
493+ f"{ cache_from_registry } /{ depends_name } -{ isaac_ros_platform } :latest"
477494 )
478495 })
479496 target_dict ['depends_on' ] = [f"{ get_target (dockerfile_list [:i ])} " ]
480497 if nvcr_tag :
481- target_dict ['tags' ].append (f"{ nvcr_url } :{ target_name } " )
498+ target_dict ['tags' ].append (
499+ f"{ nvcr_url } :{ target_name } -{ isaac_ros_platform } "
500+ )
482501
483502 # If extra build args are provided, update each target's args.
484503 if extra_build_args :
@@ -630,27 +649,28 @@ def countdown_warning(message, seconds=5):
630649 sys .exit (1 )
631650
632651
633- def get_image_name (cache_from_registry_name , env_list , file_arch , include_hash = False ):
634- """Get the full image name for a given environment list and architecture .
652+ def get_image_name (cache_from_registry_name , env_list , isaac_ros_platform , include_hash = False ):
653+ """Get the full image name for a given environment list and platform .
635654
636655 Args:
637656 cache_from_registry_name (str): Registry name to use for the image
638657 env_list (List[str]): List of environment components
639- file_arch (str): Architecture (e.g. 'amd64', 'sbsa', 'arm64')
658+ isaac_ros_platform (str): Isaac ROS platform identifier
659+ (e.g. 'amd64', 'arm64-jetpack', 'arm64-fastos')
640660 include_hash (bool): Whether to include the hash in the image name
641661
642662 Returns:
643663 str: Full image name including registry, environment components,
644- architecture and optionally hash
664+ platform and optionally hash
645665 """
646666 base_name = '-' .join (env_list )
647667 if os .getenv ("CONFIG_CONTAINER_NAME_SUFFIX" ):
648668 base_name += f"-{ os .getenv ('CONFIG_CONTAINER_NAME_SUFFIX' )} "
649669
650- # Use the same docker search dirs as main( )
670+ # Derive coarse architecture for Config (remote builder selection, etc. )
651671 config = Config (
652- platform_ = "x86_64" if file_arch == "amd64"
653- else "aarch64" if file_arch == "arm64" or file_arch == "sbsa"
672+ platform_ = "x86_64" if isaac_ros_platform == "amd64"
673+ else "aarch64" if isaac_ros_platform . startswith ( "arm64" )
654674 else platform .uname ().machine
655675 )
656676 config .load_shell_common_config ()
@@ -676,7 +696,7 @@ def get_image_name(cache_from_registry_name, env_list, file_arch, include_hash=F
676696 "and that the docker_search_dirs are present and correct." )
677697 exit (1 )
678698
679- target_name = f"{ base_name } -{ file_arch } "
699+ target_name = f"{ base_name } -{ isaac_ros_platform } "
680700
681701 if cache_from_registry_name .count ("nvcr.io" ):
682702 return f"{ cache_from_registry_name } :{ target_name } "
@@ -697,7 +717,8 @@ def main(image_key_set: List[str],
697717 skip_registry_check : bool = False ,
698718 build_local : bool = False ,
699719 push : bool = False ,
700- use_kubernetes_driver : bool = False ):
720+ use_kubernetes_driver : bool = False ,
721+ isaac_ros_platform : str = None ):
701722
702723 platform_ = platform_ if platform_ else platform .uname ().machine
703724
@@ -756,7 +777,8 @@ def main(image_key_set: List[str],
756777 extra_build_args = config .build_args_ ,
757778 nvcr_tag = nvcr_tag ,
758779 s3_cache_config = config .s3_cache_ ,
759- use_kubernetes_driver = use_kubernetes_driver
780+ use_kubernetes_driver = use_kubernetes_driver ,
781+ isaac_ros_platform = isaac_ros_platform ,
760782 )
761783 docker_bake = ImageBuildPlan .as_hcl_str (docker_bake_dict )
762784 print (redact_bake_hcl (docker_bake ))
@@ -990,6 +1012,15 @@ def main(image_key_set: List[str],
9901012 help = "Use Kubernetes driver (deploy BuildKit pods on-demand, bypasses NLB)." ,
9911013 default = False
9921014 )
1015+ parser .add_argument (
1016+ '--isaac-ros-platform' ,
1017+ type = str ,
1018+ dest = 'isaac_ros_platform' ,
1019+ default = None ,
1020+ help = 'Isaac ROS platform identifier (e.g., amd64, arm64-jetpack, arm64-fastos). '
1021+ 'Determines the apt distro suffix baked into the image and the image name suffix. '
1022+ 'Defaults to coarse file_arch for backward compatibility.'
1023+ )
9931024
9941025 args = parser .parse_args ()
9951026
@@ -1015,5 +1046,6 @@ def main(image_key_set: List[str],
10151046 nvcr_tag = args .nvcr ,
10161047 skip_registry_check = args .skip_registry_check ,
10171048 build_local = args .build_local ,
1018- use_kubernetes_driver = args .use_kubernetes_driver
1049+ use_kubernetes_driver = args .use_kubernetes_driver ,
1050+ isaac_ros_platform = args .isaac_ros_platform ,
10191051 )
0 commit comments