From 35f81ece18028433548913c77f00eb5aeef8d71e Mon Sep 17 00:00:00 2001 From: abarbie Date: Wed, 12 Jun 2024 17:50:49 +0200 Subject: [PATCH] dockerfile tag fixes --- .github/workflows/build-arm64v8.yml | 2 +- PiCar-X/docker-compose-dtp.yml | 27 +++++++++++++++++++-------- PiCar-X/simulation/Dockerfile | 13 ++++++------- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-arm64v8.yml b/.github/workflows/build-arm64v8.yml index 94068dd..4040717 100644 --- a/.github/workflows/build-arm64v8.yml +++ b/.github/workflows/build-arm64v8.yml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: build: - runs-on: self-hosted + runs-on: [self-hosted, Linux, ARM&$] steps: - uses: actions/checkout@v2 diff --git a/PiCar-X/docker-compose-dtp.yml b/PiCar-X/docker-compose-dtp.yml index a5f49b2..4d7b85d 100644 --- a/PiCar-X/docker-compose-dtp.yml +++ b/PiCar-X/docker-compose-dtp.yml @@ -1,22 +1,28 @@ services: picarx-ds: - build: . image: abarbie/picarx:${TAG} environment: - ROS_HOSTNAME=picarx-ds + - ROS_MASTER_URI=http://picarx-ds:11311 + - ROS_HOST_PORT=11311 tty: true ports: - 11311:11311 command: roscore - depends_on: - picarx-ds: - condition: service_healthy + healthcheck: + test: [ "CMD-SHELL", "curl $${ROS_MASTER_URI} || exit 1" ] + interval: 5s + timeout: 1s + retries: 5 + start_period: 1s picarx-gazebo: build: context: ./simulation dockerfile: Dockerfile target: desktop + args: + - TAG=${TAG} image: abarbie/picarx/picarx-gazebo:${TAG} env_file: - ./core/dtp/env/simulation.env @@ -24,6 +30,7 @@ services: - DISPLAY=host.docker.internal:0.0 - LIBGL_ALWAYS_INDIRECT=0 - ROS_HOSTNAME=picarx-gazebo + - ROS_MASTER_URI=http://picarx-gazebo:11312 tty: true ports: - 11312:11312 @@ -64,8 +71,12 @@ services: condition: service_healthy motor_left-dtp: - build: ./ros/drivers/dcmotor image: abarbie/picarx/drivers/dcmotor:${TAG} + build: + dockerfile: Dockerfile + context: ./ros/drivers/dcmotor/ + args: + - TAG=${TAG} env_file: - ./core/dtp/env/picarx.env tty: true @@ -157,7 +168,7 @@ services: - ./ros/emulators/dcmotor:/root/catkin_ws/src/emulators/dcmotor command: /bin/bash -c "roslaunch picarx_dcmotor_emulator dcmotor_emulator_left.launch" depends_on: - picarx-ds: + picarx-gazebo: condition: service_healthy motor_emulator_right-dtp: @@ -174,7 +185,7 @@ services: command: /bin/bash -c "roslaunch picarx_dcmotor_emulator dcmotor_emulator_right.launch" depends_on: - picarx-ds: + picarx-gazebo: condition: service_healthy steering_emulator-dtp: @@ -195,7 +206,7 @@ services: - ./ros/emulators/clutchgear:/root/catkin_ws/src/emulators/clutchgear command: /bin/bash -c "roslaunch picarx_clutchgear_emulator ackermann_clutchgear_emulator.launch" depends_on: - picarx-ds: + picarx-gazebo: condition: service_healthy networks: diff --git a/PiCar-X/simulation/Dockerfile b/PiCar-X/simulation/Dockerfile index d9af493..5238574 100644 --- a/PiCar-X/simulation/Dockerfile +++ b/PiCar-X/simulation/Dockerfile @@ -1,26 +1,23 @@ -ARG TAG=latest - FROM osrf/ros:noetic-desktop-full as gazebo-full - +ARG TAG WORKDIR /root/catkin_ws - RUN apt-get update \ && apt-get install -y python3-pip python3-setuptools python3-yaml ros-noetic-ros-control ros-noetic-ros-controllers python3-catkin-tools \ && apt-get clean \ && update-ca-certificates -f FROM gazebo:libgazebo11 as gazebo-only - +ARG TAG WORKDIR /root/catkin_ws - RUN apt-get update \ && apt-get install -y python3-pip python3-setuptools python3-yaml ros-noetic-ros-control ros-noetic-ros-controllers python3-catkin-tools \ && apt-get clean \ && update-ca-certificates -f - +ARG TAG=latest FROM gazebo-full as desktop +ARG TAG COPY --from=abarbie/picarx:${TAG} /root/catkin_ws/ . COPY ./simulation ./src/simulation @@ -30,6 +27,8 @@ RUN /bin/bash -c "source /opt/ros/noetic/setup.bash && catkin config --isolate-d ENTRYPOINT [ "/root/catkin_ws/src/arches/arches_core/ENTRYPOINT.sh" ] + +ARG TAG=latest FROM gazebo-only as tests COPY --from=abarbie/picarx:${TAG} /root/catkin_ws/ . COPY ./simulation ./src/simulation