Coder Social home page Coder Social logo

docker-spark's Introduction

spark

An opinionated Spark based container with few additional tools:

  • Scala
  • Sbt
  • AWS-CLI

Based on gettyimages/spark

Intended to be used together with the examples from: https://github.com/dataminelab/LearningSpark

Can be used to run standalone Spark or together with docker-compose.yml can create a local cluster.

docker example

To run SparkPi, run the image with Docker:

docker run --rm -it -p 4040:4040 dataminelab/dev-spark bin/run-example SparkPi 10

Before starting the docker daemon:

# Note we assume that the LearningSpark is checked out on the same level as docker-spark
git clone https://github.com/dataminelab/LearningSpark

To start the docker daemon:

# replace $PWD/LearningSpark with the full path to your LearningSpark
docker run -d --rm --name dev-spark -p 4040:4040 -p 8080:8080 -p 18080:18080 -v $PWD/LearningSpark:/var/examples dataminelab/dev-spark
# to see logs
docker logs -f dev-spark
# to connect with bash to the running container
docker exec -it dev-spark /bin/bash

Note, it might be useful to map ivy files to avoid downloading packages each time docker container is restarted:

mkdir $PWD/.sbt
mkdir $PWD/.ivy2
docker run -d --rm --name dev-spark -p 4040:4040 -p 8080:8080 -p 18080:18080 -v $PWD/LearningSpark:/var/examples -v $PWD/.ivy2:/root/.ivy2 -v $PWD/.sbt/:/root/.sbt/ dataminelab/dev-spark

See dockerhub: https://hub.docker.com/r/dataminelab/dev-spark/

To build locally:

docker build -t dataminelab/dev-spark .

Docker compose

To run a local cluster

To create a simplistic standalone cluster with docker-compose:

docker-compose up -d

The SparkUI will be running at http://${YOUR_DOCKER_HOST}:8080 with one worker listed. To run pyspark, exec into a container:

docker exec -it dockerspark_master_1 /bin/bash
bin/pyspark

To run SparkPi on docker cluster, exec into a container:

docker exec -it dockerspark_master_1 /bin/bash
bin/run-example SparkPi 10

docker-spark's People

Contributors

rathko avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.