From b9b9da1330ac56b16f9bbd6b715ec0981f08548d Mon Sep 17 00:00:00 2001 From: Oguz Ozturk Date: Mon, 30 Sep 2024 13:08:36 +0300 Subject: [PATCH] add planning-control Signed-off-by: Oguz Ozturk --- .../actions/docker-build-and-push/action.yaml | 37 +++++++++++++------ docker/Dockerfile | 16 ++++++-- docker/docker-bake.hcl | 28 +++++++++----- docker/docker-compose.yml | 6 +-- docker/run.sh | 6 ++- 5 files changed, 64 insertions(+), 29 deletions(-) diff --git a/.github/actions/docker-build-and-push/action.yaml b/.github/actions/docker-build-and-push/action.yaml index 6a163191286..a9b867f8521 100644 --- a/.github/actions/docker-build-and-push/action.yaml +++ b/.github/actions/docker-build-and-push/action.yaml @@ -81,27 +81,39 @@ runs: run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT shell: bash - - name: Docker meta for autoware:aws-reinvent-simulator-monolithic-devel - id: meta-aws-reinvent-simulator-monolithic-devel + - name: Docker meta for autoware:aws-reinvent-simulator-devel + id: meta-aws-reinvent-simulator-devel uses: docker/metadata-action@v5 with: images: ghcr.io/${{ github.repository_owner }}/${{ inputs.bake-target }} tags: | - type=raw,value=aws-reinvent-simulator-monolithic-devel${{ inputs.tag-suffix }}-${{ inputs.platform }} - type=raw,value=aws-reinvent-simulator-monolithic-devel${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }} - bake-target: docker-metadata-action-aws-reinvent-simulator-monolithic-devel + type=raw,value=aws-reinvent-simulator-devel${{ inputs.tag-suffix }}-${{ inputs.platform }} + type=raw,value=aws-reinvent-simulator-devel${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }} + bake-target: docker-metadata-action-aws-reinvent-simulator-devel flavor: | latest=false - - name: Docker meta for autoware:aws-reinvent-simulator-monolithic - id: meta-aws-reinvent-simulator-monolithic + - name: Docker meta for autoware:aws-reinvent-simulator + id: meta-aws-reinvent-simulator uses: docker/metadata-action@v5 with: images: ghcr.io/${{ github.repository_owner }}/${{ inputs.bake-target }} tags: | - type=raw,value=aws-reinvent-simulator-monolithic${{ inputs.tag-suffix }}-${{ inputs.platform }} - type=raw,value=aws-reinvent-simulator-monolithic${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }} - bake-target: docker-metadata-action-aws-reinvent-simulator-monolithic + type=raw,value=aws-reinvent-simulator${{ inputs.tag-suffix }}-${{ inputs.platform }} + type=raw,value=aws-reinvent-simulator${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }} + bake-target: docker-metadata-action-aws-reinvent-simulator + flavor: | + latest=false + + - name: Docker meta for autoware:aws-reinvent-planning-control + id: meta-aws-reinvent-planning-control + uses: docker/metadata-action@v5 + with: + images: ghcr.io/${{ github.repository_owner }}/${{ inputs.bake-target }} + tags: | + type=raw,value=aws-reinvent-planning-control${{ inputs.tag-suffix }}-${{ inputs.platform }} + type=raw,value=aws-reinvent-planning-control${{ inputs.tag-suffix }}-${{ steps.date.outputs.date }}-${{ inputs.platform }} + bake-target: docker-metadata-action-aws-reinvent-planning-control flavor: | latest=false @@ -118,8 +130,9 @@ runs: push: true files: | docker/docker-bake.hcl - ${{ steps.meta-aws-reinvent-simulator-monolithic.outputs.bake-file }} - ${{ steps.meta-aws-reinvent-simulator-monolithic-devel.outputs.bake-file }} + ${{ steps.meta-aws-reinvent-simulator.outputs.bake-file }} + ${{ steps.meta-aws-reinvent-simulator-devel.outputs.bake-file }} + ${{ steps.meta-aws-reinvent-planning-control.outputs.bake-file }} provenance: false set: | ${{ inputs.build-args }} diff --git a/docker/Dockerfile b/docker/Dockerfile index e4417e04a8d..9608b7ab928 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,5 @@ ARG PLATFORM -FROM ghcr.io/autowarefoundation/autoware:universe-devel-${PLATFORM} AS aws-reinvent-simulator-monolithic-devel +FROM ghcr.io/autowarefoundation/autoware:universe-devel-20240927 AS aws-reinvent-simulator-devel SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG ROS_DISTRO ENV CCACHE_DIR="/root/.ccache" @@ -28,7 +28,7 @@ RUN source /opt/ros/"$ROS_DISTRO"/setup.bash \ RUN find /opt/autoware/lib -type f -name "*.py" -exec chmod +x {} \; RUN find /opt/autoware/share -type f -name "*.py" -exec chmod +x {} \; -FROM ghcr.io/autowarefoundation/autoware:universe-${PLATFORM} AS aws-reinvent-simulator-monolithic +FROM ghcr.io/autowarefoundation/autoware:universe-20240927 AS aws-reinvent-simulator # Copy simulator from simulator-devel COPY src /autoware/src @@ -40,7 +40,7 @@ RUN --mount=type=ssh \ apt-get update \ && rosdep update \ && cd /autoware \ - && rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO \ + && rosdep install -y --from-paths src --ignore-src --dependency-types=exec --rosdistro $ROS_DISTRO \ && apt-get autoremove -y && rm -rf "$HOME"/.cache RUN echo "source /opt/autoware/setup.bash" > /etc/bash.bashrc @@ -50,3 +50,13 @@ COPY docker/etc/ros_entrypoint.sh /ros_entrypoint.sh RUN chmod +x /ros_entrypoint.sh ENTRYPOINT ["/ros_entrypoint.sh"] CMD ["/bin/bash"] + +FROM ghcr.io/autowarefoundation/autoware:universe-20240927 AS aws-reinvent-planning-control + +COPY --from=aws-reinvent-simulator /opt/autoware/share/kashiwanoha_map /opt/autoware/share/kashiwanoha_map + +# Create entrypoint +COPY docker/etc/ros_entrypoint.sh /ros_entrypoint.sh +RUN chmod +x /ros_entrypoint.sh +ENTRYPOINT ["/ros_entrypoint.sh"] +CMD ["/bin/bash"] diff --git a/docker/docker-bake.hcl b/docker/docker-bake.hcl index a959252a5ed..239405e0149 100644 --- a/docker/docker-bake.hcl +++ b/docker/docker-bake.hcl @@ -1,21 +1,29 @@ group "default" { targets = [ - "aws-reinvent-simulator-monolithic-devel", - "aws-reinvent-simulator-monolithic" + "aws-reinvent-simulator-devel", + "aws-reinvent-simulator", + "aws-reinvent-planning-control" ] } -target "docker-metadata-action-aws-reinvent-simulator-monolithic-devel" {} -target "docker-metadata-action-aws-reinvent-simulator-monolithic" {} +target "docker-metadata-action-aws-reinvent-simulator-devel" {} +target "docker-metadata-action-aws-reinvent-simulator" {} +target "docker-metadata-action-aws-reinvent-planning-control" {} -target "aws-reinvent-simulator-monolithic-devel" { - inherits = ["docker-metadata-action-aws-reinvent-simulator-monolithic-devel"] +target "aws-reinvent-simulator-devel" { + inherits = ["docker-metadata-action-aws-reinvent-simulator-devel"] dockerfile = "docker/Dockerfile" - target = "aws-reinvent-simulator-monolithic-devel" + target = "aws-reinvent-simulator-devel" } -target "aws-reinvent-simulator-monolithic" { - inherits = ["docker-metadata-action-aws-reinvent-simulator-monolithic"] +target "aws-reinvent-simulator" { + inherits = ["docker-metadata-action-aws-reinvent-simulator"] dockerfile = "docker/Dockerfile" - target = "aws-reinvent-simulator-monolithic" + target = "aws-reinvent-simulator" +} + +target "aws-reinvent-planning-control" { + inherits = ["docker-metadata-action-aws-reinvent-planning-control"] + dockerfile = "docker/Dockerfile" + target = "aws-reinvent-planning-control" } diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index c13ea8a9947..c589f6d4c8f 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -2,7 +2,7 @@ version: '2.17' services: simulator: - image: ghcr.io/autowarefoundation/openadkit_demo.autoware:aws-reinvent-simulator-monolithic-amd64 + image: ghcr.io/autowarefoundation/openadkit_demo.autoware:aws-reinvent-simulator-amd64 volumes: - /dev/shm:/dev/shm - /etc/localtime:/etc/localtime:ro @@ -25,7 +25,7 @@ services: launch_rviz:=true planning-control: - image: ghcr.io/autowarefoundation/autoware:universe-amd64 + image: ghcr.io/autowarefoundation/autoware:aws-reinvent-planning-control volumes: - /dev/shm:/dev/shm - /etc/localtime:/etc/localtime:ro @@ -35,7 +35,7 @@ services: - RMW_IMPLEMENTATION=rmw_cyclonedds_cpp command: > ros2 launch autoware_launch planning_simulator.launch.xml - map_path:=/opt/autoware/share/kashiwanoha_map + map_path:=/opt/autoware/share/kashiwanoha_map/map vehicle_model:=sample_vehicle sensor_model:=sample_sensor_kit scenario_simulation:=true diff --git a/docker/run.sh b/docker/run.sh index 58489730048..08584c6d64c 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -2,4 +2,8 @@ xhost + -docker compose -f docker-compose.yml up \ No newline at end of file +# Get the directory of the current script +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Use the script directory to make the docker-compose.yml path relative +docker compose -f "$SCRIPT_DIR/docker-compose.yml" up \ No newline at end of file