Skip to content

Commit e24393f

Browse files
author
abarbie
committed
added ARCH variable to build the core image
1 parent 94c8674 commit e24393f

15 files changed

Lines changed: 88 additions & 81 deletions

File tree

‎.github/workflows/build-arm64v8.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
- name: Build with Docker Compose
1313
working-directory: ./PiCar-X
1414
run: |
15-
TAG=arm64v8 docker compose -f docker-compose-core.yml build --no-cache
16-
TAG=arm64v8 docker compose -f docker-compose-dtp.yml build --no-cache
15+
TAG=${{github.ref_name:-latest}}-arm64v8 ARCH=arm64v8 docker compose -f docker-compose-core.yml build --no-cache
16+
TAG=${{github.ref_name:-latest}}-arm64v8 docker compose -f docker-compose-dtp.yml build --no-cache
1717
1818
# - name: Run pytest in Docker container
1919
# run: |
@@ -26,4 +26,4 @@ jobs:
2626
- name: Push to Docker Hub
2727
working-directory: ./PiCar-X
2828
run: |
29-
TAG=arm64v8 docker compose -f docker-compose-dtp.yml push
29+
TAG=${{ github.ref_name:-latest }}-arm64v8 docker compose -f docker-compose-dtp.yml push

‎PiCar-X/Dockerfile‎

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ARG TAG=latest
2-
ARG ISLATEST=${TAG##latest}
3-
FROM ${ISLATEST:+${TAG}/}ros:noetic as rosnoetic
2+
ARG ARCH=''
3+
4+
FROM ${ARCH:+${ARCH}/}ros:noetic as rosnoetic
45
WORKDIR /root/catkin_ws/
56
RUN apt update -y \
67
&& apt-get install -y python3-pip python3-setuptools python3-catkin-tools wget unzip curl nano \
@@ -10,7 +11,6 @@ RUN apt update -y \
1011
&& pip3 install pytest pytest-cov avro \
1112
&& mkdir -p ./src/arches
1213

13-
1414
FROM rosnoetic as adtf
1515
RUN wget -c https://git.geomar.de/open-source/arches/arches_msgs/-/archive/master/arches_msgs-master.tar.gz -O - | tar -xz \
1616
&& mv arches_msgs-master ./src/arches/arches_msgs \
@@ -19,13 +19,4 @@ RUN wget -c https://git.geomar.de/open-source/arches/arches_msgs/-/archive/maste
1919

2020
RUN /bin/bash -c "source /opt/ros/noetic/setup.bash && catkin config --isolate-devel --install && catkin build" \
2121
&& touch /root/.bashrc \
22-
&& echo "source /opt/ros/noetic/setup.bash" >> /root/.bashrc
23-
24-
FROM adtf
25-
ENV ASSET_NAME ''
26-
27-
COPY ./core ./src/core
28-
COPY ./ros/picarx_msgs ./src/picarx_msgs
29-
RUN pip3 install -e ./src/core/picarx \
30-
&& /bin/bash -c "source /opt/ros/noetic/setup.bash && catkin build"
31-
ENTRYPOINT [ "/root/catkin_ws/src/arches/arches_core/ENTRYPOINT.sh" ]
22+
&& echo "source /opt/ros/noetic/setup.bash" >> /root/.bashrc

‎PiCar-X/docker-compose-core.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ services:
44
dockerfile: Dockerfile
55
context: .
66
args:
7-
- TAG=${TAG}
8-
image: abarbie/picarx:${TAG}
7+
- TAG=${TAG:-latest}
8+
- ARCH=${ARCH}
9+
image: abarbie/picarx:${TAG:-latest}
910

1011
networks:
1112
default:

‎PiCar-X/docker-compose-ds.yml‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
picarx-dt:
33
build: .
4-
image: abarbie/picarx:${TAG}
4+
image: abarbie/picarx:${TAG:-latest}
55
environment:
66
- ROS_HOSTNAME=picarx-dt
77
- ROS_MASTER_URI=http://picarx-dt:11313
@@ -51,7 +51,7 @@ services:
5151
condition: service_healthy
5252

5353
shadow-dt:
54-
image: abarbie/picarx:${TAG}
54+
image: abarbie/picarx:${TAG:-latest}
5555
env_file:
5656
- ./core/dtp/env/picarx-dt.env
5757
tty: true
@@ -66,7 +66,8 @@ services:
6666
dockerfile: Dockerfile-arches-mqtt-bridge
6767
context: ./ros
6868
args:
69-
- TAG=${TAG}
69+
- TAG=${TAG:-latest}
70+
- ARCH=${ARCH}
7071
env_file:
7172
- ./core/dtp/env/picarx-dt.env
7273
command: /bin/bash -c "roslaunch arches_mqtt_bridge pt_client.launch host:=mqtt-server"
@@ -80,7 +81,8 @@ services:
8081
dockerfile: Dockerfile
8182
context: ./ros/skills/ackermann_drive
8283
args:
83-
- TAG=${TAG}
84+
- TAG=${TAG:-latest}
85+
- ARCH=${ARCH}
8486
env_file:
8587
- ./core/dtp/env/picarx-dt.env
8688
tty: true

‎PiCar-X/docker-compose-dt.yml‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
services:
22
picarx-dt:
33
build: .
4-
image: abarbie/picarx:${TAG}
4+
image: abarbie/picarx:${TAG:-latest}
55
environment:
66
- ROS_HOSTNAME=picarx-dt
77
tty: true
@@ -28,7 +28,7 @@ services:
2828
condition: service_healthy
2929

3030
shadow-dt:
31-
image: abarbie/picarx:${TAG}
31+
image: abarbie/picarx:${TAG:-latest}
3232
env_file:
3333
- ./core/dtp/env/picarx-dt.env
3434
tty: true
@@ -43,7 +43,8 @@ services:
4343
dockerfile: Dockerfile-arches-mqtt-bridge
4444
context: ./ros
4545
args:
46-
- TAG=${TAG}
46+
- TAG=${TAG:-latest}
47+
- ARCH=${ARCH}
4748
env_file:
4849
- ./core/dtp/env/picarx-dt.env
4950
tty: true
@@ -58,7 +59,8 @@ services:
5859
dockerfile: Dockerfile
5960
context: ./ros/skills/ackermann_drive
6061
args:
61-
- TAG=${TAG}
62+
- TAG=${TAG:-latest}
63+
- ARCH=${ARCH}
6264
env_file:
6365
- ./core/dtp/env/picarx-dt.env
6466
tty: true

‎PiCar-X/docker-compose-dtp-inttest.yml‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ services:
2626
start_period: 1s
2727

2828
shadow-dtp:
29-
image: abarbie/picarx:${TAG}
29+
image: abarbie/picarx:${TAG:-latest}
3030
env_file:
3131
- ./core/dtp/env/simulation.env
3232
tty: true
@@ -41,7 +41,8 @@ services:
4141
dockerfile: Dockerfile-arches-mqtt-bridge
4242
context: ./ros
4343
args:
44-
- TAG=${TAG}
44+
- TAG=${TAG:-latest}
45+
- ARCH=${ARCH}
4546
env_file:
4647
- ./core/dtp/env/simulation.env
4748
tty: true
@@ -55,7 +56,8 @@ services:
5556
dockerfile: Dockerfile
5657
context: ./ros/drivers/dcmotor/
5758
args:
58-
- TAG=${TAG}
59+
- TAG=${TAG:-latest}
60+
- ARCH=${ARCH}
5961
image: abarbie/picarx/drivers/dcmotor:${TAG}
6062
env_file:
6163
- ./core/dtp/env/simulation.env
@@ -93,7 +95,8 @@ services:
9395
dockerfile: Dockerfile
9496
context: ./ros/drivers/clutchgear
9597
args:
96-
- TAG=${TAG}
98+
- TAG=${TAG:-latest}
99+
- ARCH=${ARCH}
97100
env_file:
98101
- ./core/dtp/env/simulation.env
99102
tty: true
@@ -114,7 +117,8 @@ services:
114117
dockerfile: Dockerfile
115118
context: ./ros/skills/ackermann_drive
116119
args:
117-
- TAG=${TAG}
120+
- TAG=${TAG:-latest}
121+
- ARCH=${ARCH}
118122
env_file:
119123
- ./core/dtp/env/simulation.env
120124
tty: true
@@ -135,7 +139,8 @@ services:
135139
dockerfile: Dockerfile
136140
context: ./ros/emulators/dcmotor
137141
args:
138-
- TAG=${TAG}
142+
- TAG=${TAG:-latest}
143+
- ARCH=${ARCH}
139144
env_file:
140145
- ./core/dtp/env/simulation.env
141146
tty: true
@@ -172,7 +177,8 @@ services:
172177
dockerfile: Dockerfile
173178
context: ./ros/emulators/clutchgear
174179
args:
175-
- TAG=${TAG}
180+
- TAG=${TAG:-latest}
181+
- ARCH=${ARCH}
176182
env_file:
177183
- ./core/dtp/env/simulation.env
178184
tty: true

‎PiCar-X/docker-compose-dtp.yml‎

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
services:
2-
picarx-ds:
3-
image: abarbie/picarx:${TAG}
2+
picarx:
3+
image: abarbie/picarx:${TAG:-latest}
44
environment:
5-
- ROS_HOSTNAME=picarx-ds
6-
- ROS_MASTER_URI=http://picarx-ds:11311
5+
- ROS_HOSTNAME=picarx
6+
- ROS_MASTER_URI=http://picarx:11311
77
- ROS_HOST_PORT=11311
88
tty: true
99
ports:
@@ -20,9 +20,10 @@ services:
2020
build:
2121
context: ./simulation
2222
dockerfile: Dockerfile
23-
target: desktop
2423
args:
25-
- TAG=${TAG}
24+
- TAG=${TAG:-latest}
25+
- ARCH=${ARCH}
26+
target: desktop
2627
image: abarbie/picarx/picarx-gazebo:${TAG}
2728
env_file:
2829
- ./core/dtp/env/simulation.env
@@ -46,13 +47,13 @@ services:
4647
start_period: 1s
4748

4849
shadow-dtp:
49-
image: abarbie/picarx:${TAG}
50+
image: abarbie/picarx:${TAG:-latest}
5051
env_file:
5152
- ./core/dtp/env/picarx.env
5253
tty: true
5354
command: /bin/bash -c "roslaunch arches_core digitalshadow_pt.launch"
5455
depends_on:
55-
picarx-ds:
56+
picarx:
5657
condition: service_healthy
5758

5859
mqtt-dtp:
@@ -61,13 +62,14 @@ services:
6162
dockerfile: Dockerfile-arches-mqtt-bridge
6263
context: ./ros
6364
args:
64-
- TAG=${TAG}
65+
- TAG=${TAG:-latest}
66+
- ARCH=${ARCH}
6567
env_file:
6668
- ./core/dtp/env/picarx.env
6769
tty: true
6870
command: /bin/bash -c "roslaunch arches_mqtt_bridge pt_client.launch host:=mqtt-server"
6971
depends_on:
70-
picarx-ds:
72+
picarx:
7173
condition: service_healthy
7274

7375
motor_left-dtp:
@@ -76,7 +78,8 @@ services:
7678
dockerfile: Dockerfile
7779
context: ./ros/drivers/dcmotor/
7880
args:
79-
- TAG=${TAG}
81+
- TAG=${TAG:-latest}
82+
- ARCH=${ARCH}
8083
env_file:
8184
- ./core/dtp/env/picarx.env
8285
tty: true
@@ -88,7 +91,7 @@ services:
8891
- ./ros/drivers/dcmotor:/root/catkin_ws/src/drivers/dcmotor
8992
command: /bin/bash -c "roslaunch picarx_dcmotor_driver dcmotor_left.launch"
9093
depends_on:
91-
picarx-ds:
94+
picarx:
9295
condition: service_healthy
9396

9497
motor_right-dtp:
@@ -104,7 +107,7 @@ services:
104107
- ./ros/drivers/dcmotor:/root/catkin_ws/src/drivers/dcmotor
105108
command: /bin/bash -c "roslaunch picarx_dcmotor_driver dcmotor_right.launch"
106109
depends_on:
107-
picarx-ds:
110+
picarx:
108111
condition: service_healthy
109112

110113
steering-dtp:
@@ -113,7 +116,8 @@ services:
113116
dockerfile: Dockerfile
114117
context: ./ros/drivers/clutchgear
115118
args:
116-
- TAG=${TAG}
119+
- TAG=${TAG:-latest}
120+
- ARCH=${ARCH}
117121
env_file:
118122
- ./core/dtp/env/picarx.env
119123
tty: true
@@ -125,7 +129,7 @@ services:
125129
- ./ros/drivers/clutchgear:/root/catkin_ws/src/drivers/clutchgear
126130
command: /bin/bash -c "roslaunch picarx_clutchgear_driver ackermann_clutchgear_driver.launch"
127131
depends_on:
128-
picarx-ds:
132+
picarx:
129133
condition: service_healthy
130134

131135
ackermann_skill-dtp:
@@ -134,7 +138,8 @@ services:
134138
dockerfile: Dockerfile
135139
context: ./ros/skills/ackermann_drive
136140
args:
137-
- TAG=${TAG}
141+
- TAG=${TAG:-latest}
142+
- ARCH=${ARCH}
138143
env_file:
139144
- ./core/dtp/env/picarx.env
140145
tty: true
@@ -147,7 +152,7 @@ services:
147152
command: /bin/bash -c "
148153
roslaunch picarx_ackermann_drive ackermann_skill.launch"
149154
depends_on:
150-
picarx-ds:
155+
picarx:
151156
condition: service_healthy
152157

153158
motor_emulator_left-dtp:
@@ -156,7 +161,8 @@ services:
156161
dockerfile: Dockerfile
157162
context: ./ros/emulators/dcmotor
158163
args:
159-
- TAG=${TAG}
164+
- TAG=${TAG:-latest}
165+
- ARCH=${ARCH}
160166
env_file:
161167
- ./core/dtp/env/simulation.env
162168
tty: true
@@ -194,7 +200,8 @@ services:
194200
dockerfile: Dockerfile
195201
context: ./ros/emulators/clutchgear
196202
args:
197-
- TAG=${TAG}
203+
- TAG=${TAG:-latest}
204+
- ARCH=${ARCH}
198205
env_file:
199206
- ./core/dtp/env/simulation.env
200207
tty: true

0 commit comments

Comments
 (0)