【发布时间】:2020-07-25 23:36:03
【问题描述】:
作为gcloud dataproc 上的PySpark Job 的一部分,我们有多个文件,其中一个是json,它被传递给驱动程序python 文件。驱动程序文件本身位于谷歌存储(gs 文件系统)上。
我们正在尝试使用gcloud dataproc api for python 提交此作业。
submit_job中job对象使用的配置是:
job_details = {
'placement': {
'cluster_name': cluster_name
},
'pyspark_job': {
'main_python_file_uri': 'gs://driver_file.py',
'python_file_uris':['gs://package.whl'],
'file_uris':['gs://config.json'],
'args':['gs://config.json']
}
}
我的理解是 config.json 应该提供给驱动程序,gcloud 可以从日志中正确执行 - Downloading gs://config.json to /tmp/tmprandomnumber/fop_gcp_1.json
从gcloud documentation page 的file_uris 看来,这似乎是正确的-
要复制到 Python 工作目录的文件的 HCFS URI 驱动程序和分布式任务。对于单纯的并行任务很有用。
现在经过大量调试,我们偶然发现了SparkFiles.get('config.json'),它旨在获取基于此question 上传到驱动程序的文件
但这也失败了[Errno 2] No such file or directory: '/hadoop/spark/tmp/spark-random-number/userFiles-random-number/config.json'
【问题讨论】:
标签: python apache-spark google-cloud-platform pyspark google-cloud-dataproc