nchammas / flintrock

A command-line tool for launching Apache Spark clusters.
Apache License 2.0
638 stars 116 forks source link

Launching test cluster returns errors #151

Closed trefoilai closed 8 years ago

trefoilai commented 8 years ago

Installed Flintrock with python 3.5. When launching a test cluster I got returned the following


Traceback (most recent call last):
  File "/usr/bin/flintrock", line 11, in <module>
    sys.exit(main())
  File "/usr/lib64/python3.5/site-packages/flintrock/flintrock.py", line 1034, in main
    cli(obj={})
  File "/usr/lib/python3.5/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.5/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.5/site-packages/click/core.py", line 1057, in invoke
    Command.invoke(self, ctx)
  File "/usr/lib/python3.5/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.5/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib64/python3.5/site-packages/flintrock/flintrock.py", line 171, in cli
    config_raw = yaml.safe_load(f)
  File "/usr/lib64/python3.5/site-packages/yaml/__init__.py", line 94, in safe_load
    return load(stream, SafeLoader)
  File "/usr/lib64/python3.5/site-packages/yaml/__init__.py", line 72, in load
    return loader.get_single_data()
  File "/usr/lib64/python3.5/site-packages/yaml/constructor.py", line 35, in get_single_data
    node = self.get_single_node()
  File "/usr/lib64/python3.5/site-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/lib64/python3.5/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/lib64/python3.5/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib64/python3.5/site-packages/yaml/composer.py", line 133, in compose_mapping_node
    item_value = self.compose_node(node, item_key)
  File "/usr/lib64/python3.5/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/lib64/python3.5/site-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
  File "/usr/lib64/python3.5/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  File "/usr/lib64/python3.5/site-packages/yaml/parser.py", line 439, in parse_block_mapping_key
    "expected <block end>, but found %r" % token.id, token.start_mark)
yaml.parser.ParserError: while parsing a block mapping
  in "/home/ec2-user/.config/flintrock/config.yaml", line 44, column 3
expected <block end>, but found '<scalar>'
  in "/home/ec2-user/.config/flintrock/config.yaml", line 48, column 5

Does these errors has to do with the Python version. Here-under my config file

########################################################################## 
services:
  spark:
    version: 2.0.0
    # git-commit: latest  # if not 'latest', provide a full commit SHA; e.g. d6dc12ef0146ae409834c78737c116050961f350
    # git-repository:  # optional; defaults to https://github.com/apache/spark
    # optional; defaults to download from from the official Spark S3 bucket
    #   - must contain a {v} template corresponding to the version
    #   - Spark must be pre-built
    #   - must be a tar.gz file
    # download-source: "https://www.example.com/files/spark/{v}/spark-{v}.tar.gz"
  hdfs:
    version: 2.7.2
    # optional; defaults to download from a dynamically selected Apache mirror
    #   - must contain a {v} template corresponding to the version
    #   - must be a .tar.gz file
    # download-source: "https://www.example.com/files/hadoop/{v}/hadoop-{v}.tar.gz"
provider: ec2
providers:
  ec2:
    key-name: trefoil_keyname
    identity-file: ./trefoil_keyname.pem
    instance-type: m4.large
    region: eu-west-1
    # availability-zone: <name>
    ami: ami-d41d58a7   # Amazon Linux, eu-west-1
    user: ec2-user
    # ami: ami-61bbf104   # CentOS 7, us-east-1
    # user: centos
    # spot-price: <price>
    # vpc-id: <id>
    # subnet-id: <id>
    # placement-group: <name>
    # security-groups:
    #   - group-name1
    #   - group-name2
    # instance-profile-name:
    tenancy: default  # default | dedicated
    ebs-optimized: no  # yes | no
    instance-initiated-shutdown-behavior: terminate  # terminate | stop
launch:
  num-slaves: 1
  # install-hdfs: True
  # install-spark: False
##########################################################################

nchammas commented 8 years ago

The error suggests you have an error in your YAML file. Can you edit your post to properly format the code? The error should be easy to spot.

nchammas commented 8 years ago

Hi @trefoilai - You can edit your original post instead of posting a separate comment. That would be clearer.

Looking at the text of your YAML file, it appears to have all leading whitespace removed. That would be a problem, since the indentation is significant.

You can reset the config file by deleting it and rerunning flintrock configure (ignoring the issue you reported in #150). Preserve the indentation and you should be fine.

nchammas commented 8 years ago

@trefoilai - Your updated config file looks valid to me. That should work. Are you sure those are the contents of /home/ec2-user/.config/flintrock/config.yaml?

nchammas commented 8 years ago

Closing this issue due to lack of activity. If you are still having problems @trefoilai, please comment here and I would be happy to reopen it.