Skip to content

Commit

Permalink
Add detach flag for Docker > 24
Browse files Browse the repository at this point in the history
  • Loading branch information
larsll committed Dec 22, 2024
1 parent bc2339c commit 29591f6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
7 changes: 6 additions & 1 deletion bin/activate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,12 @@ if [[ -n "${DR_MINIO_COMPOSE_FILE}" ]]; then
export MINIO_GID=$(id -g)
export MINIO_GROUPNAME=$(id -g -n)
if [[ "${DR_DOCKER_STYLE,,}" == "swarm" ]]; then
docker stack deploy $DR_MINIO_COMPOSE_FILE s3

if [ "$DR_DOCKER_MAJOR_VERSION" -gt 24 ]; then
DETACH_FLAG="--detach=true"
fi

docker stack deploy $DR_MINIO_COMPOSE_FILE $DETACH_FLAG s3
else
docker compose $DR_MINIO_COMPOSE_FILE -p s3 up -d
fi
Expand Down
7 changes: 6 additions & 1 deletion scripts/evaluation/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,12 @@ fi

# Check if we will use Docker Swarm or Docker Compose
if [[ "${DR_DOCKER_STYLE,,}" == "swarm" ]]; then
DISPLAY=$ROBO_DISPLAY docker stack deploy $COMPOSE_FILES $STACK_NAME

if [ "$DR_DOCKER_MAJOR_VERSION" -gt 24 ]; then
DETACH_FLAG="--detach=true"
fi

DISPLAY=$ROBO_DISPLAY docker stack deploy $COMPOSE_FILES $DETACH_FLAG $STACK_NAME
else
DISPLAY=$ROBO_DISPLAY docker compose $COMPOSE_FILES -p $STACK_NAME up -d
fi
Expand Down
6 changes: 5 additions & 1 deletion scripts/training/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ if [[ "${DR_DOCKER_STYLE,,}" == "swarm" ]]; then
exit 1
fi

DISPLAY=$ROBO_DISPLAY docker stack deploy $COMPOSE_FILES $STACK_NAME
if [ "$DR_DOCKER_MAJOR_VERSION" -gt 24 ]; then
DETACH_FLAG="--detach=true"
fi

DISPLAY=$ROBO_DISPLAY docker stack deploy $COMPOSE_FILES $DETACH_FLAG $STACK_NAME

else
DISPLAY=$ROBO_DISPLAY docker compose $COMPOSE_FILES -p $STACK_NAME up -d --scale robomaker=$DR_WORKERS
Expand Down
6 changes: 5 additions & 1 deletion scripts/viewer/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,12 @@ STACK_NAME="deepracer-$DR_RUN_ID-viewer"
COMPOSE_FILES=$DR_DIR/docker/docker-compose-webviewer.yml

if [[ "${DR_DOCKER_STYLE,,}" == "swarm" ]]; then
if [ "$DR_DOCKER_MAJOR_VERSION" -gt 24 ]; then
DETACH_FLAG="--detach=true"
fi

COMPOSE_FILES="$COMPOSE_FILES -c $DR_DIR/docker/docker-compose-webviewer-swarm.yml"
docker stack deploy -c $COMPOSE_FILES $STACK_NAME
docker stack deploy -c $COMPOSE_FILES $DETACH_FLAG $STACK_NAME
else
docker compose -f $COMPOSE_FILES -p $STACK_NAME up -d
fi
Expand Down

0 comments on commit 29591f6

Please sign in to comment.