Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
ARG java_image_tag=8-jre-slim

FROM openjdk:8-jre-slim
FROM openjdk:${java_image_tag}

ARG spark_uid=185

Expand Down
15 changes: 13 additions & 2 deletions resource-managers/kubernetes/integration-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ title: Spark on Kubernetes Integration Tests
# Running the Kubernetes Integration Tests

Note that the integration test framework is currently being heavily revised and
is subject to change. Note that currently the integration tests only run with Java 8.
is subject to change.

The simplest way to run the integration tests is to install and run Minikube, then run the following from this
directory:

./dev/dev-run-integration-tests.sh

To run tests with Java 11 instead of Java 8, use `--java-image-tag` to specify the base image.

./dev/dev-run-integration-tests.sh --java-image-tag 11-jre-slim

The minimum tested version of Minikube is 0.23.0. The kube-dns addon must be enabled. Minikube should
run with a minimum of 4 CPUs and 6G of memory:

Expand Down Expand Up @@ -183,7 +187,14 @@ to the wrapper scripts and using the wrapper scripts will simply set these appro
A specific image tag to use, when set assumes images with those tags are already built and available in the
specified image repository. When set to <code>N/A</code> (the default) fresh images will be built.
</td>
<td><code>N/A</code>
<td><code>N/A</code></td>
</tr>
<tr>
<td><code>spark.kubernetes.test.javaImageTag</code></td>
<td>
A specific OpenJDK base image tag to use, when set uses it instead of 8-jre-slim.
</td>
<td><code>8-jre-slim</code></td>
</tr>
<tr>
<td><code>spark.kubernetes.test.imageTagFile</code></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ DEPLOY_MODE="minikube"
IMAGE_REPO="docker.io/kubespark"
SPARK_TGZ="N/A"
IMAGE_TAG="N/A"
JAVA_IMAGE_TAG=
BASE_IMAGE_NAME=
JVM_IMAGE_NAME=
PYTHON_IMAGE_NAME=
Expand Down Expand Up @@ -52,6 +53,10 @@ while (( "$#" )); do
IMAGE_TAG="$2"
shift
;;
--java-image-tag)
JAVA_IMAGE_TAG="$2"
shift
;;
--deploy-mode)
DEPLOY_MODE="$2"
shift
Expand Down Expand Up @@ -120,6 +125,11 @@ properties=(
-Dtest.include.tags=$INCLUDE_TAGS
)

if [ -n "$JAVA_IMAGE_TAG" ];
then
properties=( ${properties[@]} -Dspark.kubernetes.test.javaImageTag=$JAVA_IMAGE_TAG )
fi

if [ -n $NAMESPACE ];
then
properties=( ${properties[@]} -Dspark.kubernetes.test.namespace=$NAMESPACE )
Expand Down
4 changes: 4 additions & 0 deletions resource-managers/kubernetes/integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<spark.kubernetes.test.sparkTgz></spark.kubernetes.test.sparkTgz>
<spark.kubernetes.test.unpackSparkDir>${project.build.directory}/spark-dist-unpacked</spark.kubernetes.test.unpackSparkDir>
<spark.kubernetes.test.imageTag>N/A</spark.kubernetes.test.imageTag>
<spark.kubernetes.test.javaImageTag>8-jre-slim</spark.kubernetes.test.javaImageTag>
<spark.kubernetes.test.imageTagFile>${project.build.directory}/imageTag.txt</spark.kubernetes.test.imageTagFile>
<spark.kubernetes.test.deployMode>minikube</spark.kubernetes.test.deployMode>
<spark.kubernetes.test.imageRepo>docker.io/kubespark</spark.kubernetes.test.imageRepo>
Expand Down Expand Up @@ -109,6 +110,9 @@
<argument>--image-tag</argument>
<argument>${spark.kubernetes.test.imageTag}</argument>

<argument>--java-image-tag</argument>
<argument>${spark.kubernetes.test.javaImageTag}</argument>

<argument>--image-tag-output-file</argument>
<argument>${spark.kubernetes.test.imageTagFile}</argument>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ IMAGE_TAG_OUTPUT_FILE="$TEST_ROOT_DIR/target/image-tag.txt"
DEPLOY_MODE="minikube"
IMAGE_REPO="docker.io/kubespark"
IMAGE_TAG="N/A"
JAVA_IMAGE_TAG="8-jre-slim"
SPARK_TGZ="N/A"

# Parse arguments
Expand All @@ -40,6 +41,10 @@ while (( "$#" )); do
IMAGE_TAG="$2"
shift
;;
--java-image-tag)
JAVA_IMAGE_TAG="$2"
shift
;;
--image-tag-output-file)
IMAGE_TAG_OUTPUT_FILE="$2"
shift
Expand Down Expand Up @@ -82,6 +87,9 @@ then
IMAGE_TAG=$(uuidgen);
cd $SPARK_INPUT_DIR

# OpenJDK base-image tag (e.g. 8-jre-slim, 11-jre-slim)
JAVA_IMAGE_TAG_BUILD_ARG="-b java_image_tag=$JAVA_IMAGE_TAG"

# Build PySpark image
LANGUAGE_BINDING_BUILD_ARGS="-p $DOCKER_FILE_BASE_PATH/bindings/python/Dockerfile"

Expand All @@ -95,7 +103,7 @@ then
case $DEPLOY_MODE in
cloud)
# Build images
$SPARK_INPUT_DIR/bin/docker-image-tool.sh -r $IMAGE_REPO -t $IMAGE_TAG $LANGUAGE_BINDING_BUILD_ARGS build
$SPARK_INPUT_DIR/bin/docker-image-tool.sh -r $IMAGE_REPO -t $IMAGE_TAG $JAVA_IMAGE_TAG_BUILD_ARG $LANGUAGE_BINDING_BUILD_ARGS build

# Push images appropriately
if [[ $IMAGE_REPO == gcr.io* ]] ;
Expand All @@ -109,13 +117,13 @@ then
docker-for-desktop)
# Only need to build as this will place it in our local Docker repo which is all
# we need for Docker for Desktop to work so no need to also push
$SPARK_INPUT_DIR/bin/docker-image-tool.sh -r $IMAGE_REPO -t $IMAGE_TAG $LANGUAGE_BINDING_BUILD_ARGS build
$SPARK_INPUT_DIR/bin/docker-image-tool.sh -r $IMAGE_REPO -t $IMAGE_TAG $JAVA_IMAGE_TAG_BUILD_ARG $LANGUAGE_BINDING_BUILD_ARGS build
;;

minikube)
# Only need to build and if we do this with the -m option for minikube we will
# build the images directly using the minikube Docker daemon so no need to push
$SPARK_INPUT_DIR/bin/docker-image-tool.sh -m -r $IMAGE_REPO -t $IMAGE_TAG $LANGUAGE_BINDING_BUILD_ARGS build
$SPARK_INPUT_DIR/bin/docker-image-tool.sh -m -r $IMAGE_REPO -t $IMAGE_TAG $JAVA_IMAGE_TAG_BUILD_ARG $LANGUAGE_BINDING_BUILD_ARGS build
;;
*)
echo "Unrecognized deploy mode $DEPLOY_MODE" && exit 1
Expand Down