diff --git a/docker/build.sh b/docker/build.sh index b962137b79..9e5dd66881 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -118,24 +118,60 @@ build_images() { echo "Building images for platform: $platform" echo "ROS distro: $rosdistro" echo "Base image: $base_image" + echo "Base Autoware image: $autoware_base_image" + echo "Base Autoware CUDA image: $autoware_base_cuda_image" echo "Setup args: $setup_args" echo "Lib dir: $lib_dir" echo "Image name suffix: $image_name_suffix" echo "Targets: ${targets[*]}" set -x - docker buildx bake --load --progress=plain -f "$SCRIPT_DIR/docker-bake.hcl" \ + docker buildx bake --load --progress=plain -f "$SCRIPT_DIR/docker-bake-base.hcl" \ --set "*.context=$WORKSPACE_ROOT" \ --set "*.ssh=default" \ --set "*.platform=$platform" \ --set "*.args.ROS_DISTRO=$rosdistro" \ --set "*.args.BASE_IMAGE=$base_image" \ + --set "*.args.AUTOWARE_BASE_IMAGE=$autoware_base_image" \ + --set "*.args.AUTOWARE_BASE_CUDA_IMAGE=$autoware_base_cuda_image" \ --set "*.args.SETUP_ARGS=$setup_args" \ --set "*.args.LIB_DIR=$lib_dir" \ - --set "base.tags=ghcr.io/autowarefoundation/autoware:base" \ - --set "universe-devel.tags=ghcr.io/autowarefoundation/autoware:universe-devel$image_name_suffix" \ - --set "universe.tags=ghcr.io/autowarefoundation/autoware:universe$image_name_suffix" \ - "${targets[@]}" + --set "base.tags=ghcr.io/autowarefoundation/autoware-base:latest" \ + --set "base-cuda.tags=ghcr.io/autowarefoundation/autoware-base:cuda-latest" + + docker buildx bake --load --progress=plain -f "$SCRIPT_DIR/docker-bake.hcl" -f "$SCRIPT_DIR/docker-bake-cuda.hcl" \ + --set "*.context=$WORKSPACE_ROOT" \ + --set "*.ssh=default" \ + --set "*.platform=$platform" \ + --set "*.args.ROS_DISTRO=$rosdistro" \ + --set "*.args.BASE_IMAGE=$base_image" \ + --set "*.args.AUTOWARE_BASE_IMAGE=$autoware_base_image" \ + --set "*.args.AUTOWARE_BASE_CUDA_IMAGE=$autoware_base_cuda_image" \ + --set "*.args.SETUP_ARGS=$setup_args" \ + --set "*.args.LIB_DIR=$lib_dir" \ + --set "rosdep-depend.tags=ghcr.io/autowarefoundation/autoware:rosdep-depend" \ + --set "rosdep-universe-sensing-perception-depend.tags=ghcr.io/autowarefoundation/autoware:rosdep-universe-sensing-perception-depend" \ + --set "rosdep-universe-localization-mapping-depend.tags=ghcr.io/autowarefoundation/autoware:rosdep-universe-localization-mapping-depend" \ + --set "rosdep-universe-planning-control-depend.tags=ghcr.io/autowarefoundation/autoware:rosdep-universe-planning-control-depend" \ + --set "rosdep-universe-vehicle-system-depend.tags=ghcr.io/autowarefoundation/autoware:rosdep-universe-vehicle-system-depend" \ + --set "rosdep-universe-depend.tags=ghcr.io/autowarefoundation/autoware:rosdep-universe-depend" \ + --set "core-devel.tags=ghcr.io/autowarefoundation/autoware:core-devel" \ + --set "universe-common-devel.tags=ghcr.io/autowarefoundation/autoware:universe-common-devel" \ + --set "universe-common-devel-cuda.tags=ghcr.io/autowarefoundation/autoware:universe-common-devel-cuda" \ + --set "universe-sensing-perception-devel.tags=ghcr.io/autowarefoundation/autoware:universe-sensing-perception-devel" \ + --set "universe-sensing-perception-devel-cuda.tags=ghcr.io/autowarefoundation/autoware:universe-sensing-perception-devel-cuda" \ + --set "universe-localization-mapping-devel.tags=ghcr.io/autowarefoundation/autoware:universe-localization-mapping-devel" \ + --set "universe-planning-control-devel.tags=ghcr.io/autowarefoundation/autoware:universe-planning-control-devel" \ + --set "universe-vehicle-system-devel.tags=ghcr.io/autowarefoundation/autoware:universe-vehicle-system-devel" \ + --set "universe-devel.tags=ghcr.io/autowarefoundation/autoware:universe-devel" \ + --set "universe-devel-cuda.tags=ghcr.io/autowarefoundation/autoware:universe-devel-cuda" \ + --set "universe-sensing-perception.tags=ghcr.io/autowarefoundation/autoware:universe-sensing-perception" \ + --set "universe-sensing-perception-cuda.tags=ghcr.io/autowarefoundation/autoware:universe-sensing-perception-cuda" \ + --set "universe-localization-mapping.tags=ghcr.io/autowarefoundation/autoware:universe-localization-mapping" \ + --set "universe-planning-control.tags=ghcr.io/autowarefoundation/autoware:universe-planning-control" \ + --set "universe-vehicle-system.tags=ghcr.io/autowarefoundation/autoware:universe-vehicle-system" \ + --set "universe.tags=ghcr.io/autowarefoundation/autoware:universe" \ + --set "universe-cuda.tags=ghcr.io/autowarefoundation/autoware:universe-cuda" set +x } diff --git a/docker/docker-bake-cuda.hcl b/docker/docker-bake-cuda.hcl index 87aa27df87..1f4c182f71 100644 --- a/docker/docker-bake-cuda.hcl +++ b/docker/docker-bake-cuda.hcl @@ -1,5 +1,6 @@ group "default" { targets = [ + "universe-common-devel-cuda", "universe-sensing-perception-devel-cuda", "universe-sensing-perception-cuda", "universe-devel-cuda", @@ -8,11 +9,18 @@ group "default" { } // For docker/metadata-action +target "docker-metadata-action-universe-common-devel-cuda" {} target "docker-metadata-action-universe-sensing-perception-devel-cuda" {} target "docker-metadata-action-universe-sensing-perception-cuda" {} target "docker-metadata-action-universe-devel-cuda" {} target "docker-metadata-action-universe-cuda" {} +target "universe-common-devel-cuda" { + inherits = ["docker-metadata-action-universe-common-devel-cuda"] + dockerfile = "docker/Dockerfile" + target = "universe-common-devel-cuda" +} + target "universe-sensing-perception-devel-cuda" { inherits = ["docker-metadata-action-universe-sensing-perception-devel-cuda"] dockerfile = "docker/Dockerfile" diff --git a/docker/docker-bake.hcl b/docker/docker-bake.hcl index dcf79ffc11..1a1e06bfc7 100644 --- a/docker/docker-bake.hcl +++ b/docker/docker-bake.hcl @@ -1,6 +1,13 @@ group "default" { targets = [ + "rosdep-depend", + "rosdep-universe-depend", + "rosdep-universe-sensing-perception-depend", + "rosdep-universe-vehicle-system-depend", + "rosdep-universe-planning-control-depend", + "rosdep-universe-localization-mapping-depend", "core-devel", + "universe-common-devel", "universe-sensing-perception-devel", "universe-sensing-perception", "universe-localization-mapping-devel", @@ -15,7 +22,14 @@ group "default" { } // For docker/metadata-action +target "docker-metadata-action-rosdep-depend" {} +target "docker-metadata-action-rosdep-universe-depend" {} +target "docker-metadata-action-rosdep-universe-sensing-perception-depend" {} +target "docker-metadata-action-rosdep-universe-vehicle-system-depend" {} +target "docker-metadata-action-rosdep-universe-planning-control-depend" {} +target "docker-metadata-action-rosdep-universe-localization-mapping-depend" {} target "docker-metadata-action-core-devel" {} +target "docker-metadata-action-universe-common-devel" {} target "docker-metadata-action-universe-sensing-perception-devel" {} target "docker-metadata-action-universe-sensing-perception" {} target "docker-metadata-action-universe-localization-mapping-devel" {} @@ -27,12 +41,53 @@ target "docker-metadata-action-universe-vehicle-system" {} target "docker-metadata-action-universe-devel" {} target "docker-metadata-action-universe" {} +target "rosdep-depend" { + inherits = ["docker-metadata-action-rosdep-depend"] + dockerfile = "docker/Dockerfile" + target = "rosdep-depend" +} + +target "rosdep-universe-depend" { + inherits = ["docker-metadata-action-rosdep-universe-depend"] + dockerfile = "docker/Dockerfile" + target = "rosdep-universe-depend" +} + +target "rosdep-universe-sensing-perception-depend" { + inherits = ["docker-metadata-action-rosdep-universe-sensing-perception-depend"] + dockerfile = "docker/Dockerfile" + target = "rosdep-universe-sensing-perception-depend" +} + +target "rosdep-universe-vehicle-system-depend" { + inherits = ["docker-metadata-action-rosdep-universe-vehicle-system-depend"] + dockerfile = "docker/Dockerfile" + target = "rosdep-universe-vehicle-system-depend" +} + +target "rosdep-universe-planning-control-depend" { + inherits = ["docker-metadata-action-rosdep-universe-planning-control-depend"] + dockerfile = "docker/Dockerfile" + target = "rosdep-universe-planning-control-depend" +} + +target "rosdep-universe-localization-mapping-depend" { + inherits = ["docker-metadata-action-rosdep-universe-localization-mapping-depend"] + dockerfile = "docker/Dockerfile" + target = "rosdep-universe-localization-mapping-depend" +} target "core-devel" { inherits = ["docker-metadata-action-core-devel"] dockerfile = "docker/Dockerfile" target = "core-devel" } +target "universe-common-devel" { + inherits = ["docker-metadata-action-universe-common-devel"] + dockerfile = "docker/Dockerfile" + target = "universe-common-devel" +} + target "universe-sensing-perception-devel" { inherits = ["docker-metadata-action-universe-sensing-perception-devel"] dockerfile = "docker/Dockerfile"