-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: add docker file for dev and runtime
- Loading branch information
1 parent
d951854
commit 2637359
Showing
16 changed files
with
193 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM deepfabric/elasticell-dev | ||
|
||
RUN mkdir -p /apps/deepfabric | ||
|
||
COPY ./entrypoint-build.sh /apps/deepfabric | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y git \ | ||
&& chmod +x /apps/deepfabric/entrypoint-build.sh | ||
|
||
WORKDIR /apps/deepfabric | ||
ENTRYPOINT ./entrypoint-build.sh |
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,25 @@ | ||
FROM ubuntu:16.04 | ||
|
||
RUN mkdir -p /apps/deepfabric | ||
|
||
COPY ./dist/cell /apps/deepfabric | ||
COPY ./entrypoint.sh /apps/deepfabric | ||
|
||
RUN apt-get update \ | ||
&& apt-get -y install libsnappy-dev \ | ||
&& apt-get -y install zlib1g-dev \ | ||
&& apt-get -y install libbz2-dev \ | ||
&& apt-get -y install libgtest-dev \ | ||
&& apt-get -y install libjemalloc-dev | ||
|
||
RUN chmod +x /apps/deepfabric/cell \ | ||
&& chmod +x /apps/deepfabric/entrypoint.sh \ | ||
|
||
ENV ELASTICELL_HOME=/apps/deepfabric | ||
ENV ELASTICELL_EXEC=cell | ||
ENV ELASTICELL_LOG_LEVEL=INFO | ||
ENV ELASTICELL_LOG_TARGET=CONSOLE | ||
|
||
WORKDIR /apps/deepfabric | ||
|
||
ENTRYPOINT ./entrypoint.sh |
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 @@ | ||
FROM ubuntu:16.04 | ||
|
||
RUN mkdir -p /apps/deepfabric | ||
|
||
COPY ./dist/pd /apps/deepfabric | ||
COPY ./entrypoint.sh /apps/deepfabric | ||
|
||
RUN chmod +x /apps/deepfabric/pd \ | ||
&& chmod +x /apps/deepfabric/entrypoint.sh | ||
|
||
ENV ELASTICELL_HOME=/apps/deepfabric | ||
ENV ELASTICELL_EXEC=pd | ||
ENV ELASTICELL_LOG_LEVEL=INFO | ||
ENV ELASTICELL_LOG_TARGET=CONSOLE | ||
|
||
WORKDIR /apps/deepfabric | ||
|
||
ENTRYPOINT ./entrypoint.sh |
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 @@ | ||
FROM ubuntu:16.04 | ||
|
||
RUN mkdir -p /apps/deepfabric | ||
|
||
COPY ./dist/redis-proxy /apps/deepfabric | ||
COPY ./entrypoint.sh /apps/deepfabric | ||
|
||
RUN chmod +x /apps/deepfabric/pd \ | ||
&& chmod +x /apps/deepfabric/entrypoint.sh \ | ||
|
||
ENV ELASTICELL_HOME=/apps/deepfabric | ||
ENV ELASTICELL_EXEC=redis-proxy | ||
ENV ELASTICELL_LOG_LEVEL=INFO | ||
ENV ELASTICELL_LOG_TARGET=CONSOLE | ||
|
||
WORKDIR /apps/deepfabric | ||
|
||
ENTRYPOINT ./entrypoint.sh |
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,87 @@ | ||
#/bin/bash | ||
|
||
SRC=/go/src/github.com/deepfabric | ||
DIST_DIR=/apps/deepfabric/dist | ||
TARGET=$ELASTICELL_BUILD_TARGET | ||
VERSION=$ELASTICELL_BUILD_VERSION | ||
|
||
clone_all() { | ||
clone_elasticell | ||
clone_elasticell_proxy | ||
} | ||
|
||
clone_elasticell() { | ||
cd $SRC | ||
git clone https://github.com/deepfabric/elasticell.git | ||
echo "elasticell clone complete." | ||
cd $SRC/elasticell | ||
git checkout $VERSION | ||
echo "elasticell checkout to: $VERSION." | ||
} | ||
|
||
clone_elasticell_proxy() { | ||
cd $SRC | ||
git clone https://github.com/deepfabric/elasticell-proxy.git | ||
echo "elasticell-proxy clone complete." | ||
cd $SRC/elasticell-proxy | ||
git checkout $VERSION | ||
echo "elasticell-proxy checkout to: $VERSION." | ||
} | ||
|
||
build_proxy() { | ||
echo "start to build elasticell-proxy." | ||
cd $SRC/elasticell-proxy/cmd/redis | ||
go build -ldflags "-w -s" redis-proxy.go | ||
echo "complete build elasticell-proxy." | ||
chmod +x ./redis-proxy | ||
mv ./redis-proxy $DIST_DIR | ||
} | ||
|
||
build_pd() { | ||
echo "start to build pd." | ||
cd $SRC/elasticell/cmd/pd | ||
go build -ldflags "-w -s" pd.go | ||
echo "complete build pd." | ||
chmod +x ./pd | ||
mv ./pd $DIST_DIR | ||
} | ||
|
||
build_cell() { | ||
echo "start to build cell." | ||
cd $SRC/elasticell/cmd/cell | ||
go build -ldflags "-w -s" cell.go | ||
echo "complete build cell." | ||
chmod +x ./cell | ||
mv ./cell $DIST_DIR | ||
} | ||
|
||
build_all() { | ||
build_proxy | ||
build_pd | ||
build_cell | ||
} | ||
|
||
if [ "$VERSION" = "" ]; then | ||
VERSION="master" | ||
fi | ||
|
||
DIST_DIR=$DIST_DIR/$VERSION | ||
mkdir -p $DIST_DIR | ||
|
||
echo "build target: $TARGET" | ||
echo "build version: $VERSION" | ||
echo "build dist: $DIST_DIR" | ||
|
||
if [ "$TARGET" = "pd" ]; then | ||
clone_elasticell | ||
build_pd | ||
elif [ "$TARGET" = "cell" ]; then | ||
clone_elasticell | ||
build_cell | ||
elif [ "$TARGET" = "proxy" ]; then | ||
clone_all | ||
build_proxy | ||
elif [ "$TARGET" = "all" ]; then | ||
clone_all | ||
build_all | ||
fi |
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 | ||
|
||
HOME=$ELASTICELL_HOME | ||
EXEC=$HOME/$ELASTICELL_EXEC | ||
|
||
LOG_LEVEL=$ELASTICELL_LOG_LEVEL | ||
LOG_TARGET=$ELASTICELL_LOG_TARGET | ||
CFG_FILE=$HOME/cfg/cfg.json | ||
LOG_FILE=$HOME/log/$ELASTICELL_EXEC.log | ||
|
||
if [ "$LOG_TARGET" = "CONSOLE" ]; then | ||
$EXEC --cfg=$CFG_FILE --log-level=$LOG_LEVEL | ||
elif [ "$LOG_TARGET" = "FILE" ]; then | ||
$EXEC --cfg=$CFG_FILE --log-level=$LOG_LEVEL --log-file=$LOG_FILE | ||
else | ||
echo "invalid ELASTICELL_LOG_TARGET env: $LOG_TARGET" | ||
fi | ||
|
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
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