diff --git a/setup/compose.yml b/setup/compose.yml index 2c25c514cdb8efb7a5e460dc9fc32eb187d537be..4d4488944a80d3fbbd019a52d62a22f799433ca8 100644 --- a/setup/compose.yml +++ b/setup/compose.yml @@ -6,6 +6,7 @@ services: args: - INSTALL_GAZEBO_SIM=false - INSTALL_X11=false + network: host image: uppaal2jetracer:latest container_name: uppaal2jetracer devices: @@ -16,8 +17,6 @@ services: - jetracer volumes: - ../data:/home/jetson/data - - /dev/ttyACM0:/dev/ttyACM0 - - /dev/ttyACM1:/dev/ttyACM1 command: > /bin/bash -c " source /opt/ros/jazzy/setup.bash && @@ -34,6 +33,7 @@ services: args: - INSTALL_GAZEBO_SIM=true - INSTALL_X11=true + network: host image: uppaal2jetracer:latest container_name: uppaal2jetracer privileged: true # Allows access to hardware devices @@ -62,6 +62,7 @@ services: args: - INSTALL_GAZEBO_SIM=false - INSTALL_X11=false + network: host image: uppaal2jetracer:latest container_name: uppaal2jetracer privileged: true # Allows access to hardware devices diff --git a/setup/scripts/build.py b/setup/scripts/build.py index 2cf10a27fb1af72c711fd9d1263b5383992010b3..b3be8fadd2a1ea81a3a043afac9a3d94acaa1c19 100644 --- a/setup/scripts/build.py +++ b/setup/scripts/build.py @@ -31,7 +31,10 @@ def construct_build_command(profile: str): """ Construct the build command based on the profile """ - build_command = ["docker", "compose"] + if profile == "jetracer": + build_command = ["docker-compose"] + else: + build_command = ["docker", "compose"] if profile: build_command.extend(["--profile", profile]) build_command.extend(["build"]) @@ -64,7 +67,7 @@ def main(): build_command = construct_build_command(profile) print(f"Running command: {' '.join(build_command)}") try: - subprocess.run(build_command, cwd=COMPOSE_DIR, shell=True, check=True) + subprocess.run(build_command, cwd=COMPOSE_DIR, check=True) except subprocess.CalledProcessError as e: print(f"Error building the images: {e}") diff --git a/setup/scripts/run.py b/setup/scripts/run.py index b01aa23872e9e3c33c2617921ee3eeb4cbbad848..89951567888071047f1ddb05407d5cc19c17d929 100644 --- a/setup/scripts/run.py +++ b/setup/scripts/run.py @@ -31,12 +31,15 @@ def construct_run_command(profile: str): """ Construct the run command based on the profile """ - build_command = ["docker", "compose"] + if profile == "jetracer": + run_command = ["docker-compose"] + else: + run_command = ["docker", "compose"] if profile: - build_command.extend(["--profile", profile]) - build_command.extend(["up"]) + run_command.extend(["--profile", profile]) + run_command.extend(["up"]) - return build_command + return run_command def main(): @@ -64,7 +67,7 @@ def main(): run_command = construct_run_command(profile) print(f"Running command: {' '.join(run_command)}") try: - subprocess.run(run_command, cwd=COMPOSE_DIR, shell=True, check=True) + subprocess.run(run_command, cwd=COMPOSE_DIR, check=True) except subprocess.CalledProcessError as e: print(f"Error: {e}") diff --git a/setup/scripts/setup.sh b/setup/scripts/setup.sh index d3c128e280893ea7387ae36a7940711ee696b1c2..e9e44cbbc929eee765eeee8eaf5fb14d0ca50b75 100644 --- a/setup/scripts/setup.sh +++ b/setup/scripts/setup.sh @@ -1,5 +1,7 @@ #!/bin/bash +chown -R 1001 ../../data + if [[ "$OSTYPE" == "linux-gnu"* ]]; then cp .env.linux ../.env elif [[ "$OSTYPE" == "darwin"* ]]; then