GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
2
Releases
Issues
3
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
nigel.stanger
/
docker-analytics
Browse code
Added spark configuration file
master
spark3
1 parent
83a7a05
commit
bc420cb03cf219860d621db22ff6654fa85d395e
Nigel Stanger
authored
on 14 May 2019
Patch
Showing
4 changed files
spark/Dockerfile
spark/spark-defaults.conf
spark/start-master.sh
spark/start-worker.sh
Ignore Space
Show notes
View
spark/Dockerfile
FROM python:3.6-alpine ENV SPARK_VERSION="2.4.3" \ HADOOP_VERSION="2.7" \ SPARK_INSTALL="/usr/local" RUN apk add --no-cache \ bash \ openjdk8 \ tini \ zeromq RUN apk add --no-cache --virtual .fetch-deps \ curl \ tar RUN curl -s https://www-us.apache.org/dist/spark/spark-$SPARK_VERSION/spark-$SPARK_VERSION-bin-hadoop$HADOOP_VERSION.tgz | tar -xz -C $SPARK_INSTALL && \ cd $SPARK_INSTALL && ln -s spark-$SPARK_VERSION-bin-hadoop$HADOOP_VERSION spark RUN apk del .fetch-deps COPY start-master.sh start-worker.sh /usr/local/bin/ ENV SPARK_HOME="$SPARK_INSTALL/spark" \ SPARK_LOCAL_IP="localhost" \ SPARK_MASTER_PORT="7077" \ SPARK_MASTER_WEBUI_PORT="8080" COPY spark-defaults.conf $SPARK_HOME/conf ENV SPARK_MASTER="spark://$SPARK_LOCAL_IP:$SPARK_MASTER_PORT" # Spark doesn't seem to respond directly to SIGTERM as the exit status is # for SIGKILL (137), after a pause. Presumably docker-compose down times out. # Using tini gives immediate exit with status 143 (SIGTERM). ENTRYPOINT ["/sbin/tini", "--"] CMD ["/usr/local/bin/start-master.sh"]
FROM python:3.6-alpine ENV SPARK_VERSION="2.4.3" \ HADOOP_VERSION="2.7" \ SPARK_INSTALL="/usr/local" RUN apk add --no-cache \ bash \ openjdk8 \ tini \ zeromq RUN apk add --no-cache --virtual .fetch-deps \ curl \ tar RUN curl -s https://www-us.apache.org/dist/spark/spark-$SPARK_VERSION/spark-$SPARK_VERSION-bin-hadoop$HADOOP_VERSION.tgz | tar -xz -C $SPARK_INSTALL && \ cd $SPARK_INSTALL && ln -s spark-$SPARK_VERSION-bin-hadoop$HADOOP_VERSION spark RUN apk del .fetch-deps COPY start-master.sh start-worker.sh /usr/local/bin/ ENV SPARK_HOME="$SPARK_INSTALL/spark" \ SPARK_LOCAL_IP="localhost" \ SPARK_MASTER_PORT="7077" \ SPARK_MASTER_WEBUI_PORT="8080" ENV SPARK_MASTER="spark://$SPARK_LOCAL_IP:$SPARK_MASTER_PORT" # Spark doesn't seem to respond directly to SIGTERM as the exit status is # for SIGKILL (137), after a pause. Presumably docker-compose down times out. # Using tini gives immediate exit with status 143 (SIGTERM). ENTRYPOINT ["/sbin/tini", "--"] CMD ["/usr/local/bin/start-master.sh"]
Ignore Space
Show notes
View
spark/spark-defaults.conf
0 → 100644
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # Default system properties included when running spark-submit. # This is useful for setting default environmental settings. # Example: # spark.master spark://master:7077 # spark.eventLog.enabled true # spark.eventLog.dir hdfs://namenode:8021/directory # spark.serializer org.apache.spark.serializer.KryoSerializer # spark.driver.memory 5g # spark.executor.extraJavaOptions -XX:+PrintGCDetails -Dkey=value -Dnumbers="one two three" spark.deploy.defaultCores 2 spark.cores.max 2
Ignore Space
Show notes
View
spark/start-master.sh
#!/bin/sh $SPARK_HOME/bin/spark-class org.apache.spark.deploy.master.Master \ --host $SPARK_HOSTNAME \ --port $SPARK_MASTER_PORT \ --webui-port $SPARK_MASTER_WEBUI_PORT \ --properties-file $SPARK_HOME/conf/spark-defaults.conf
#!/bin/sh $SPARK_HOME/bin/spark-class org.apache.spark.deploy.master.Master \ --ip $SPARK_LOCAL_IP \ --port $SPARK_MASTER_PORT \ --webui-port $SPARK_MASTER_WEBUI_PORT
Ignore Space
Show notes
View
spark/start-worker.sh
#!/bin/sh $SPARK_HOME/bin/spark-class org.apache.spark.deploy.worker.Worker \ --webui-port $SPARK_WORKER_WEBUI_PORT \ --properties-file $SPARK_HOME/conf/spark-defaults.conf \ $SPARK_MASTER
#!/bin/sh $SPARK_HOME/bin/spark-class org.apache.spark.deploy.worker.Worker \ --webui-port $SPARK_WORKER_WEBUI_PORT \ $SPARK_MASTER
Show line notes below