2

I'm using Google Dataproc to initialize a Jupyter cluster. At first I used the "dataproc-initialization-actions" available in github, and it works like a charm.

This is the create cluster Call available in the documentation:

gcloud dataproc clusters create my-dataproc-cluster \
    --metadata "JUPYTER_PORT=8124" \
    --initialization-actions \
        gs://dataproc-initialization-actions/jupyter/jupyter.sh \
    --bucket my-dataproc-bucket \
    --num-workers 2 \
    --properties spark:spark.executorEnv.PYTHONHASHSEED=0,spark:spark.yarn.am.memory=1024m \
    --worker-machine-type=n1-standard-4 \
    --master-machine-type=n1-standard-4

But I want to customize it, so I got the initialization file and saved it o my Google Storage (that is under the same project where I'm trying to create the cluster). So, I changed the call to point to my script instead, like this:

gcloud dataproc clusters create my-dataproc-cluster \
    --metadata "JUPYTER_PORT=8124" \
    --initialization-actions \
        gs://myjupyterbucketname/jupyter.sh \
    --bucket my-dataproc-bucket \
    --num-workers 2 \
    --properties spark:spark.executorEnv.PYTHONHASHSEED=0,spark:spark.yarn.am.memory=1024m \
    --worker-machine-type=n1-standard-4 \
    --master-machine-type=n1-standard-4

But running this I got the following error:

Waiting on operation [projects/myprojectname/regions/global/operations/cf20
466c-ccb1-4c0c-aae6-fac0b99c9a35].
Waiting for cluster creation operation...done.
ERROR: (gcloud.dataproc.clusters.create) Operation [projects/myprojectname/
regions/global/operations/cf20466c-ccb1-4c0c-aae6-fac0b99c9a35] failed: Multiple
 Errors:
 - Google Cloud Dataproc Agent reports failure. If logs are available, they can
be found in 'gs://myjupyterbucketname/google-cloud-dataproc-metainfo/231e5160-75f3-
487c-9cc3-06a5918b77f5/my-dataproc-cluster-m'.
 - Google Cloud Dataproc Agent reports failure. If logs are available, they can
be found in 'gs://myjupyterbucketname/google-cloud-dataproc-metainfo/231e5160-75f3-
487c-9cc3-06a5918b77f5/my-dataproc-cluster-w-1'..

Well the files where there, so I think it may not be some access permission problem. The file named "dataproc-initialization-script-0_output" has the following content:

/usr/bin/env: bash: No such file or directory

Any ideas?

Maviles
  • 3,209
  • 2
  • 25
  • 39
  • This could be because the initialization script is in a Cloud Storage bucket which the project running the cluster is not able to access. Could you try running "gcloud dataproc clusters diagnose my-dataproc-cluster" and share the resulting tarball with dataproc-feedback@google.com – tix Aug 12 '16 at 19:25
  • will do it, thanks – Maviles Aug 12 '16 at 19:57

1 Answers1

4

Well, found my answer here

Turns out the script had windows line endings instead of unix line endings.

Made an online convertion using dos2unix and now it runs fine.

With help from @tix I could check that the file was reacheable using a SSH connection to the cluster (Successful "gsutil cat gs://myjupyterbucketname/jupyter.sh")

AND, the initialization file was correctly saved locally in the directory "/etc/google-dataproc/startup-scripts/dataproc-initialization-script-0"

Community
  • 1
  • 1
Maviles
  • 3,209
  • 2
  • 25
  • 39