Skip to content

Commit 3742edc

Browse files
add build workspace script for multi platform image
DCO 1.1 Signed-off-by: Tatsuya Ishihara <[email protected]>
1 parent 241c003 commit 3742edc

10 files changed

+113
-41
lines changed

build-workspace.sh

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
3+
# Copyright (c) 2024 Carnegie Mellon University, IBM Corporation, and others
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in
13+
# all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
# THE SOFTWARE.
22+
23+
## termination hook
24+
trap ctrl_c INT QUIT TERM
25+
26+
function ctrl_c() {
27+
exit
28+
}
29+
30+
source ./cabot-common/build-utils.sh
31+
32+
function help {
33+
echo "Usage: $0 [<option>] [<targets>]"
34+
echo ""
35+
echo "-h show this help"
36+
echo "-d debug build"
37+
38+
echo "Available services:"
39+
show_available_services dcfiles
40+
}
41+
42+
debug_build=0
43+
dcfiles=("docker-compose.yaml")
44+
45+
while getopts "hd" arg; do
46+
case $arg in
47+
h)
48+
help
49+
exit
50+
;;
51+
d)
52+
debug_build=1
53+
;;
54+
esac
55+
done
56+
shift $((OPTIND-1))
57+
targets=$@
58+
59+
scriptdir=$(dirname $0)
60+
cd $scriptdir
61+
scriptdir=$(pwd)
62+
63+
build_workspace dcfiles targets debug_build
64+
if [ $? != 0 ]; then exit 1; fi

docker-compose-bag.yaml

-10
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,6 @@
1919
# SOFTWARE.
2020

2121
services:
22-
# build
23-
bag:
24-
extends:
25-
file: docker-compose-common.yaml
26-
service: bag-dev
27-
volumes:
28-
- ./docker/home:/home/developer/
29-
profiles:
30-
- build
31-
3222
# dev
3323
bag-dev:
3424
extends:

docker-compose-gnss.yaml

-8
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,6 @@
1919
# SOFTWARE.
2020

2121
services:
22-
# build
23-
rtk_gnss:
24-
extends:
25-
file: docker-compose-common.yaml
26-
service: rtk_gnss-dev
27-
profiles:
28-
- build
29-
3022
# dev
3123
rtk_gnss-dev:
3224
extends:

docker-compose-mapping-gazebo.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020

2121
services:
2222
mapping:
23-
build:
24-
context: ./cabot-navigation/docker/localization
23+
extends:
24+
file: cabot-navigation/docker-compose-common.yaml
25+
service: localization-base
2526
environment:
2627
- DISPLAY
2728
- XAUTHORITY=/tmp/.docker.xauth
@@ -52,6 +53,8 @@ services:
5253
# home
5354
- ./docker/home:/home/developer
5455
# code
56+
- ./cabot-navigation/cabot_site_pkg/${CABOT_SITE}:/home/developer/mapping_ws/install/${CABOT_SITE}
57+
- ./cabot-navigation/cabot_sites:/home/developer/mapping_ws/src/cabot_sites
5558
- ./cabot-drivers/cabot_serial:/home/developer/mapping_ws/src/cabot_serial
5659
- ./cabot-navigation/cabot_mf_localization:/home/developer/mapping_ws/src/cabot_mf_localization
5760
- ./cabot-navigation/mf_localization:/home/developer/mapping_ws/src/mf_localization

docker-compose-mapping.yaml

+8-4
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020

2121
services:
2222
mapping:
23-
build:
24-
context: ./cabot-navigation/docker/localization
23+
extends:
24+
file: cabot-navigation/docker-compose-common.yaml
25+
service: localization-base
2526
environment:
2627
- DISPLAY
2728
- XAUTHORITY=/tmp/.docker.xauth
@@ -64,6 +65,8 @@ services:
6465
# home
6566
- ./docker/home:/home/developer
6667
# code
68+
- ./cabot_site_pkg/${CABOT_SITE}:/home/developer/mapping_ws/install/${CABOT_SITE}
69+
- ./cabot_sites:/home/developer/mapping_ws/src/cabot_sites
6770
- ./cabot-common/cabot_common:/home/developer/mapping_ws/src/cabot_common # log_redirector
6871
- ./cabot-common/cabot_msgs:/home/developer/mapping_ws/src/cabot_msgs # cabot_common dependency
6972
- ./cabot-description/cabot_description:/home/developer/mapping_ws/src/cabot_description # robot model
@@ -88,8 +91,9 @@ services:
8891
command: /launch.sh mapping -C -X
8992

9093
diagnostic:
91-
build:
92-
context: ./cabot-navigation/docker/ros2
94+
extends:
95+
file: cabot-navigation/docker-compose-common.yaml
96+
service: ros2-base
9397
environment:
9498
- DISPLAY
9599
- XAUTHORITY=/tmp/.docker.xauth

docker-compose-nuc.yaml

-8
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@
2222
# services extend from docker-compose-common.yaml
2323

2424
services:
25-
# build
26-
people-nuc:
27-
extends:
28-
file: docker-compose-common.yaml
29-
service: people-nuc-dev
30-
profiles:
31-
- build
32-
3325
# dev
3426
navigation-dev:
3527
extends:

docker-compose-production.yaml

-8
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@
2222
# services environments are overrideed
2323

2424
services:
25-
# build
26-
driver:
27-
extends:
28-
file: docker-compose-common.yaml
29-
service: driver-dev
30-
profiles:
31-
- build
32-
3325
# dev
3426
navigation-dev:
3527
extends:

docker-compose.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,36 @@ services:
4444
profiles:
4545
- build
4646

47+
people-nuc:
48+
extends:
49+
file: docker-compose-common.yaml
50+
service: people-nuc-dev
51+
profiles:
52+
- build
53+
54+
bag:
55+
extends:
56+
file: docker-compose-common.yaml
57+
service: bag-dev
58+
volumes:
59+
- ./docker/home:/home/developer/
60+
profiles:
61+
- build
62+
63+
driver:
64+
extends:
65+
file: docker-compose-common.yaml
66+
service: driver-dev
67+
profiles:
68+
- build
69+
70+
mapping:
71+
extends:
72+
file: docker-compose-mapping.yaml
73+
service: mapping
74+
profiles:
75+
- build
76+
4777
# dev
4878
navigation-dev:
4979
extends:

docker/home/mapping_ws/.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
*
33
# Except this file
44
!.gitignore
5-
!src
5+
!src
6+
!install
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Ignore everything in this directory
2+
*
3+
# Except this file
4+
!.gitignore

0 commit comments

Comments
 (0)