Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Daisuke Sato <[email protected]>
  • Loading branch information
daisukes committed Nov 25, 2024
1 parent e324863 commit 469facb
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 144 deletions.
8 changes: 2 additions & 6 deletions bake-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,11 @@ if [[ $build_server -eq 1 ]]; then
server_com="docker buildx bake -f docker-compose-server.yaml $platform_option"
echo $server_com
eval $server_com
fi

if [[ $location_tools -eq 1 ]]; then
elif [[ $location_tools -eq 1 ]]; then
location_com="docker buildx bake -f docker-compose-location-tools.yaml $platform_option"
echo $location_com
eval $location_com
fi

if [[ -n $base_name ]]; then
elif [[ -n $base_name ]]; then
base_com="docker buildx bake -f docker-compose.yaml $platform_option $@"
export BASE_IMAGE=$base_name
echo $base_com
Expand Down
39 changes: 10 additions & 29 deletions docker-compose-common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,8 @@ services:
extends: localization-prod-base

# server
map_base:
map_server:
image: cmucal/cabot-map_server
build:
context: ./docker/server
args:
Expand All @@ -418,9 +419,9 @@ services:
- "./server"
- "run"
- "defaultServer"
# depends_on:
# mongodb:
# condition: service_healthy
depends_on:
mongodb:
condition: service_healthy
ports:
- 127.0.0.1:9090:9090 # only localhost can access this server
networks:
Expand All @@ -431,24 +432,11 @@ services:
timeout: 3s
retries: 10 # increased from 5, needs more time to launch on Jetson

map_server-dev:
extends: map_base

map_server-prod:
extends: map_base
image: cmucal/cabot-map_server

map_data:
build:
context: ./docker/server
args:
- USERNAME=runner_user
env_file:
- ${ENV_FILE:-.empty-env}
- .env
# depends_on:
# map_server:
# condition: service_healthy
image: cmucal/cabot-map_server
depends_on:
map_server:
condition: service_healthy
command:
- "bash"
- "-c"
Expand All @@ -475,7 +463,7 @@ services:
retries: 5


location_tools-base:
location_tools:
build:
context: ./docker/server
dockerfile: Dockerfile.location-tools
Expand Down Expand Up @@ -510,13 +498,6 @@ services:
timeout: 3s
retries: 10 # increased from 5, needs more time to launch on Jetson

location_tools-dev:
extends: location_tools-base

location_tools-prod:
extends: location_tools-base
image: cmucal/cabot-location-tools

mongodb_lt:
image : mongo:4.4.25 # the latest v4 version as of Nov. 2023, works without server side modification
environment:
Expand Down
36 changes: 0 additions & 36 deletions docker-compose-location-tools-prodimg.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions docker-compose-location-tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ services:
location_tools:
extends:
file: docker-compose-common.yaml
service: location_tools-dev
service: location_tools

mongodb_lt:
extends:
file: docker-compose-common.yaml
Expand Down
44 changes: 0 additions & 44 deletions docker-compose-server-prodimg.yaml

This file was deleted.

11 changes: 4 additions & 7 deletions docker-compose-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,16 @@ services:
map_server:
extends:
file: docker-compose-common.yaml
service: map_server-dev
service: map_server

map_data:
extends:
file: docker-compose-common.yaml
service: map_data
depend_on:
map_server:
condition: service_healthy


mongodb:
extends:
file: docker-compose-common-server.yaml
file: docker-compose-common.yaml
service: mongodb

networks:
Expand Down
24 changes: 4 additions & 20 deletions server-launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ function help()
echo "-l location tools server"
echo "-X <port> expose port to outside (set port like 80, 9090, ...)"
echo "-E 1-10 separate environment (ROS_DOMAIN_ID, CABOT_MAP_SERVER_HOST) for simultaneous launch"
echo "-P prodcuct image "
}

pwd=`pwd`
Expand All @@ -83,9 +82,8 @@ port_access=127.0.0.1
environment=
launch_prefix=
MAP_SERVER_PORT=9090
prodimg_server=0

while getopts "hd:E:p:fvcClX:P" arg; do
while getopts "hd:E:p:fvcClX:" arg; do
case $arg in
h)
help
Expand Down Expand Up @@ -119,9 +117,6 @@ while getopts "hd:E:p:fvcClX:P" arg; do
X)
port_access=0.0.0.0
export MAP_SERVER_PORT=$OPTARG
P)
prodimg_server=1
;;
esac
done
shift $((OPTIND-1))
Expand Down Expand Up @@ -158,11 +153,7 @@ if [[ $clean_server -eq 2 ]]; then
fi

if [[ $location_tools -eq 1 ]]; then
if [ $prodimg -eq 1 ]; then
docker compose -p $launch_prefix -f docker-compose-location-tools-prodimg.yaml up -d
else
docker compose -p $launch_prefix -f docker-compose-location-tools.yaml up -d
fi
docker compose -p $launch_prefix -f docker-compose-location-tools.yaml up -d
exit 0
fi

Expand Down Expand Up @@ -254,15 +245,8 @@ if [ $error -eq 1 ] && [ $ignore_error -eq 0 ]; then
exit 2
fi

dcfile=docker-compose
if [[ $prodimg_server -eq 1 ]]; then
dcfile="${dcfile}-server-prodimg"
blue "map_server-prod"
else
dcfile="${dcfile}-server"
blue "map_server"
fi
dcfile="${dcfile}.yaml"
dcfile=docker-compose-server.yaml
blue "map_server"

export CABOT_SERVER_DATA_MOUNT=$data_dir
export PORT_ACCESS=$port_access
Expand Down

0 comments on commit 469facb

Please sign in to comment.