Skip to content

Commit

Permalink
[SPARK-13596][BUILD] Move misc top-level build files into appropriate…
Browse files Browse the repository at this point in the history
… subdirs

## What changes were proposed in this pull request?

Move many top-level files in dev/ or other appropriate directory. In particular, put `make-distribution.sh` in `dev` and update docs accordingly. Remove deprecated `sbt/sbt`.

I was (so far) unable to figure out how to move `tox.ini`. `scalastyle-config.xml` should be movable but edits to the project `.sbt` files didn't work; config file location is updatable for compile but not test scope.

## How was this patch tested?

`./dev/run-tests` to verify RAT and checkstyle work. Jenkins tests for the rest.

Author: Sean Owen <[email protected]>

Closes apache#11522 from srowen/SPARK-13596.
  • Loading branch information
srowen authored and rxin committed Mar 7, 2016
1 parent 8577260 commit 0eea12a
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 49 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ cache
work/
out/
.DS_Store
third_party/libmesos.so
third_party/libmesos.dylib
build/apache-maven*
build/zinc*
build/scala*
Expand Down Expand Up @@ -60,7 +58,6 @@ dev/create-release/*final
spark-*-bin-*.tgz
unit-tests.log
/lib/
rat-results.txt
scalastyle.txt
scalastyle-output.xml
R-unit-tests.log
Expand Down
File renamed without changes.
7 changes: 4 additions & 3 deletions dev/check-license
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ else
declare java_cmd=java
fi

export RAT_VERSION=0.10
export RAT_VERSION=0.11
export rat_jar="$FWDIR"/lib/apache-rat-${RAT_VERSION}.jar
mkdir -p "$FWDIR"/lib

Expand All @@ -67,14 +67,15 @@ mkdir -p "$FWDIR"/lib
exit 1
}

$java_cmd -jar "$rat_jar" -E "$FWDIR"/.rat-excludes -d "$FWDIR" > rat-results.txt
mkdir target
$java_cmd -jar "$rat_jar" -E "$FWDIR"/dev/.rat-excludes -d "$FWDIR" > target/rat-results.txt

if [ $? -ne 0 ]; then
echo "RAT exited abnormally"
exit 1
fi

ERRORS="$(cat rat-results.txt | grep -e "??")"
ERRORS="$(cat target/rat-results.txt | grep -e "??")"

if test ! -z "$ERRORS"; then
echo "Could not find Apache license headers in the following files:"
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion dev/create-release/release-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ if [[ "$1" == "package" ]]; then
# Get maven home set by MVN
MVN_HOME=`$MVN -version 2>&1 | grep 'Maven home' | awk '{print $NF}'`

./make-distribution.sh --name $NAME --mvn $MVN_HOME/bin/mvn --tgz $FLAGS \
./dev/make-distribution.sh --name $NAME --mvn $MVN_HOME/bin/mvn --tgz $FLAGS \
-DzincPort=$ZINC_PORT 2>&1 > ../binary-release-$NAME.log
cd ..
cp spark-$SPARK_VERSION-bin-$NAME/spark-$SPARK_VERSION-bin-$NAME.tgz .
Expand Down
6 changes: 3 additions & 3 deletions dev/lint-python
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ compile_status="${PIPESTATUS[0]}"
#+ See: https://github.com/apache/spark/pull/1744#issuecomment-50982162
#+ TODOs:
#+ - Download pep8 from PyPI. It's more "official".
PEP8_VERSION="1.6.2"
PEP8_VERSION="1.7.0"
PEP8_SCRIPT_PATH="$SPARK_ROOT_DIR/dev/pep8-$PEP8_VERSION.py"
PEP8_SCRIPT_REMOTE_PATH="https://raw.githubusercontent.com/jcrocholl/pep8/$PEP8_VERSION/pep8.py"

Expand Down Expand Up @@ -80,7 +80,7 @@ export "PATH=$PYTHONPATH:$PATH"
#+ first, but we do so so that the check status can
#+ be output before the report, like with the
#+ scalastyle and RAT checks.
python "$PEP8_SCRIPT_PATH" --ignore=E402,E731,E241,W503,E226 $PATHS_TO_CHECK >> "$PEP8_REPORT_PATH"
python "$PEP8_SCRIPT_PATH" --ignore=E402,E731,E241,W503,E226 --config=dev/tox.ini $PATHS_TO_CHECK >> "$PEP8_REPORT_PATH"
pep8_status="${PIPESTATUS[0]}"

if [ "$compile_status" -eq 0 -a "$pep8_status" -eq 0 ]; then
Expand Down Expand Up @@ -122,7 +122,7 @@ fi

# for to_be_checked in "$PATHS_TO_CHECK"
# do
# pylint --rcfile="$SPARK_ROOT_DIR/pylintrc" $to_be_checked >> "$PYLINT_REPORT_PATH"
# pylint --rcfile="$SPARK_ROOT_DIR/python/pylintrc" $to_be_checked >> "$PYLINT_REPORT_PATH"
# done

# if [ "${PIPESTATUS[0]}" -ne 0 ]; then
Expand Down
6 changes: 3 additions & 3 deletions make-distribution.sh → dev/make-distribution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ set -e
set -x

# Figure out where the Spark framework is installed
SPARK_HOME="$(cd "`dirname "$0"`"; pwd)"
SPARK_HOME="$(cd "`dirname "$0"`/.."; pwd)"
DISTDIR="$SPARK_HOME/dist"

MAKE_TGZ=false
Expand All @@ -41,7 +41,7 @@ function exit_with_usage {
echo ""
echo "usage:"
cl_options="[--name] [--tgz] [--mvn <mvn-command>]"
echo "./make-distribution.sh $cl_options <maven build options>"
echo "make-distribution.sh $cl_options <maven build options>"
echo "See Spark's \"Building Spark\" doc for correct Maven options."
echo ""
exit 1
Expand Down Expand Up @@ -104,7 +104,7 @@ fi
if [ $(command -v git) ]; then
GITREV=$(git rev-parse --short HEAD 2>/dev/null || :)
if [ ! -z "$GITREV" ]; then
GITREVSTRING=" (git revision $GITREV)"
GITREVSTRING=" (git revision $GITREV)"
fi
unset GITREV
fi
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/building-spark.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ to the `sharedSettings` val. See also [this PR](https://github.com/apache/spark/

To create a Spark distribution like those distributed by the
[Spark Downloads](http://spark.apache.org/downloads.html) page, and that is laid out so as
to be runnable, use `make-distribution.sh` in the project root directory. It can be configured
to be runnable, use `./dev/make-distribution.sh` in the project root directory. It can be configured
with Maven profile settings and so on like the direct Maven build. Example:

./make-distribution.sh --name custom-spark --tgz -Psparkr -Phadoop-2.4 -Phive -Phive-thriftserver -Pyarn
./dev/make-distribution.sh --name custom-spark --tgz -Psparkr -Phadoop-2.4 -Phive -Phive-thriftserver -Pyarn

For more information on usage, run `./make-distribution.sh --help`
For more information on usage, run `./dev/make-distribution.sh --help`

# Setting up Maven's Memory Usage

Expand Down
4 changes: 2 additions & 2 deletions docs/running-on-mesos.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ To host on HDFS, use the Hadoop fs put command: `hadoop fs -put spark-{{site.SPA


Or if you are using a custom-compiled version of Spark, you will need to create a package using
the `make-distribution.sh` script included in a Spark source tarball/checkout.
the `dev/make-distribution.sh` script included in a Spark source tarball/checkout.

1. Download and build Spark using the instructions [here](index.html)
2. Create a binary package using `make-distribution.sh --tgz`.
2. Create a binary package using `./dev/make-distribution.sh --tgz`.
3. Upload archive to http/s3/hdfs


Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2246,7 +2246,7 @@
<failOnWarning>false</failOnWarning>
<sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
<testSourceDirectory>${basedir}/src/test/scala</testSourceDirectory>
<configLocation>scalastyle-config.xml</configLocation>
<configLocation>dev/scalastyle-config.xml</configLocation>
<outputFile>${basedir}/target/scalastyle-output.xml</outputFile>
<inputEncoding>${project.build.sourceEncoding}</inputEncoding>
<outputEncoding>${project.reporting.outputEncoding}</outputEncoding>
Expand All @@ -2270,7 +2270,7 @@
<failOnWarning>false</failOnWarning>
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
<testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
<configLocation>checkstyle.xml</configLocation>
<configLocation>dev/checkstyle.xml</configLocation>
<outputFile>${basedir}/target/checkstyle-output.xml</outputFile>
<inputEncoding>${project.build.sourceEncoding}</inputEncoding>
<outputEncoding>${project.reporting.outputEncoding}</outputEncoding>
Expand Down
File renamed without changes.
29 changes: 0 additions & 29 deletions sbt/sbt

This file was deleted.

0 comments on commit 0eea12a

Please sign in to comment.