Dataproc#
RAPIDS 可以使用 Dask 部署在 Google Cloud Dataproc 上。有关更多详细信息,请参阅我们的 详细说明和辅助脚本。
0. 将初始化操作复制到您自己的 Cloud Storage 存储桶。请勿创建引用位于 gs://goog-dataproc-initialization-actions-REGION
公共存储桶中的初始化操作的集群。这些脚本作为参考实现提供,并与正在进行的 GitHub 仓库更改同步。
强烈建议您将初始化脚本复制到您自己的 Storage 存储桶中,以防止集群中发生意外的上游升级
$ REGION=<region>
$ GCS_BUCKET=<bucket_name>
$ gcloud storage buckets create gs://$GCS_BUCKET
$ gsutil cp gs://goog-dataproc-initialization-actions-${REGION}/gpu/install_gpu_driver.sh gs://$GCS_BUCKET
$ gsutil cp gs://goog-dataproc-initialization-actions-${REGION}/dask/dask.sh gs://$GCS_BUCKET
$ gsutil cp gs://goog-dataproc-initialization-actions-${REGION}/rapids/rapids.sh gs://$GCS_BUCKET
1. 创建包含 Dask RAPIDS 的 Dataproc 集群。使用 gcloud 命令创建一个新集群。由于 Anaconda 版本冲突,在旧镜像上部署脚本速度较慢,我们建议使用 Dataproc 2.0+ 配合 Dask。
警告
截至撰写本文时,Dataproc 仅支持 RAPIDS 23.12 及更早版本,配合 CUDA<=11.8 和 Ubuntu 18.04。
请确保您的设置符合此兼容性要求。使用较新的 RAPIDS 版本可能会导致意外的行为或错误。
$ CLUSTER_NAME=<CLUSTER_NAME>
$ DASK_RUNTIME=yarn
$ RAPIDS_VERSION=23.12
$ CUDA_VERSION=11.8
$ gcloud dataproc clusters create $CLUSTER_NAME\
--region $REGION\
--image-version 2.0-ubuntu18\
--master-machine-type n1-standard-32\
--master-accelerator type=nvidia-tesla-t4,count=2\
--worker-machine-type n1-standard-32\
--worker-accelerator type=nvidia-tesla-t4,count=2\
--initialization-actions=gs://$GCS_BUCKET/install_gpu_driver.sh,gs://$GCS_BUCKET/dask.sh,gs://$GCS_BUCKET/rapids.sh\
--initialization-action-timeout 60m\
--optional-components=JUPYTER\
--metadata gpu-driver-provider=NVIDIA,dask-runtime=$DASK_RUNTIME,rapids-runtime=DASK,rapids-version=$RAPIDS_VERSION,cuda-version=$CUDA_VERSION\
--enable-component-gateway
[GCS_BUCKET] = 要使用的存储桶名称。
[CLUSTER_NAME] = 集群名称。
[REGION] = 创建集群的区域名称。
[DASK_RUNTIME] = Dask 运行时可以设置为 yarn 或 standalone。
2. 运行 Dask RAPIDS 工作负载。集群创建后,Dask 调度程序会在 Dataproc 主节点上的 port 8786
监听 worker,其状态仪表板位于 port 8787
。
要连接到 Dask Web 界面,您需要按照 Dataproc Web 界面文档中的说明创建 SSH 隧道。您还可以通过 Jupyter notebook、Python 脚本或解释器会话使用 Dask Client Python API 进行连接。