Sign inSign up

kmalik/spark-web-app

By kmalik

•Updated almost 11 years ago

Simple spark web application

Image
0

7.4K

kmalik/spark-web-app repository overview

⁠Dockerfile


FROM aether/ubuntu-spark:14.04-1.4.2-attributes
ADD target/spark-web-app.jar /spark-web-app.jar
ENTRYPOINT ["/bin/sh", "-c", "$SPARK_HOME/bin/spark-submit --class com.kmalik.sample.SparkWebApp spark-web-app.jar $*"]

⁠Usage

sudo docker run --net=host -it kmalik/spark-web-app

Port : 8080

Spark endpoints :

  • GET /pi?points={points}&slices={slices} : compute value of pi, by looping over RDD of points (default 100000), split into slices (default 4)

Regular endpoints :

  • GET / : redirect to /status
  • GET /status : print running
  • GET /hello?name={name} : print 'Hello {name}'
  • POST /map?key={key}&value={value} : set key-value pair, print previous value for key if any
  • GET /map : print map
  • GET /map?key={key} : print value for key
  • DELETE /map : clear map, print
  • DELETE /map?key={key} : remove value for key, print
  • POST /exit : System.exit(1)

⁠Source

https://github.com/kapil-malik/sample-apps/tree/master/spark-web-app⁠

Tag summary

Content type

Image

Digest

sha256:780efb362…

Size

573.7 MB

Last updated

almost 11 years ago

docker pull kmalik/spark-web-app