You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@toree.apache.org by lr...@apache.org on 2016/01/11 22:02:12 UTC

[30/50] [abbrv] incubator-toree git commit: Mods to Makefile to run sbt locally

Mods to Makefile to run sbt locally


Project: http://git-wip-us.apache.org/repos/asf/incubator-toree/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-toree/commit/e312d17c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-toree/tree/e312d17c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-toree/diff/e312d17c

Branch: refs/heads/master
Commit: e312d17c5775c53633e81cb741b5bed99bea74db
Parents: ecfa5dd
Author: Gino Bustelo <pa...@us.ibm.com>
Authored: Wed Dec 2 17:07:56 2015 -0600
Committer: Gino Bustelo <pa...@us.ibm.com>
Committed: Wed Dec 2 17:07:56 2015 -0600

----------------------------------------------------------------------
 Makefile  | 28 ++++++++++++++++++----------
 README.md |  8 ++++++--
 2 files changed, 24 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/e312d17c/Makefile
----------------------------------------------------------------------
diff --git a/Makefile b/Makefile
index b0cafd1..e26a936 100644
--- a/Makefile
+++ b/Makefile
@@ -14,40 +14,48 @@
 # limitations under the License.
 #
 
-.PHONY: clean build init dev test test-travis
+.PHONY: clean clean-dist build dev test test-travis
 
 VERSION?=0.1.5
 IS_SNAPSHOT?=true
 APACHE_SPARK_VERSION?=1.5.1
 
+VM_WORKDIR=/src/spark-kernel
+
+USE_VAGRANT?=
+RUN_PREFIX=$(if $(USE_VAGRANT),vagrant ssh -c "cd $(VM_WORKDIR) && )
+RUN_SUFFIX=$(if $(USE_VAGRANT),")
+
+RUN=$(RUN_PREFIX)$(1)$(RUN_SUFFIX)
+
 ENV_OPTS=APACHE_SPARK_VERSION=$(APACHE_SPARK_VERSION) VERSION=$(VERSION) IS_SNAPSHOT=$(IS_SNAPSHOT)
 
 FULL_VERSION=$(shell echo $(VERSION)`[ "$(IS_SNAPSHOT)" == "true" ] && (echo '-SNAPSHOT')` )
 ASSEMBLY_JAR=$(shell echo kernel-assembly-$(FULL_VERSION).jar )
 
-clean:
-	vagrant ssh -c "cd /src/spark-kernel/ && sbt clean"
-	@-rm -r dist
+clean-dist:
+	-rm -r dist
 
-init:
-	vagrant up
+clean: clean-dist
+	$(call RUN,$(ENV_OPTS) sbt clean)
 
 kernel/target/scala-2.10/$(ASSEMBLY_JAR): ${shell find ./*/src/main/**/*}
 kernel/target/scala-2.10/$(ASSEMBLY_JAR): ${shell find ./*/build.sbt}
 kernel/target/scala-2.10/$(ASSEMBLY_JAR): project/build.properties project/Build.scala project/Common.scala project/plugins.sbt
-	vagrant ssh -c "cd /src/spark-kernel/ && $(ENV_OPTS) sbt kernel/assembly"
+	$(call RUN,$(ENV_OPTS) sbt kernel/assembly)
 
 build: kernel/target/scala-2.10/$(ASSEMBLY_JAR)
 
+dev: VM_WORKDIR=~
 dev: dist
-	vagrant ssh -c "cd ~ && ipython notebook --ip=* --no-browser"
+	$(call RUN,ipython notebook --ip=* --no-browser)
 
 test:
-	vagrant ssh -c "cd /src/spark-kernel/ && $(ENV_OPTS) sbt compile test"
+	$(call RUN,$(ENV_OPTS) sbt compile test)
 
 dist: COMMIT=$(shell git rev-parse --short=12 --verify HEAD)
 dist: VERSION_FILE=dist/spark-kernel/VERSION
-dist: kernel/target/scala-2.10/$(ASSEMBLY_JAR)
+dist: kernel/target/scala-2.10/$(ASSEMBLY_JAR) ${shell find ./etc/bin/*}
 	@mkdir -p dist/spark-kernel/bin dist/spark-kernel/lib
 	@cp -r etc/bin/* dist/spark-kernel/bin/.
 	@cp kernel/target/scala-2.10/$(ASSEMBLY_JAR) dist/spark-kernel/lib/.

http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/e312d17c/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 2115304..8eab2e2 100644
--- a/README.md
+++ b/README.md
@@ -23,17 +23,21 @@ A version of the Spark Kernel is deployed as part of the [Try Jupyter!][try-jupy
 
 Develop
 =======
-[Vagrant][vagrant] is used to simplify the development experience. It is the only requirement to be able to build, package and test the Spark Kernel on your development machine. 
+This project uses `make` as the entry point for build, test, and packaging. It supports 2 modes, local and vagrant. The default is local and all command (i.e. sbt) will be ran locally on your machine. This means that you need to
+install `sbt`, `jupyter/ipython`, and other develoment requirements locally on your machine. The 2nd mode uses [Vagrant][vagrant] to simplify the development experience. In vagrant mode, all commands are sent to the vagrant box 
+that has all necessary dependencies pre-installed. To run in vagrant mode, run `export USE_VAGRANT=true`.  
 
 To build and interact with the Spark Kernel using Jupyter, run
 ```
 make dev
 ```
 
-This will start a Jupyter notebook server accessible at `http://192.168.44.44:8888`. From here you can create notebooks that use the Spark Kernel configured for local mode.
+This will start a Jupyter notebook server. Depending on your mode, it will be accessible at `http://localhost:8888` or `http://192.168.44.44:8888`. From here you can create notebooks that use the Spark Kernel configured for local mode.
 
 Tests can be run by doing `make test`.
 
+>> NOTE: Do not use `sbt` directly.
+
 Build & Package
 ===============
 To build and package up the Spark Kernel, run