-
Notifications
You must be signed in to change notification settings - Fork 28.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-22648] [K8S] Spark on Kubernetes - Documentation #19946
Changes from all commits
2720c88
4ccf59b
14bee00
b18d1ba
9594462
679b5c7
67abb93
a7e0c4c
74ac5c9
d235847
702162b
8726154
374ddc8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/usr/bin/env bash | ||
|
||
# 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. | ||
# | ||
|
||
# This script builds and pushes docker images when run from a release of Spark | ||
# with Kubernetes support. | ||
|
||
declare -A path=( [spark-driver]=kubernetes/dockerfiles/driver/Dockerfile \ | ||
[spark-executor]=kubernetes/dockerfiles/executor/Dockerfile ) | ||
|
||
function build { | ||
docker build -t spark-base -f kubernetes/dockerfiles/spark-base/Dockerfile . | ||
for image in "${!path[@]}"; do | ||
docker build -t ${REPO}/$image:${TAG} -f ${path[$image]} . | ||
done | ||
} | ||
|
||
|
||
function push { | ||
for image in "${!path[@]}"; do | ||
docker push ${REPO}/$image:${TAG} | ||
done | ||
} | ||
|
||
function usage { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So likely not for this PR, but I'm wondering for the future what you think about the idea of extending this to package up a usable Python env so we can solve the dependency management issue as well? Really excited to see the progress :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do already do that in our fork - and when we get PySpark and R submitted (in Spark 2.4 hopefully), we will extend this script. |
||
echo "This script must be run from a runnable distribution of Apache Spark." | ||
echo "Usage: ./sbin/build-push-docker-images.sh -r <repo> -t <tag> build" | ||
echo " ./sbin/build-push-docker-images.sh -r <repo> -t <tag> push" | ||
echo "for example: ./sbin/build-push-docker-images.sh -r docker.io/myrepo -t v2.3.0 push" | ||
} | ||
|
||
if [[ "$@" = *--help ]] || [[ "$@" = *-h ]]; then | ||
usage | ||
exit 0 | ||
fi | ||
|
||
while getopts r:t: option | ||
do | ||
case "${option}" | ||
in | ||
r) REPO=${OPTARG};; | ||
t) TAG=${OPTARG};; | ||
esac | ||
done | ||
|
||
if [ -z "$REPO" ] || [ -z "$TAG" ]; then | ||
usage | ||
else | ||
case "${@: -1}" in | ||
build) build;; | ||
push) push;; | ||
*) usage;; | ||
esac | ||
fi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: add extra empty line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use k8s? I kept bringing this up and that's because I can never spell Kubernetes properly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's
k8s://
in the URL scheme we use and the package names are alsok8s
- so, users should never have to type the name.This is one of the last few holdouts. I'd say that it's consistent here, with the use of other cluster manager names in full in their maven projects. I can change it here if you feel strongly about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually second @rxin, I do get the spelling wrong at times :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you both also referring to the config options etc, which are still
spark.kubernetes.*
, or just the maven build target? If it's everything, it would be a fairly large change, doable certainly - but confirming how far the rename should go.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ping @mridulm, @rxin - can you please confirm the scope of the renaming you were referring to here? Is it just the maven target? Changing all the config options etc would be a considerably large change at this point. Also, a point that was brought up today was - while k8s is common shorthand, it's not universal as is the full name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've filed https://issues.apache.org/jira/browse/SPARK-22853 to discuss this and unblock this PR. We should be able to reach consensus by release time. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea I don't think you need to block this pr with this.