# Ray python parallel processing of deep learning model on multiple docker

**URL:** <https://discuss.ray.io/t/ray-python-parallel-processing-of-deep-learning-model-on-multiple-docker/7394>\
**Category:** Ray Client\
**Created:** [August 31, 2022, 8:12am UTC](https://discuss.ray.io/t/ray-python-parallel-processing-of-deep-learning-model-on-multiple-docker/7394 "2022-08-31T08:12:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kartik\_sharma](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/kartik_sharma/32/1880_2.png) [@kartik\_sharma](https://discuss.ray.io/u/kartik_sharma)\
**Post date:** [August 31, 2022, 8:12am UTC](https://discuss.ray.io/t/ray-python-parallel-processing-of-deep-learning-model-on-multiple-docker/7394/1 "2022-08-31T08:12:42Z")

</div>

Hi,  
I have 3 docker containers with each container consisting a deep learning model (tensorflow).  
in each docker container I have a job of batch inference over 1000 images lets say.  
I have create batch inference actor and its parallelising the batches over multiple cpus.

which scenario will be most suited for the above task.

1. each docker container will have separate ray cluster (in each container python code)

2. ray cluster will be configured locally and each docker container will connect to it.

3. ray cluster will be configured as separate docker container and each docker container will connect to it.

4. one of the docker out of three will consist ray and three of the containers will connect it.

Thanks

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [August 31, 2022, 10:43pm UTC](https://discuss.ray.io/t/ray-python-parallel-processing-of-deep-learning-model-on-multiple-docker/7394/2 "2022-08-31T22:43:27Z")

</div>

I think the most common pattern is 4. I think you can look at this doc [Launching an On-Premise Cluster — Ray 3.0.0.dev0](https://docs.ray.io/en/master/cluster/vms/user-guides/launching-clusters/on-premises.html). When you deploy via docker container, make sure all necessary ports are open. [Configuring Ray — Ray 2.0.0](https://docs.ray.io/en/latest/ray-core/configure.html#ports-configurations)

---

<div class="post-metadata">

**Author:** ![kartik\_sharma](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/kartik_sharma/32/1880_2.png) [@kartik\_sharma](https://discuss.ray.io/u/kartik_sharma)\
**Post date:** [September 1, 2022, 4:51am UTC](https://discuss.ray.io/t/ray-python-parallel-processing-of-deep-learning-model-on-multiple-docker/7394/3 "2022-09-01T04:51:07Z")

</div>

Thanks this helps!

I just checked that the dependency on these three docker container would be different like tensorflow , pytorch and someother

On top of it, what if 4th container is added as well with different dependencies

I believe ray cluster would need those dependencies as well, right?  
Any standard way to handle this? 🙂

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [September 1, 2022, 11:42pm UTC](https://discuss.ray.io/t/ray-python-parallel-processing-of-deep-learning-model-on-multiple-docker/7394/4 "2022-09-01T23:42:11Z")

</div>

It is recommended to have the same dependencies on all head & worker nodes. Alternatively, you can use runtime environment to sync dependencies [Environment Dependencies — Ray 3.0.0.dev0](https://docs.ray.io/en/master/ray-core/handling-dependencies.html#runtime-environments)
