-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed7a6e7
commit 7adb61a
Showing
10 changed files
with
115 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.git | ||
|
||
# IDEs | ||
.idea/ | ||
.vscode/ | ||
*.code-workspace | ||
|
||
# build | ||
/target/ |
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,3 +1,7 @@ | ||
/target/ | ||
# IDEs | ||
.idea/ | ||
.vscode/ | ||
*.code-workspace | ||
|
||
# build | ||
/target/ |
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,53 @@ | ||
## SPDX-License-Identifier: Apache-2.0 | ||
# Stage 0 | ||
## Set up and compilation stage | ||
FROM ubuntu:18.04 AS building | ||
ENV tempPkgs='\ | ||
build-essential \ | ||
ca-certificates \ | ||
curl \ | ||
libssl-dev \ | ||
pkg-config \ | ||
file \ | ||
capnproto \ | ||
' | ||
RUN set -e; \ | ||
apt-get update -yq; \ | ||
apt-get install -yq --no-install-recommends $tempPkgs; \ | ||
# Install and set up rustup | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly-2019-09-11 --no-modify-path; | ||
WORKDIR /home | ||
ENV PATH="/root/.cargo/bin:$PATH" | ||
COPY . native_spark | ||
RUN set -e; cd native_spark; \ | ||
echo "PATH: ${PATH}"; \ | ||
# Build executables | ||
cargo build --release --examples; \ | ||
cp config_files/hosts.conf /root/; \ | ||
mkdir /home/release; \ | ||
# Copy all examples binaries | ||
find ./target/release/examples -exec file {} \; \ | ||
| grep "shared object" \ | ||
| cut -d: -f1 \ | ||
| grep -v .*- \ | ||
| xargs -I{} cp "{}" /home/release | ||
|
||
# Stage 1 | ||
## Self-contained build with only necessary utils and binaries | ||
FROM ubuntu:18.04 | ||
WORKDIR /home/release | ||
COPY --from=building /home/release . | ||
RUN set -e; \ | ||
# Install requirements | ||
apt-get update -yq; \ | ||
apt-get install -yq locales ssh capnproto; \ | ||
# Locales | ||
locale-gen en_US.UTF-8; \ | ||
# Cleanup | ||
apt-get purge -y --auto-remove $tempPkgs; \ | ||
apt-get autoremove -q -y; \ | ||
apt-get clean -yq; \ | ||
rm -rf /var/lib/apt/lists/* | ||
ENV LANG=en_US.UTF-8 \ | ||
LANGUAGE=en_US:en \ | ||
LC_ALL=en_US.UTF-8 |
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,14 @@ | ||
#!/bin/bash | ||
SCRIPT_PATH=`dirname $(readlink -f $0)` | ||
|
||
VERSION=$1 | ||
if [ -z $VERSION ] | ||
then | ||
VERSION='latest' | ||
fi | ||
PACKAGE="native_spark:${VERSION}" | ||
|
||
cd $SCRIPT_PATH && cd .. | ||
echo "work dir: $(pwd)" | ||
echo "building $PACKAGE..." | ||
docker build -t $PACKAGE -f docker/Dockerfile --force-rm . |
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,17 @@ | ||
version: '3' | ||
|
||
networks: | ||
native-spark: | ||
|
||
services: | ||
master: | ||
image: native_spark:latest | ||
deploy: | ||
restart_policy: | ||
condition: on-failure | ||
|
||
worker: | ||
image: native_spark:latest | ||
deploy: | ||
restart_policy: | ||
condition: on-failure |
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,6 @@ | ||
#!/bin/bash | ||
SCRIPT_PATH=`dirname $(readlink -f $0)` | ||
cd SCRIPT_PATH | ||
|
||
# Deploy a testing cluster with one master and 3 workers | ||
docker-compose up -d |
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