-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SW-889] Port AWS preparation scripts into SW codebase (#769)
- Loading branch information
Showing
5 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
apply plugin: 'base' | ||
description = "Templates for Sparkling Water deployment" | ||
|
||
|
||
/** | ||
* We can't use Sphinx substitutions in for example code blocks and other container, so we post-process | ||
* the generated files manually | ||
*/ | ||
task substituteAWS(){ | ||
doLast { | ||
def aws_script = "${project.buildDir.toString()}/aws/install_sparkling_water_${version.replace('-SNAPSHOT', '')}.sh" | ||
def contents = file(aws_script).getText('UTF-8') | ||
def (first, second, third) = version.replace("-SNAPSHOT", "").tokenize(".") | ||
def majorVersion = "${first}.${second}" | ||
def minorVersion = third | ||
def branchName = version.toString().endsWith("nightly") ? "master" : "rel-${majorVersion}" | ||
contents = contents | ||
.replaceAll("SUBST_BRANCH_NAME", branchName) | ||
.replaceAll("SUBST_MAJOR_VERSION", majorVersion) | ||
.replaceAll("SUBST_MINOR_VERSION", minorVersion) | ||
|
||
file(aws_script).write(contents, 'UTF-8') | ||
} | ||
} | ||
|
||
|
||
task copyAWS(type: Copy) { | ||
from 'src/aws' | ||
into "build/aws" | ||
rename "install_sparkling_water.sh", "install_sparkling_water_${version.replace('-SNAPSHOT', '')}.sh" | ||
} | ||
|
||
substituteAWS.dependsOn copyAWS | ||
build.dependsOn substituteAWS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
set -x -e | ||
|
||
|
||
# AWS EMR bootstrap script | ||
# for installing Sparkling Water on AWS EMR with Spark | ||
# | ||
############################## | ||
|
||
## Python installations and libraries needed on the worker roles in order to get PySparkling working | ||
|
||
sudo python -m pip install --upgrade pip | ||
sudo python -m pip install --upgrade colorama | ||
|
||
sudo ln -sf /usr/local/bin/pip2.7 /usr/bin/pip | ||
|
||
#mkdir -p /home/h2o | ||
|
||
sudo pip install -U requests | ||
sudo pip install -U tabulate | ||
sudo pip install -U future | ||
sudo pip install -U six | ||
|
||
#Scikit Learn on the nodes | ||
sudo pip install -U scikit-learn | ||
|
||
mkdir -p /home/hadoop/h2o | ||
cd /home/hadoop/h2o | ||
|
||
echo -e "\n Installing sparkling water version SUBST_MAJOR_VERSION.SUBST_MINOR_VERSION " | ||
|
||
wget http://h2o-release.s3.amazonaws.com/sparkling-water/SUBST_BRANCH_NAME/SUBST_MINOR_VERSION/sparkling-water-SUBST_MAJOR_VERSION.SUBST_MINOR_VERSION.zip & | ||
wait | ||
|
||
unzip -o sparkling-water-SUBST_MAJOR_VERSION.SUBST_MINOR_VERSION.zip 1> /dev/null & | ||
wait | ||
|
||
export MASTER="yarn-client" | ||
|