-
Notifications
You must be signed in to change notification settings - Fork 9
Move docker image management and test entrypoint to Maven #31
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
Changes from all commits
1d7f36c
8c067af
71ac3e9
df00060
dcd44f4
03c5977
016505d
f2aa748
b4f2004
dc97080
f689415
81285c1
d7b44d1
0882db7
d69787b
7a4a5d4
b33e962
555a898
0105297
f67af08
f10c3b5
87f7fb6
e9035aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,11 @@ | ||
| .idea/ | ||
| spark/ | ||
| integration-test/target/ | ||
| target/ | ||
| build/*.jar | ||
| build/apache-maven* | ||
| build/scala* | ||
| build/zinc* | ||
| build/run-mvn | ||
| *.class | ||
| *.log | ||
| *.iml | ||
| *.swp |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| #!/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. | ||
| # | ||
|
|
||
| TEST_ROOT_DIR=$(git rev-parse --show-toplevel) | ||
| BRANCH="master" | ||
|
Member
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. Remove unnecessary quotes |
||
| SPARK_REPO="https://github.com/apache/spark" | ||
|
Member
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. Remove unnecessary quotes |
||
| SPARK_REPO_LOCAL_DIR="$TEST_ROOT_DIR/target/spark" | ||
| DEPLOY_MODE="minikube" | ||
| IMAGE_REPO="docker.io/kubespark" | ||
| SPARK_TGZ="N/A" | ||
| IMAGE_TAG="N/A" | ||
| SPARK_MASTER= | ||
|
|
||
| # Parse arguments | ||
| while (( "$#" )); do | ||
| case $1 in | ||
| --spark-branch) | ||
| BRANCH="$2" | ||
| shift | ||
| ;; | ||
| --spark-repo) | ||
| SPARK_REPO="$2" | ||
| shift | ||
| ;; | ||
| --image-repo) | ||
| IMAGE_REPO="$2" | ||
| shift | ||
| ;; | ||
| --image-tag) | ||
| IMAGE_TAG="$2" | ||
| shift | ||
| ;; | ||
| --deploy-mode) | ||
| DEPLOY_MODE="$2" | ||
| shift | ||
| ;; | ||
| --spark-tgz) | ||
| SPARK_TGZ="$2" | ||
| shift | ||
| ;; | ||
| *) | ||
| break | ||
| ;; | ||
| esac | ||
| shift | ||
| done | ||
|
|
||
| if [[ $SPARK_TGZ == "N/A" ]]; | ||
|
Member
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. Are you going to keep this clause, or delete it? I think it's pretty straightforward this way, so I think it'd be reasonable to keep it. |
||
| then | ||
| echo "Cloning $SPARK_REPO into $SPARK_REPO_LOCAL_DIR and checking out $BRANCH." | ||
|
|
||
| # clone spark distribution if needed. | ||
| if [ -d "$SPARK_REPO_LOCAL_DIR" ]; | ||
| then | ||
| (cd $SPARK_REPO_LOCAL_DIR && git fetch origin $branch); | ||
| else | ||
| mkdir -p $SPARK_REPO_LOCAL_DIR; | ||
| git clone -b $BRANCH --single-branch $SPARK_REPO $SPARK_REPO_LOCAL_DIR; | ||
| fi | ||
| cd $SPARK_REPO_LOCAL_DIR | ||
| git checkout -B $BRANCH origin/$branch | ||
| ./dev/make-distribution.sh --tgz -Phadoop-2.7 -Pkubernetes -DskipTests; | ||
| SPARK_TGZ=$(find $SPARK_REPO_LOCAL_DIR -name spark-*.tgz) | ||
| echo "Built Spark TGZ at $SPARK_TGZ". | ||
| cd - | ||
| fi | ||
|
|
||
| cd $TEST_ROOT_DIR | ||
|
|
||
| if [ -z $SPARK_MASTER ]; | ||
| then | ||
| build/mvn integration-test \ | ||
| -Dspark.kubernetes.test.sparkTgz=$SPARK_TGZ \ | ||
|
Contributor
Author
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. Would like to add support for arbitrary maven arguments, just couldn't quite get the shell scripting to work out yet. |
||
| -Dspark.kubernetes.test.imageTag=$IMAGE_TAG \ | ||
| -Dspark.kubernetes.test.imageRepo=$IMAGE_REPO \ | ||
| -Dspark.kubernetes.test.deployMode=$DEPLOY_MODE; | ||
| else | ||
| build/mvn integration-test \ | ||
| -Dspark.kubernetes.test.sparkTgz=$SPARK_TGZ \ | ||
| -Dspark.kubernetes.test.imageTag=$IMAGE_TAG \ | ||
| -Dspark.kubernetes.test.imageRepo=$IMAGE_REPO \ | ||
| -Dspark.kubernetes.test.deployMode=$DEPLOY_MODE \ | ||
| -Dspark.kubernetes.test.master=$SPARK_MASTER; | ||
| fi | ||
This file was deleted.
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.
Taken from https://github.com/apache/spark/blob/master/build/mvn
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.
Why do we need this? We'll need to ensure that it stays in sync with our repo? Or maybe we can get rid of it once we merge this upstream?
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.
We get rid of this when we merge into upstream, but even aside from that, this has hardly been changing in upstream and it's theoretically completely isolated from what we will use to build Spark (since the shell forks the second Maven process it's completely independent)
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.
We also have to add it here now because unlike before, now
mvnis the entrypoint into the whole system, as it's only the substep of the build reactor that clones the Spark repository down. Aside from that, we also allow for Spark TGZs to be provided to remove the usage of the Spark source code entirely. So no matter what we're going to need our own Maven here.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.
Instead of copying the content here, could you just have a much shorter script that just downloads from https://raw.githubusercontent.com/apache/spark/master/build/mvn and execs it? Something like build/mvn-getter whose content is:
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.
Hm, I think that works. Will incorporate that.
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.
Done