From 7b40c876982187973730af0ae3b4eccc608f7b9b Mon Sep 17 00:00:00 2001 From: Robert Metzger Date: Mon, 23 Sep 2013 16:07:22 +0200 Subject: [PATCH] Travis support for new profiles, readme, comments in script --- .travis.yml | 6 +++--- README.md | 28 +++++++++++++++++++++++++++- tools/generate_specific_pom.sh | 20 +++++++++----------- 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 403ba6bd91527..55e5e6535feb8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,9 @@ jdk: - openjdk7 - openjdk6 env: - - PROFILE=hadoop_v1 - - PROFILE=hadoop_yarn + - PROFILE= + - PROFILE="-Dhadoop.profile=2" install: true -script: "mvn -P$PROFILE clean verify" +script: "mvn $PROFILE clean verify" diff --git a/README.md b/README.md index d5c494d9ccd3a..1fe8dbbc60992 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,33 @@ If you’re a Debian/Ubuntu user, you’ll find a .deb package. We will continue cd stratosphere-dist/target/stratosphere-dist-0.2-ozone-bin/stratosphere-0.2-ozone/ -Note: The directory structure here looks like the contents of the official release distribution. +The directory structure here looks like the contents of the official release distribution. + +#### Build for different Hadoop Versions +This section is for advanced users that want to build Stratosphere for a different Hadoop version, for example for Hadoop Yarn support. + +We use the profile activation via properties (-D). + +##### Build hadoop v1 (default) +Build the default (currently hadoop 1.2.1) +```mvn clean package``` + +Build for a specific hadoop v1 version +```mvn -Dhadoop-one.version=1.1.2 clean package``` + +##### Build hadoop v2 (yarn) + +Build the yarn using the default version defined in the pom +```mvn -Dhadoop.profile=2 clean package``` + +Build for a specific hadoop v1 version +```mvn -Dhadoop.profile=2 -Dhadoop-two.version=2.1.0-beta clean package``` + +It is necessary to generate separate POMs if you want to deploy to your local repository (`mvn install`) or somewhere else. +We have a script in `/tools` that generates POMs for the profiles. Use +```mvn -f pom.hadoop2.xml clean install -DskipTests``` +to put a POM file with the right dependencies into your local repository. + ### Run your first program diff --git a/tools/generate_specific_pom.sh b/tools/generate_specific_pom.sh index 9226c622229ab..405acd062111e 100755 --- a/tools/generate_specific_pom.sh +++ b/tools/generate_specific_pom.sh @@ -57,17 +57,15 @@ nupom="pom.${hadoop_version}.xml" poms=`find $ozone_home -name pom.xml` for p in $poms; do nuname="`dirname $p`/${nupom}" - # Now we do search and replace of explicit strings. The best - # way of seeing what the below does is by doing a diff between - # the original pom and the generated pom (pom.xml.hadoop1 or - # pom.xml.hadoop2). We replace the compat.module variable with - # either hbase-hadoop1-compat or hbase-hadoop2-compat, we - # replace the version string in all poms, we change modules - # to include reference to the non-standard pom name, we - # adjust relative paths so child modules can find the parent pom, - # and we enable/disable hadoop 1 and hadoop 2 profiles as - # appropriate removing a comment string too. We output the - # new pom beside the original. + # Now we do search and replace of explicit strings. The best way of + # seeing what the below does is by doing a diff between the original + # pom and the generated pom (pom.hadoop1.xml or pom.hadoop2.xml). We + # replace the version string in all poms, we change modules to + # include reference to the non- standard pom name, we adjust + # relative paths so child modules can find the parent pom, and we + # enable/disable hadoop 1 and hadoop 2 profiles as appropriate + # removing a comment string too. We output the new pom beside the + # original. sed -e "s/${old_ozone_version}/${new_ozone_version}/" \ -e "s/\([^<]*\)/\1\/${nupom}/" \ -e "s/\(relativePath>\.\.\)/\1\/${nupom}/" \