solarcleanopanelai opened a new issue, #28496:
URL: https://github.com/apache/airflow/issues/28496

   ### Apache Airflow Provider(s)
   
   docker
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Apache Airflow version
   
   2.5.0-python3.7
   
   ### Operating System
   
   Ubuntu 22.04.1 LTS
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   Docker Compose version v2.13.0
   
   `docker build . --tag extending_airflow_v2:latest && docker-compose up 
airflow-init && docker-compose up -d --no-deps --build airflow-webserver 
airflow-scheduler && docker-compose up`
   
   docker-compose.yaml file:
   
[docker-compose.txt](https://github.com/apache/airflow/files/10270149/docker-compose.txt)
   
   Dockerfile:
   
[Dockerfile.txt](https://github.com/apache/airflow/files/10270158/Dockerfile.txt)
   
   
   ### What happened
   
   Hello, I'm facing a problem related to the DockerOperator.
   
   ### **Here is what I am trying to implement :** 
   I want to implement a DAG that start a docker container using this image: 
_ultralytics/yolov5:v7.0_ 
   In order to run the python file train.py that use the nvidia gpu.
   
   Then, I created this DAG (test):
   
![image](https://user-images.githubusercontent.com/117445552/208708174-5e08415a-5918-40fc-9910-5f6364dbe949.png)
   
   So it works, **without the GPU**, that's the log:
   
![image](https://user-images.githubusercontent.com/117445552/208709019-2724e68a-927a-4c3f-9c6f-954e3ed99ecd.png)
   
   
[log-success-without-gpu.txt](https://github.com/apache/airflow/files/10269959/log-success-without-gpu.txt)
   
   **But when I try to run with uncomment line 31 of my DAG (docker.py above) 
to have the device_request (theoretically that's find all gpus available).**
   
![image](https://user-images.githubusercontent.com/117445552/208709755-cbe9626b-7dc2-45b4-8d70-b3674d624240.png)
   
   And here is the result:
   
![image](https://user-images.githubusercontent.com/117445552/208710437-53075f78-90f4-4514-9ea7-33ccb28095c0.png)
   
   
[log-failed-with-gpu.txt](https://github.com/apache/airflow/files/10270028/log-failed-with-gpu.txt)
   
   ### **yolov5 Container tested localy and it work**
   Into a command prompt:
   `sudo docker run --ipc=host -it --gpus all ultralytics/yolov5:v7.0`
   and
   `python train.py`
   
   See the result:
   
![image](https://user-images.githubusercontent.com/117445552/208712045-d995a7a9-79c4-4eae-b28b-a8ad5ad56289.png)
   
   
   
   
   ### What you think should happen instead
   
   _No response_
   
   ### How to reproduce
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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]

Reply via email to