TediPapajorgji opened a new pull request #21974:
URL: https://github.com/apache/airflow/pull/21974
This PR adds the ability to pass `device_requests` to the DockerOperator
during initialization. This is useful for enabling GPU support in the
DockerOperator.
This also opens the door to exposing all other host resources to the docker
container.
As an example, with this change, here is how one could expose all GPU's on
the host machine to the docker container:
```
train = DockerOperator(
task_id='<your-id>',
image='<your-image>',
api_version='auto',
auto_remove=True,
command='<your-command'>,
device_requests=[
docker.types.DeviceRequest(count=-1, capabilities=[['gpu']])
# Add all gpu's to the container
]
)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]