forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request apache#63 from mesosphere/go-cli
Implement a Go Spark CLI
- Loading branch information
Showing
39 changed files
with
813 additions
and
1,295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,8 @@ | ||
all: env test binary | ||
all: go python-wrapper | ||
|
||
go: | ||
bin/build-go.sh | ||
python-wrapper: go | ||
bin/build-python-wrapper.sh | ||
clean: | ||
bin/clean.sh | ||
|
||
env: clean | ||
bin/env.sh | ||
|
||
test: | ||
bin/test.sh | ||
|
||
packages: | ||
bin/packages.sh | ||
|
||
binary: env | ||
pyinstaller binary/binary.spec | ||
|
||
.PHONY: binary |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
|
||
set +x | ||
|
||
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
cd "$BIN_DIR"/.. | ||
|
||
if [ -z "$GOPATH" -o -z "$(which go)" ]; then | ||
echo "Missing GOPATH environment variable or 'go' executable. Please configure a Go build environment." | ||
exit 1 | ||
fi | ||
|
||
# The name of the binary produced by Go: | ||
if [ -z "$EXE_NAME" ]; then | ||
EXE_NAME="dcos-spark" | ||
fi | ||
|
||
print_file() { | ||
# Only show 'file <filename>' if that utility is available: often missing in CI builds. | ||
if [ -n "$(which file)" ]; then | ||
file "$1" | ||
fi | ||
ls -l "$1" | ||
echo "" | ||
} | ||
|
||
# --- | ||
|
||
# go (static binaries containing the CLI itself) | ||
cd $EXE_NAME/ | ||
|
||
# this may be omitted in 1.6+, left here for compatibility with 1.5: | ||
export GO15VENDOREXPERIMENT=1 | ||
|
||
go get | ||
|
||
# available GOOS/GOARCH permutations are listed at: | ||
# https://golang.org/doc/install/source#environment | ||
|
||
# windows: | ||
GOOS=windows GOARCH=386 go build | ||
print_file "${EXE_NAME}.exe" | ||
|
||
# osx (static build): | ||
SUFFIX="-darwin" | ||
CGO_ENABLED=0 GOOS=darwin GOARCH=386 go build \ | ||
&& mv -vf "${EXE_NAME}" "${EXE_NAME}${SUFFIX}" | ||
# don't ever strip the darwin binary: results in a broken/segfaulty build | ||
print_file "${EXE_NAME}${SUFFIX}" | ||
|
||
# linux (static build): | ||
SUFFIX="-linux" | ||
CGO_ENABLED=0 GOOS=linux GOARCH=386 go build \ | ||
&& mv -vf "${EXE_NAME}" "${EXE_NAME}${SUFFIX}" | ||
case "$OSTYPE" in | ||
linux*) strip "${EXE_NAME}${SUFFIX}" | ||
esac | ||
print_file "${EXE_NAME}${SUFFIX}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set +x | ||
|
||
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
cd $BIN_DIR/../python/ | ||
|
||
print_file() { | ||
# Only show 'file <filename>' if that utility is available: often missing in CI builds. | ||
if [ -n "$(which file)" ]; then | ||
file "$1" | ||
fi | ||
ls -l "$1" | ||
echo "" | ||
} | ||
|
||
python setup.py bdist_wheel | ||
print_file dist/*.whl |
Oops, something went wrong.