达斯克没有';t清理docker容器中的上下文
我们有一个Dask管道,其中基本上使用达斯克没有';t清理docker容器中的上下文,docker,dask,dask-distributed,Docker,Dask,Dask Distributed,我们有一个Dask管道,其中基本上使用LocalCluster作为进程池。i、 e.我们使用LocalCluster启动集群(进程=True,线程数=1)。像这样: dask_cluster = LocalCluster(processes=True, threads_per_worker=1) with Client(dask_cluster) as dask_client: exit_code = run_processing(input_file, dask_cli
LocalCluster
作为进程池。i、 e.我们使用LocalCluster启动集群(进程=True,线程数=1)
。像这样:
dask_cluster = LocalCluster(processes=True, threads_per_worker=1)
with Client(dask_cluster) as dask_client:
exit_code = run_processing(input_file, dask_client, db_state).value
我们的工作流和任务并行在本地运行时效果非常好。但是,当我们将代码复制到Docker容器(基于centos)中时,处理完成,并且当容器退出时,有时会出现以下错误:
Traceback (most recent call last):^M
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/multiprocessing/queues.py", line 240, in _feed^M
send_bytes(obj)^M
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/multiprocessing/connection.py", line 200, in send_bytes^M
self._send_bytes(m[offset:offset + size])^M
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/multiprocessing/connection.py", line 404, in _send_bytes^M
self._send(header + buf)^M
File "/opt/rh/rh-python36/root/usr/lib64/python3.6/multiprocessing/connection.py", line 368, in _send^M
n = write(self._handle, buf)^M
BrokenPipeError: [Errno 32] Broken pipe^M
此外,我们得到了这个错误的多个实例,这使我认为这个错误是来自被放弃的工作进程。我们目前的工作原理是,这与问题有关,但如果不从完全不同的docker形象开始,我们不知道如何解决问题,我们不想这样做
是否有办法仅使用Dask群集/客户端清理方法解决此问题?您应该将群集创建为上下文管理器。它实际上是启动流程的东西,而不是客户机
with LocalCluster(...):
...
好。。。那太尴尬了。我真不敢相信解决办法竟然如此琐碎。也许这会帮助其他人,真的。感谢您提出有关堆栈溢出的令人尴尬的问题。这就是它在这里的目的:)