Repository: incubator-systemml Updated Branches: refs/heads/master 39351749f -> fb5309808
[SYSTEMML-1440] Automate Release Artifact verification Closes #475. Project: http://git-wip-us.apache.org/repos/asf/incubator-systemml/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-systemml/commit/fb530980 Tree: http://git-wip-us.apache.org/repos/asf/incubator-systemml/tree/fb530980 Diff: http://git-wip-us.apache.org/repos/asf/incubator-systemml/diff/fb530980 Branch: refs/heads/master Commit: fb53098087fd75c6312aa7bf5e3e5bfd9c2260a2 Parents: 3935174 Author: Arvind Surve <[email protected]> Authored: Thu Apr 27 23:13:58 2017 -0700 Committer: Arvind Surve <[email protected]> Committed: Thu Apr 27 23:13:58 2017 -0700 ---------------------------------------------------------------------- dev/release/release-verify.sh | 1 - dev/release/src/test/bin/verifyBuild.sh | 18 +++++++++-- .../src/test/python/matrix_sum_example.py | 33 ++++++++++++++++++++ 3 files changed, 49 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/fb530980/dev/release/release-verify.sh ---------------------------------------------------------------------- diff --git a/dev/release/release-verify.sh b/dev/release/release-verify.sh index ddccb5b..ad999f9 100755 --- a/dev/release/release-verify.sh +++ b/dev/release/release-verify.sh @@ -167,7 +167,6 @@ fi if [[ "$BIN_VERIFY" == "true" ]]; then echo "`date +%Y-%m-%dT%H:%M:%S`: INFO: Verifying binary files for runtime execution..." -# java -classpath ../../../../..//target/lib/commons-compress-1.4.1.jar:../../../../..//target/lib/commons-io-2.4.jar:. org/apache/sysml/validation/ValidateBuildAndBinary $TAG $WORK_DIR $EXEC_DIR/src/test/bin/verifyBuild.sh $TAG $WORK_DIR RET_CODE=$? if [[ $RET_CODE == 0 ]]; then http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/fb530980/dev/release/src/test/bin/verifyBuild.sh ---------------------------------------------------------------------- diff --git a/dev/release/src/test/bin/verifyBuild.sh b/dev/release/src/test/bin/verifyBuild.sh index 1133bc8..22ebd0e 100755 --- a/dev/release/src/test/bin/verifyBuild.sh +++ b/dev/release/src/test/bin/verifyBuild.sh @@ -164,10 +164,24 @@ runCommand "$SPARK_HOME/bin/spark-submit systemml-$VER_NAME-incubating.jar -s \" echo "`date +%Y-%m-%dT%H:%M:%S`: INFO: Verifying Hadoop batch mode..." echo "`date +%Y-%m-%dT%H:%M:%S`: INFO: Verifying Hadoop batch mode..." >> $OUT_FILE runCommand "$HADOOP_HOME/bin/hadoop jar systemml-$VER_NAME-incubating.jar -s \"print('hello world');\"" -runCommand "cd ../.." +runCommand "cd ../../" + + +## Verify Python scripts through spark-submit +echo "`date +%Y-%m-%dT%H:%M:%S`: INFO: Verifying Python scripts..." +echo "`date +%Y-%m-%dT%H:%M:%S`: INFO: Verifying Python scripts..." >> $OUT_FILE +runCommand "pip install --upgrade systemml-$VER_NAME-incubating-python.tgz" +runCommand "cd ../../../" +runCommand "$SPARK_HOME/bin/spark-submit src/test/python/matrix_sum_example.py" + +runCommand "$SPARK_HOME/bin/spark-submit target/release/incubator-systemml/src/main/python/tests/test_matrix_agg_fn.py" +runCommand "$SPARK_HOME/bin/spark-submit target/release/incubator-systemml/src/main/python/tests/test_matrix_binary_op.py" +runCommand "$SPARK_HOME/bin/spark-submit target/release/incubator-systemml/src/main/python/tests/test_mlcontext.py" +runCommand "$SPARK_HOME/bin/spark-submit target/release/incubator-systemml/src/main/python/tests/test_mllearn_df.py" +runCommand "$SPARK_HOME/bin/spark-submit target/release/incubator-systemml/src/main/python/tests/test_mllearn_numpy.py" + echo "`date +%Y-%m-%dT%H:%M:%S`: INFO: Verification of binary files completed successfully." # echo "================================================================================" exit 0 - http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/fb530980/dev/release/src/test/python/matrix_sum_example.py ---------------------------------------------------------------------- diff --git a/dev/release/src/test/python/matrix_sum_example.py b/dev/release/src/test/python/matrix_sum_example.py new file mode 100644 index 0000000..585a30e --- /dev/null +++ b/dev/release/src/test/python/matrix_sum_example.py @@ -0,0 +1,33 @@ +#!/usr/bin/python +#------------------------------------------------------------- +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +#------------------------------------------------------------- + +import systemml as sml +import numpy as np + +from pyspark import SparkContext +sc = SparkContext() + +m1 = sml.matrix(np.ones((3,3)) + 2) +m2 = sml.matrix(np.ones((3,3)) + 3) +m2 = m1 * (m2 + m1) +m4 = 1.0 - m2 +m4.sum(axis=1).toNumPy()
