简体   繁体   English

在 Docker 容器上实现 Dask 调度程序和工作程序

[英]Implementing Dask scheduler and workers on Docker containers

I need to run a scikit-learn RandomForestClassifier with multiple processes in parallel.我需要并行运行多个进程的 scikit-learn RandomForestClassifier。 For that, I'm looking into implementing a Dask scheduler with N workers, where the scheduler and each worker run in a separate Docker container.为此,我正在考虑使用 N 个工作人员实现 Dask 调度程序,其中调度程序和每个工作人员在单独的 Docker 容器中运行。

The client application, that also runs in a separate Docker container, will first connect to the scheduler and initiate the scikit-learn process with with joblib.parallel_backend('dask'): .客户端应用程序也运行在单独的 Docker 容器中,将首先连接到调度程序并with joblib.parallel_backend('dask'):启动 scikit-learn 进程。

The data to train the machine learning model is stored in parquet in the client application Docker container.用于训练机器学习 model 的数据存储在客户端应用程序 Docker 容器中的 parquet 中。 What is the best practice to have the workers access the data?让工作人员访问数据的最佳做法是什么? Should the data be located somewhere else, in a shared directory?数据是否应该位于其他地方,在共享目录中?

Since Apach Parquet is a files-system based, it all depends on the architecture that you are building, meaning will your project run on a single server or it will be distributed across multiple servers.由于 Apache Parquet 是基于文件系统的,这完全取决于您正在构建的体系结构,这意味着您的项目将在单个服务器上运行还是分布在多个服务器上。

If you are running on a single server, then simple share of the docker volume between the containers, or even a common mount over the local file storage will do the job.如果您在单个服务器上运行,那么在容器之间简单地共享docker volume ,甚至是在本地文件存储上的公共挂载都可以完成这项工作。

If, on the other hand, you are trying to set up a distributed training over multiple servers, then you will need some type of file server to handle the files.另一方面,如果您尝试在多个服务器上设置分布式训练,那么您将需要某种类型的文件服务器来处理文件。

One of the simple ways to share files is trough an NFS server and one of the commonly used images for this is erichough/nfs-server .共享文件的一种简单方法是通过NFS服务器,其中一种常用的图像是erichough/nfs-server You will need to use this container to export the local folder(s) where the files are stored and you will need to mount the fs on the remaining servers.您将需要使用此容器export存储文件的本地文件夹,并且您需要在其余服务器上mount fs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM