-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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-5188][BUILD] make-distribution.sh should support curl, not only wget to get Tachyon #3988
Conversation
Test build #25349 has finished for PR 3988 at commit
|
@@ -48,11 +48,11 @@ install_app() { | |||
# check if we already have the tarball | |||
# check if we have curl installed | |||
# download application | |||
[ ! -f "${local_tarball}" ] && [ -n "`which curl 2>/dev/null`" ] && \ | |||
[ ! -f "${local_tarball}" ] && [ -n "`type curl 2>/dev/null`" ] && \ |
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 are we replacing I'm guessing you want to avoid the external process call and variation of behavior across POSIX systems for which
with type
? What's the difference between the two commands?which
.
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.
FWIW, the approach recommended in this answer, which I agree with, is to use command -v
, though honestly one way or the other it doesn't seem like a big deal.
@nchammas Thanks for your advise. I modified to use |
@@ -48,11 +48,11 @@ install_app() { | |||
# check if we already have the tarball | |||
# check if we have curl installed | |||
# download application | |||
[ ! -f "${local_tarball}" ] && [ -n "`which curl 2>/dev/null`" ] && \ | |||
[ ! -f "${local_tarball}" ] && command -v curl &>/dev/null && \ |
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 &>/dev/null
, which seems a little confusing, can't we use
if [ $(command -v curl) ];
to test for the existence of curl
?
We don't have to redirect output if we do it this way, and it's much more readable. I suggest using this pattern throughout.
Test build #25824 has finished for PR 3988 at commit
|
LGTM. @sarutak Did you test this on OS X? |
Test build #25828 has finished for PR 3988 at commit
|
@@ -224,14 +224,24 @@ cp -r "$SPARK_HOME/ec2" "$DISTDIR" | |||
if [ "$SPARK_TACHYON" == "true" ]; then | |||
TACHYON_VERSION="0.5.0" | |||
TACHYON_URL="https://github.com/amplab/tachyon/releases/download/v${TACHYON_VERSION}/tachyon-${TACHYON_VERSION}-bin.tar.gz" | |||
TACHYON_TGZ="tachyon-${TACHYON_VERSION}-bin.tar.gz" |
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.
can you define this first and then use this in TACHYON_URL
also?
LGTM pending a minor comment regarding style. |
Test build #25841 has finished for PR 3988 at commit
|
Test build #25851 has finished for PR 3988 at commit
|
Test build #25990 has finished for PR 3988 at commit
|
retest this please. |
Test build #25994 has finished for PR 3988 at commit
|
retest this please. |
Test build #26001 has finished for PR 3988 at commit
|
@sarutak can you bring this up to date? |
Test build #26130 has finished for PR 3988 at commit
|
It's now up-to-date. |
Test build #26205 has finished for PR 3988 at commit
|
When we use
make-distribution.sh
with--with-tachyon
option, Tachyon will be downloaded bywget
command but some systems don't havewget
by default (MacOS X doesn't have).Other scripts like build/mvn, build/sbt support not only
wget
but alsocurl
somake-distribution.sh
should supportcurl
too.