Giter Site home page Giter Site logo

pyspark_docker's Introduction

Pyspark docker environment

If you simply want to test a single node spark cluster, just run docker run -it wlongxiang/pyspark-2.4.4 pyspark, this will bring you yo spark-shell.

Or you can also create a muti-worker cluster with a simple compose file, the example will mount the data and code local dir to the cluster worker and master such that you can easily change your code and data locally and test it within docker cluster.

  • Checkout the master branch
  • Run docker-compose up to spin up 2 workers and 1 master (or you can also set COMPOSE_FILE env to a diff. compose file)
  • Go to http://localhost:8080 to see the spark master UI
  • Run docker exec -it pyspark_docker_master_1 bash to shell into the spark container
  • word count: spark-submit /code/wordcount.py /data/logs.txt

Supported spark versions: 2.4.4.

Some examples to test out, see code directory.

How to publish a new image (manually)

  • first you do docker login with your credentials to docker-hub
  • then docker build -t wlongxiang/pyspark-2.4.4:<version_tag> ., this command will build your email with name pyspark and tag with 2.4.4
  • verify your image is built successfully by docker images
  • finally docker push wlongxiang/pyspark-2.4.4:<version_tag>, in the end this will be available in your docker repo
  • now, everything should be able to run your image or use it in the docker-compose file, such as docker run -it pyspark-2.4.4:<version_tag> bash

pyspark_docker's People

Contributors

wlongxiang avatar

Stargazers

 avatar  avatar  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.