Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions test_data/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Apache Spark

Spark is a fast and general cluster computing system for Big Data. It provides
high-level APIs in Scala, Java, Python, and R, and an optimized engine that
supports general computation graphs for data analysis. It also supports a
rich set of higher-level tools including Spark SQL for SQL and DataFrames,
MLlib for machine learning, GraphX for graph processing,
and Spark Streaming for stream processing.

<http://spark.apache.org/>


## Online Documentation

You can find the latest Spark documentation, including a programming
guide, on the [project web page](http://spark.apache.org/documentation.html)
and [project wiki](https://cwiki.apache.org/confluence/display/SPARK).
This README file only contains basic setup instructions.

## Building Spark

Spark is built using [Apache Maven](http://maven.apache.org/).
To build Spark and its example programs, run:

build/mvn -DskipTests clean package

(You do not need to do this if you downloaded a pre-built package.)
More detailed documentation is available from the project site, at
["Building Spark"](http://spark.apache.org/docs/latest/building-spark.html).

## Interactive Scala Shell

The easiest way to start using Spark is through the Scala shell:

./bin/spark-shell

Try the following command, which should return 1000:

scala> sc.parallelize(1 to 1000).count()

## Interactive Python Shell

Alternatively, if you prefer Python, you can use the Python shell:

./bin/pyspark

And run the following command, which should also return 1000:

>>> sc.parallelize(range(1000)).count()

## Example Programs

Spark also comes with several sample programs in the `examples` directory.
To run one of them, use `./bin/run-example <class> [params]`. For example:

./bin/run-example SparkPi

will run the Pi example locally.

You can set the MASTER environment variable when running examples to submit
examples to a cluster. This can be a mesos:// or spark:// URL,
"yarn" to run on YARN, and "local" to run
locally with one thread, or "local[N]" to run locally with N threads. You
can also use an abbreviated class name if the class is in the `examples`
package. For instance:

MASTER=spark://host:7077 ./bin/run-example SparkPi

Many of the example programs print usage help if no params are given.

## Running Tests

Testing first requires [building Spark](#building-spark). Once Spark is built, tests
can be run using:

./dev/run-tests

Please see the guidance on how to
[run tests for a module, or individual tests](https://cwiki.apache.org/confluence/display/SPARK/Useful+Developer+Tools).

## A Note About Hadoop Versions

Spark uses the Hadoop core library to talk to HDFS and other Hadoop-supported
storage systems. Because the protocols have changed in different versions of
Hadoop, you must build Spark against the same version that your cluster runs.

Please refer to the build documentation at
["Specifying the Hadoop Version"](http://spark.apache.org/docs/latest/building-spark.html#specifying-the-hadoop-version)
for detailed guidance on building for a particular distribution of Hadoop, including
building for particular Hive and Hive Thriftserver distributions.

## Configuration

Please refer to the [Configuration Guide](http://spark.apache.org/docs/latest/configuration.html)
in the online documentation for an overview on how to configure Spark.
6 changes: 4 additions & 2 deletions test_pyspark_shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ curr_dir=`cd $curr_dir; pwd`
# Default SPARK_HOME location is already checked by init_spark.sh
spark_home=${SPARK_HOME:='/opt/spark'}
if [ ! -d "$spark_home" ] ; then
>&2 echo "fail - $spark_home does not exist, please check you Spark installation or SPARK_HOME env variable, exinting!"
>&2 echo "fail - $spark_home does not exist, please check you Spark installation or SPARK_HOME env variable, exiting!"
exit -2
else
echo "ok - applying Spark home $spark_home"
Expand Down Expand Up @@ -43,7 +43,9 @@ fi
pushd `pwd`
cd $spark_home
hdfs dfs -mkdir -p spark/test/
hdfs dfs -put $spark_home/README.md spark/test/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will removing this break test suite on existing clusters?
As far as I know, test suites are often ran after a maintenance to verify the status of a cluster.


# Including spark README.md in test_data to differentiate from sparkexample README.md
hdfs dfs -put "$spark_test_dir/test_data/README.md" spark/test/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice that the README.md do exist in both https://github.com/Altiscale/sparkexample/blob/branch-2.3.2-alti/README.md and https://github.com/Altiscale/spark/blob/branch-2.3.2-alti/README.md although the one in sparkexample is pretty empty with one line of content.

The subject is misleading as well, it is enabling? I thought this test case always run, it is enabled all the time https://github.com/Altiscale/sparkexample/blob/branch-2.3.2-alti/run_all_test.kerberos.sh#L11

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. The README.md file is present in both the repositories. This has more to do with the spark rpms. The test picks up README.md from $spark_home/ directory and hence should have been ideally present inside /opt/alti-spark-2.3.2/ directory. I am guessing while setting up the environment, the script does not copy the README file(https://github.com/Altiscale/sparkbuild/blob/branch-2.3.2-alti/scripts/justinstall.sh) as it does for 1.6.1(https://github.com/Altiscale/sparkbuild/blob/branch-1.6-alti/scripts/spark.spec#L365) and 2.1.1
(https://github.com/Altiscale/sparkbuild/blob/branch-2.1.1-alti/scripts/spark.spec#L314).
I thought we did not want to mess with the spark rpm and discussed that we could include it as a part of sparkexample rpm. Also, I just wanted the README.md to have some significant content and wanted to avoid conflict with already existing sparkexample README, hence included it in the test_data directory.
We could include a change to copy over the README.md in sparkbuild repo as well => changes to spark rpm.
For the subject, yep, I think I might need some other wordings.


# Leverage a simple use case here
hdfs dfs -put "$spark_test_dir/src/main/resources/spam_sample.txt" spark/test/
Expand Down