【问题标题】:Dask Distributed: How to delete uploaded files from the clusterDask Distributed:如何从集群中删除上传的文件
【发布时间】:2021-08-26 09:36:55
【问题描述】:

我想知道dask.distributed 中是否有一个函数可以删除使用client.upload_file() 上传到集群的文件?

基本上,与upload_file() 函数相反。 最好的问候

【问题讨论】:

    标签: python dask dask-distributed dask-kubernetes


    【解决方案1】:

    截至今天,没有直接执行此操作的函数。但作为一种解决方法,您可以将client.runos.remove 一起使用:

    client.run(lambda dask_worker: os.remove(os.path.join(dask_worker.local_directory, "file.py")))
    

    其中file.py 可以替换为您上传的文件的名称。

    注意client.run的输入参数必须是dask_worker,相关文档在这里:https://distributed.dask.org/en/latest/api.html#distributed.Client.run

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-08-10
      • 2016-08-29
      • 2013-06-27
      • 1970-01-01
      • 2019-12-23
      • 2019-05-05
      • 2021-05-20
      相关资源
      最近更新 更多