diff --git a/copier.yml b/copier.yml index 48640b6..7bd2481 100644 --- a/copier.yml +++ b/copier.yml @@ -24,6 +24,11 @@ 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: Enabling nvidia gpus make deployment much more complicated. Ensure you have the nvidia container toolkit working properly. + HEALTHCHECK: defualt: --start-period=60s --start-interval=1s CMD /ros_entrypoint.sh rostopic list type: str diff --git a/src/docker-compose.yml.jinja b/src/docker-compose.yml.jinja index 42e318b..3b474b2 100644 --- a/src/docker-compose.yml.jinja +++ b/src/docker-compose.yml.jinja @@ -19,6 +19,15 @@ services: nofile: soft: 1024 hard: 524288 +{% if ENABLE_GPU %} + deploy: + resources: + reservations: + devices: + - driver: cdi + device_ids: + - nvidia.com/gpu=all +{{% endif %} networks: sdk: