Skip to content
Snippets Groups Projects
Commit 041f45f0 authored by Louis Kevin Fink's avatar Louis Kevin Fink
Browse files

feat(docker): update compose configuration and scripts for jetracer profile

parent f014943c
No related branches found
No related tags found
No related merge requests found
Pipeline #402821 failed
......@@ -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
......
......@@ -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}")
......
......@@ -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}")
......
#!/bin/bash
chown -R 1001 ../../data
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
cp .env.linux ../.env
elif [[ "$OSTYPE" == "darwin"* ]]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment