powderkeg

viesti 2017-03-14T11:49:49.822238Z

running against a standalone spark 1.5.2 taken off from a downloaded package even gives trouble, but chugging along, since this doesn’t block others 🙂

viesti 2017-03-14T11:50:21.827226Z

quite a beast this

cgrand 2017-03-14T11:53:08.852089Z

what should I run to experience the error?

viesti 2017-03-14T12:36:06.268488Z

downloaded http://d3kbcqa49mib13.cloudfront.net/spark-1.5.2-bin-hadoop2.6.tgz and ran ./sbin/start-all.sh. then on feature/circleci branch of my fork I run lein with-profile spark1.5 repl. In the repl, in user namespace I run (require '[powderkeg.core :as keg]) followed by (keg/connect! “<spark://taskunauris.tiuhtiwlan.net:7077”>) (using hostname of my laptop), then I do (into [] (keg/rdd (range 10))) but get

17/03/14 14:33:27 WARN TaskSetManager: Lost task 0.0 in stage 0.0 (TID 0, 172.16.0.71): java.io.EOFException
	at org.apache.spark.serializer.KryoDeserializationStream.readObject(KryoSerializer.scala:196)
	at org.apache.spark.broadcast.TorrentBroadcast$.unBlockifyObject(TorrentBroadcast.scala:217)
	at org.apache.spark.broadcast.TorrentBroadcast$$anonfun$readBroadcastBlock$1.apply(TorrentBroadcast.scala:178)
	at org.apache.spark.util.Utils$.tryOrIOException(Utils.scala:1175)
	at org.apache.spark.broadcast.TorrentBroadcast.readBroadcastBlock(TorrentBroadcast.scala:165)
	at org.apache.spark.broadcast.TorrentBroadcast._value$lzycompute(TorrentBroadcast.scala:64)
	at org.apache.spark.broadcast.TorrentBroadcast._value(TorrentBroadcast.scala:64)
	at org.apache.spark.broadcast.TorrentBroadcast.getValue(TorrentBroadcast.scala:88)
	at org.apache.spark.broadcast.Broadcast.value(Broadcast.scala:70)
	at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:62)
	at org.apache.spark.scheduler.Task.run(Task.scala:88)
	at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:214)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

cgrand 2017-03-14T13:07:14.628184Z

It’s the kryo version

cgrand 2017-03-14T13:08:00.638733Z

if you change it back to 3.0.3 it works

viesti 2017-03-14T13:23:15.849587Z

ah, so older kryo with 1.5.2

viesti 2017-03-14T13:23:26.852376Z

will try a bit later

viesti 2017-03-14T13:59:19.416997Z

hum, moved kryo-shaded spark2-deps/spark1.5-deps, 3.0.3 on the latter, still same

cgrand 2017-03-14T14:00:09.432591Z

show me your project.clj

cgrand 2017-03-14T14:00:36.441333Z

(I just replaced 4.0.0 by 3.0.3, didn’t move things around)

viesti 2017-03-14T14:07:33.563984Z

(defproject hcadatalab/powderkeg "0.4.7"
  :description "Live-coding Spark clusters!"
  :url "<https://github.com/HCADatalab/powderkeg>"
  :license {:name "Eclipse Public License"
            :url "<http://www.eclipse.org/legal/epl-v10.html>"}

  :aliases {"test-all" ["with-profile" "spark1.5:spark2" "test"]}
  :test-selectors {:default (complement :integration)
                   :integration :integration}
  :profiles {:default [:spark2]
             :spark2 [:leiningen/default :spark2-deps]
             :spark1.5 [:leiningen/default :spark1.5-deps]
             :spark2-deps ^{:pom-scope :provided}
             {:dependencies [[org.apache.spark/spark-core_2.11 "2.1.0"]
                             [org.apache.spark/spark-streaming_2.11 "2.1.0"]
                             [com.esotericsoftware/kryo-shaded "4.0.0"]]}
             :spark1.5-deps ^{:pom-scope :provided}
             {:dependencies [[org.apache.spark/spark-core_2.10 "1.5.2"]
                             [org.apache.spark/spark-streaming_2.10 "1.5.2"]
                             [com.esotericsoftware/kryo-shaded "3.0.3"]]}}
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [net.cgrand/xforms "0.5.1"]
                 [com.twitter/carbonite "1.4.0"
                  :exclusions [com.twitter/chill-java]]
                 [com.cemerick/pomegranate "0.3.0"]]
  :aot [powderkeg.repl]
  :java-source-paths ["src/main/java"]
  :source-paths [”src/main/clojure”])

viesti 2017-03-14T14:09:07.590977Z

hum

viesti 2017-03-14T14:09:28.597166Z

apropo, :target-path "target/%s/"

viesti 2017-03-14T14:09:32.598342Z

comes to my mind

viesti 2017-03-14T14:09:47.602663Z

since we have a few profiles with different deps

viesti 2017-03-14T14:11:37.635556Z

lein clean helped

viesti 2017-03-14T14:12:04.643456Z

should have tried putting “target/%s/” first into :target-path though

viesti 2017-03-14T14:13:46.673530Z

lein help sample says:

;; All generated files will be placed in :target-path. In order to avoid
  ;; cross-profile contamination (for instance, uberjar classes interfering
  ;; with development), it's recommended to include %s in in your custom
  ;; :target-path, which will splice in names of the currently active profiles.
  :target-path “target/%s/”

cgrand 2017-03-14T14:17:04.733869Z

:spark1.5-deps [^{:pom-scope :provided}
             {:dependencies [[org.apache.spark/spark-core_2.10 "1.5.2"]
                             [org.apache.spark/spark-streaming_2.10 "1.5.2"]]}
             {:dependencies [[com.esotericsoftware/kryo-shaded “3.0.3”]]}]

cgrand 2017-03-14T14:17:20.738644Z

works

cgrand 2017-03-14T14:18:11.753904Z

but now don’t we need to push 2 jars?

viesti 2017-03-14T14:19:43.781554Z

ah, true

cgrand 2017-03-14T14:20:38.798224Z

It’s the provided scope that caused you some issues

viesti 2017-03-14T14:25:50.894022Z

ah, true, didn’t notice

viesti 2017-03-14T14:26:33.908258Z

hmm, so we have problem I guess

viesti 2017-03-14T14:27:00.916566Z

spark 1.5.2 works with kryo 3.0.3, spark 2 with kryo 4.0.0

viesti 2017-03-14T14:29:22.961339Z

on the docker side for 1.5.2 in my branch, need to figure out how to specify suitable hostname for the spark running inside docker, now I need to edit /etc/hosts to contain "127.0.0.1 master"

cgrand 2017-03-14T14:32:10.016169Z

two builds then. keg-kryo3 and keg-kryo4

viesti 2017-03-14T14:54:13.432925Z

yep, tracing root cause and circumventing might be difficult

viesti 2017-03-14T20:52:07.814832Z

yei, first build to succeed that runs a simple (keg/rdd (range 10)) against spark 1.5 and spark 2, and runs lein test-all too

viesti 2017-03-14T20:59:59.937749Z

still thinking that docker is troublesome. To be able to connect to spark 1.5 started with docker using default bridged networking, I had to resolve “master” to 127.0.0.1 in /etc/hosts. Funny thing is that using <spark://localhost:7077> works for spark 2 running in docker.

viesti 2017-03-14T21:01:08.957084Z

another option would be require people to download spark binary distribution and make the test call sbin/start-all.sh (sbin/stop-all.sh for stopping)

viesti 2017-03-14T21:02:48.983449Z

for CircleCI, the downloaded/unpacked binary could be stored in a cache (https://circleci.com/docs/1.0/how-cache-works/#nav-button) for later builds

viesti 2017-03-14T21:04:00.001543Z

and seems that even docker caching is troublesome in CircleCI… https://circleci.com/docs/1.0/docker/#caching-docker-layers

viesti 2017-03-14T21:04:33.009909Z

then again, just being able to run lein with-profile spark1.5 test :only powderkeg.integration-test/rdd-spark-1.5.2 is neat too, if one has docker