Skip to content

Commit

Permalink
Add resources limits for notebook and spark-master services
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwenyihust committed Feb 26, 2024
1 parent c83eaba commit e24e2dd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
25 changes: 25 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,29 @@ services:
- ENVIRONMENT=development
command: "start-notebook.sh --NotebookApp.token='' --NotebookApp.password=''"
pull_policy: always
deploy:
resources:
limits:
cpus: "1"
memory: 1g

spark-master:
image: wenyixu101/spark:3.5.0-python3.11
container_name: spark-master
ports:
- "4040:4040"
- "8080:8080"
- "7077:7077"
environment:
- SPARK_MASTER_HOST=spark-master
- SPARK_MODE=master
- SPARK_MASTER_PORT=7077
- SPARK_MASTER_WEBUI_PORT=8080
command: "/opt/spark/bin/spark-class org.apache.spark.deploy.master.Master"
pull_policy: always
deploy:
resources:
limits:
cpus: "1"
memory: 1g

4 changes: 2 additions & 2 deletions docker/jupyter-notebook/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,5 @@ def create_spark_dev():
# else:
# raise ValueError(f"Invalid environment: {environment}")

spark = create_spark_dev()
display_msg()
# spark = create_spark_dev()
# display_msg()

0 comments on commit e24e2dd

Please sign in to comment.