Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Restructure docker-compose files & Removed b5 run tasks #276

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
if: github.event_name == 'pull_request'
env:
AGENT_VERSION: ${{ needs.build-and-push-image.outputs.version }}
COMPOSE_FILE: ./build/docker-compose.test.yml
COMPOSE_FILE: ./build/docker-compose_cicd.yaml
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down
42 changes: 1 addition & 41 deletions build/Taskfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,6 @@
# General commands
##########################################

task:run() {
# assure that docker can connect to the local X11-server
xhost +local:docker
docker:compose up "$@"
}

task:run_dev() {
xhost +local:docker
docker:compose -f docker-compose.dev.yaml up
}

task:run_distributed() {
xhost +local:docker
docker:compose -f docker-compose.distributed.yaml up
}

task:run_dev_distributed() {
xhost +local:docker
docker:compose -f docker-compose.dev.distributed.yaml up
}

task:restart() {
container="$1"
docker:compose restart "${container:-agent}"
}

task:halt() {
docker:compose down "$@"
}

task:shell() {
container="$1"
command="$2"
Expand All @@ -58,7 +28,7 @@ install:gpu-support() {

if [ -z "$(command -v docker-nvidia)" ]
then
task:nvidia:enable
echo -e "Juhu! Alles ist richtig installiert für NVIDIA-Support! Hier ein Keks für dich :D"
else
RED='\033[0;31m'
NC='\033[0m'
Expand All @@ -68,16 +38,6 @@ install:gpu-support() {
fi
}

task:update() {
docker:update
}

task:nvidia:enable() {
# Writes the content of templates/config.nvidia.yml.jinja2 to config.local.yml
# This file tells b5 to read docker-compose.nvidia.yml in addition to docker-compose.yml
template:render --overwrite ask-if-older templates/config.nvidia.yml.jinja2 config.local.yml
}

##########################################
# Project linting
##########################################
Expand Down
47 changes: 47 additions & 0 deletions build/agent_service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
services:
agent:
build:
dockerfile: build/docker/agent/Dockerfile
args:
- USER_UID=${DOCKER_HOST_UNIX_UID:-1000}
- USER_GID=${DOCKER_HOST_UNIX_GID:-1000}
context: ../
init: true
tty: true
shm_size: 2gb
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: [ gpu ]
# executes default command specified in agent Dockerfile
# build/docker/agent/Dockerfile
logging:
driver: "local"
environment:
- DISPLAY
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
- ROS_MASTER_URI=http://roscore:11311
- CARLA_SIM_HOST=carla-simulator
- ROS_HOSTNAME=agent
- XDG_RUNTIME_DIR=/tmp/runtime-carla
# - ROUTE=/opt/leaderboard/data/routes_devtest.xml
# Simple route without special scenarios
- ROUTE=/workspace/code/routes/routes_simple.xml
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
# if you change the volume here also change the copy command
# in ``build/docker/build/Dockerfile
- ../:/workspace
# mount git config for dvc
- ../.gitconfig:/home/carla/.gitconfig
- ../:/workspace/
networks:
- carla
- ros

networks:
carla:
ros:
31 changes: 31 additions & 0 deletions build/carla-simulator_service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
services:
# based on https://github.com/ll7/paf21-1/blob/master/scenarios/docker-carla-sim-compose.yml
carla-simulator:
command: /bin/bash CarlaUE4.sh -quality-level=Epic -world-port=2000 -resx=800 -resy=600 -nosound -carla-settings="/home/carla/CarlaUE4/Config/CustomCarlaSettings.ini"
image: ghcr.io/una-auxme/paf23:leaderboard-2.0
init: true
deploy:
resources:
limits:
memory: 16G
reservations:
devices:
- driver: nvidia
capabilities: [ gpu ]
expose:
- 2000
- 2001
- 2002
environment:
- DISPLAY
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
- XDG_RUNTIME_DIR=/tmp/runtime-carla
networks:
- carla
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
- ./CustomCarlaSettings.ini:/home/carla/CarlaUE4/Config/CustomCarlaSettings.ini

networks:
carla:
1 change: 1 addition & 0 deletions build/config-comlipy.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# comlipy config file (commit naming)
global:
help: 'Help: https://github.com/ll7/paf22/blob/main/doc/developement/commit.md'

Expand Down
1 change: 1 addition & 0 deletions build/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# b5 config file
modules:
template:
docker:
77 changes: 0 additions & 77 deletions build/docker-compose.dev.distributed.yaml

This file was deleted.

105 changes: 0 additions & 105 deletions build/docker-compose.dev.yaml

This file was deleted.

Loading
Loading