Compare commits

...

2 Commits

Author SHA1 Message Date
Alex Davies 5792496ab2 More cleanup and user friendlieness tweaks 2024-09-19 11:31:49 -03:00
Alex Davies f0fce2dc54 Added flag for enabling nvidia gpu 2024-09-19 11:25:59 -03:00
3 changed files with 25 additions and 3 deletions

View File

@ -24,7 +24,18 @@ LANGUAGES:
RUN_COMMAND: rosrun {{ PACKAGE_NAME }} {{ "main.py" if 'Python' in LANGUAGES else "main" if "CPP" in LANGUAGES else "yourcommandGoes here" }}
ENABLE_NVIDIA_GPU:
default: False
type: bool
help: |
ENABLE_NVIDIA_GPU
Enabling nvidia gpus make deployment much more complicated.
Ensure you have the nvidia container toolkit installed and
working properly.
HEALTHCHECK:
defualt: --start-period=60s --start-interval=1s CMD /ros_entrypoint.sh rostopic list
defualt: HEALTHCHECK --start-period=60s --start-interval=1s CMD /ros_entrypoint.sh rostopic list
type: str
help: It's important to have a good health check. This health check just sees if we can talk to the ROS master
help: |
Set a health check.
This stub health check just sees if we can talk to the ROS master

View File

@ -14,7 +14,9 @@ WORKDIR /root/catkin_ws/src
COPY ./ {{PACKAGE_NAME}}
RUN apt-get clean
HEALTHCHECK {{HEALTHCHECK}}
#Don't forget to set a healthcheck for your container!
{{HEALTHCHECK}}
# Command to run your application
CMD {{RUN_COMMAND}} --wait --screen

View File

@ -19,6 +19,15 @@ services:
nofile:
soft: 1024
hard: 524288
{% if ENABLE_NVIDIA_GPU %}
deploy:
resources:
reservations:
devices:
- driver: cdi
device_ids:
- nvidia.com/gpu=all
{% endif %}
networks:
sdk: