Skip to content

Commit

Permalink
More bug fixes to handle building Spark at a commit (#197)
Browse files Browse the repository at this point in the history
* more bug fixes to handle building Spark at a commit
* update change log
  • Loading branch information
nchammas authored Apr 19, 2017
1 parent 0626b11 commit 6e8b7f4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
5 changes: 3 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@

* [#195]: After launching a new cluster, Flintrock now shows the
master address and login command.
* [#196]: Fixed a bug that was preventing Flintrock from launching
Spark clusters at a specific commit.
* [#196], [#197]: Fixed some bugs that were preventing Flintrock from
launching Spark clusters at a specific commit.

[#195]: https://github.com/nchammas/flintrock/pull/195
[#196]: https://github.com/nchammas/flintrock/pull/196
[#197]: https://github.com/nchammas/flintrock/pull/197

## [0.8.0] - 2017-02-11

Expand Down
2 changes: 1 addition & 1 deletion flintrock/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def generate_template_mapping(
'hadoop_version': hadoop_version,
'hadoop_short_version': '.'.join(hadoop_version.split('.')[:2]),
'spark_version': spark_version,
'spark_short_version': '.'.join(spark_version.split('.')[:2]),
'spark_short_version': '.'.join(spark_version.split('.')[:2]) if '.' in spark_version else spark_version,

'hadoop_root_dir': hadoop_root_dir,
'hadoop_ephemeral_dirs': hadoop_ephemeral_dirs,
Expand Down
2 changes: 1 addition & 1 deletion flintrock/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def configure(
mapping=generate_template_mapping(
cluster=cluster,
hadoop_version=self.hadoop_version,
spark_version=self.version,
spark_version=self.version or self.git_commit,
))),
p=shlex.quote(template_path)))

Expand Down
11 changes: 9 additions & 2 deletions tests/test_core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import pytest

# Flintrock
from flintrock.core import (
Expand All @@ -12,7 +13,13 @@
os.path.realpath(__file__))))


def test_templates(dummy_cluster):
@pytest.mark.parametrize(
'spark_version', [
(''),
('2.1.1'),
('0626b11147133b67b26a04b4819f61a33dd958d3'),
])
def test_templates(dummy_cluster, spark_version):
template_dir = os.path.join(FLINTROCK_ROOT_DIR, 'flintrock', 'templates')
for (dirpath, dirnames, filenames) in os.walk(template_dir):
if filenames:
Expand All @@ -21,7 +28,7 @@ def test_templates(dummy_cluster):
mapping = generate_template_mapping(
cluster=dummy_cluster,
hadoop_version='',
spark_version='',
spark_version=spark_version,
)
get_formatted_template(
path=template_path,
Expand Down

0 comments on commit 6e8b7f4

Please sign in to comment.