Sign inSign up

wiseupdata/pyspark

By wiseupdata

โ€ขUpdated over 3 years ago

Image
0

411

wiseupdata/pyspark repository overview

Wise Up Data's Instagram โ  wise Up Data's Discord โ  wise Up Data | Twitter โ  wise Up Data's LinkedIN โ 

Visitors license


โ  Docker image

Pyspark docker images! ๐Ÿš€๏ธ

โ Simple to use โค๏ธ

docker run -it wiseupdata/pyspark bash

โ Summary ๐Ÿ“ƒ


โ Version 3.4.0 โœจ๏ธ

  • Pyspark 3.4.0

  • Ubuntu 22.04.2 LTS end of life April 2032 - Official

  • Python 3.10 - Official

  • OpenJDK8 - Officialโ 

  • Kubernetes Ready and Tested!

  • Userspark Restrict user NO sudo

  • UserUbuntu sudo

  • Simple shell, type:

    • pyspark and have fun with Python and Spark! โค๏ธ
    • spark and have fun with Scala and Spark! ๐Ÿซ€
    • python import the pyspark and have fun!
  • Made with A.I. contribution ๐Ÿค–

  • Dockerfileโ 

    This setup it's the same for the tags: 3.4.0 and 3.4.0-ubuntu-22.04

๐Ÿš€ This docker was built on top of Apache, to be resilient and ready for debug, so it's light enough! If you need something different try the pure Apache docker!


Example with specific version ๐Ÿ’ป:

docker run -it wiseupdata/pyspark:3.4.0 bash
docker run -it wiseupdata/pyspark:3.4.0-ubuntu-22.04 bash
โ Inside made easy! ๐Ÿ˜
โ Type pyspark and enjoy Python with Spark!
pyspark
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /__ / .__/\_,_/_/ /_/\_\   version 3.4.0
      /_/

Using Python version 3.10.11 (main, May  2 2023 14:04:10)
โ Type spark and enjoy it Scala with Spark!
pyspark
Welcome to
      ____              __
     / __/__  ___ _____/ /__
    _\ \/ _ \/ _ `/ __/  '_/
   /___/ .__/\_,_/_/ /_/\_\   version 3.4.0
      /_/
         
Using Scala version 2.12.17 (OpenJDK 64-Bit Server VM, Java 1.8.0_372)
โ Info ๐Ÿ”Ž
โ Tests ๐Ÿงช
โ Pyspark

Type python or pyspark and test!

from pyspark.sql import SparkSession

spark = SparkSession.builder.appName("TestPySpark").getOrCreate()
data = [("Alice", 1), ("Bob", 2), ("Charlie", 3)]
df = spark.createDataFrame(data, ["Name", "Age"])
df.show()

spark.stop()
exit()
โ Scala

Type spark and test!

import org.apache.spark.sql.SparkSession

val spark = SparkSession.builder.appName("Spark Scala Test").getOrCreate()
val df = Seq((1, "John"), (2, "Jane"), (3, "Jim")).toDF("id", "name")
df.show()

spark.stop()
:quit

โ Create your own image to dockerhub ๐Ÿฅณ

click here!โ–ถ๏ธ

โ Simple customization example. ๐ŸŽข

  • Update the Dockerfile and run the command bellow
  • Build the image
docker build -t pyspark ./versions/3.4.0 --no-cache
  • Test the image
docker run -it --rm pyspark bash
  • Force the running for debug mode - Useful for Kubernetes
docker run --name pyspark -d --rm pyspark bash run
docker exec -it pyspark bash

# Exit and kill
exit
docker rm pyspark -f
  • Log in to your account ๐Ÿคœ
docker login -u wiseupdata
  • Create a tag ๐Ÿคบ
docker tag pyspark wiseupdata/pyspark
docker tag pyspark wiseupdata/pyspark:3.4.0
docker tag pyspark wiseupdata/pyspark:3.4.0-ubuntu-22.04
docker tag pyspark wiseupdata/pyspark:3.4.0-ubuntu-22.04-jdk8
  • push your image to dockerhub โ™จ๏ธ
docker push wiseupdata/pyspark
docker push wiseupdata/pyspark:3.4.0
docker push wiseupdata/pyspark:3.4.0-ubuntu-22.04
docker push wiseupdata/pyspark:3.4.0-ubuntu-22.04-jdk8
โ Test the image ๐ŸŽข
docker run -it wiseupdata/pyspark:3.4.0 bash

โ Utils ๐ŸŽ

click here!โ–ถ๏ธ

list all container

docker ps -a

kill all containers โ˜ ๏ธ

docker rm $(docker ps -a -q) -f

list the images

docker image ls -a

delete one image

docker image rm pyspark -f

Delete all images โ˜ ๏ธ

docker image rm  $(docker image ls -a ) -f

Force run โ˜ ๏ธ

docker run -it --entrypoint /bin/bash pyspark





โ References ๐ŸŒ ๐Ÿ—„๏ธ

  1. GitHub Repositoryโ 
  2. WiseUpDataโ 
  3. Emojisโ 
  4. OpenJDKโ 
  5. Apache Dockerfileโ 
  6. Apache Dockerfile 2โ 
  7. Kubectlโ 



โ Maintainer ๐Ÿค— ๐Ÿ‘จโ€๐Ÿ’ป

Silvio Liborio

๐Ÿ“ง [email protected]โ 

silvio-de-melo-liborio LinkedIN โ 


back to top โซ โ 





Tag summary

Content type

Image

Digest

sha256:c22eac3b1โ€ฆ

Size

1.1 GB

Last updated

over 3 years ago

docker pull wiseupdata/pyspark