|
@ -80,6 +80,19 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" |
|
|
# ---------------------------------------------- |
|
|
# ---------------------------------------------- |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function EPHEMERAL_PORT() { |
|
|
|
|
|
LOW_BOUND=49152 |
|
|
|
|
|
RANGE=16384 |
|
|
|
|
|
while true; do |
|
|
|
|
|
CANDIDATE=$[$LOW_BOUND + ($RANDOM % $RANGE)] |
|
|
|
|
|
(echo "" >/dev/tcp/127.0.0.1/${CANDIDATE}) >/dev/null 2>&1 |
|
|
|
|
|
if [ $? -ne 0 ]; then |
|
|
|
|
|
echo $CANDIDATE |
|
|
|
|
|
break |
|
|
|
|
|
fi |
|
|
|
|
|
done |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Wdir=$(pwd) |
|
|
Wdir=$(pwd) |
|
|
|
|
|
|
|
|
if [ ! -f $Wdir/.env ]; then |
|
|
if [ ! -f $Wdir/.env ]; then |
|
@ -88,6 +101,14 @@ REGISTRY_ADDR=localhost |
|
|
REGISTRY_PORT=5000 |
|
|
REGISTRY_PORT=5000 |
|
|
IMAGE_NAME=$HYBRID_NETWORK |
|
|
IMAGE_NAME=$HYBRID_NETWORK |
|
|
SSH_PORT= |
|
|
SSH_PORT= |
|
|
|
|
|
WEB_PORT=$(EPHEMERAL_PORT) |
|
|
|
|
|
WEB_PORT1=$(EPHEMERAL_PORT) |
|
|
|
|
|
WEB_PORT2=$(EPHEMERAL_PORT) |
|
|
|
|
|
R_PORT1=$(EPHEMERAL_PORT) |
|
|
|
|
|
R_PORT2=$(EPHEMERAL_PORT) |
|
|
|
|
|
R_PORT3=$(EPHEMERAL_PORT) |
|
|
|
|
|
R_PORT4=$(EPHEMERAL_PORT) |
|
|
|
|
|
R_PORT5=$(EPHEMERAL_PORT) |
|
|
EOF |
|
|
EOF |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
@ -312,6 +333,7 @@ fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/bin/mkdir -p $Wdir/project |
|
|
/bin/mkdir -p $Wdir/project |
|
|
|
|
|
/bin/mkdir -p $Wdir/logs |
|
|
/bin/cp -f $DIR/project/mpich-3.2.tar.gz $Wdir |
|
|
/bin/cp -f $DIR/project/mpich-3.2.tar.gz $Wdir |
|
|
/bin/cp -rf $DIR/project/bin $Wdir/project |
|
|
/bin/cp -rf $DIR/project/bin $Wdir/project |
|
|
/bin/cp -rf $DIR/project/examples $Wdir/project |
|
|
/bin/cp -rf $DIR/project/examples $Wdir/project |
|
@ -321,6 +343,7 @@ fi |
|
|
/bin/cp -f $DIR/$hostnames_get $Wdir/$hostnames_get |
|
|
/bin/cp -f $DIR/$hostnames_get $Wdir/$hostnames_get |
|
|
/bin/cp -f $DIR/ROOT_PASSWORD $Wdir/ROOT_PASSWORD |
|
|
/bin/cp -f $DIR/ROOT_PASSWORD $Wdir/ROOT_PASSWORD |
|
|
/bin/cp -rf $DIR/.vimrc $Wdir/.vimrc |
|
|
/bin/cp -rf $DIR/.vimrc $Wdir/.vimrc |
|
|
|
|
|
/bin/cp -rf $DIR/bin $Wdir |
|
|
/bin/cp -rf $DIR/install-vim-plugin.sh $Wdir/install-vim-plugin.sh |
|
|
/bin/cp -rf $DIR/install-vim-plugin.sh $Wdir/install-vim-plugin.sh |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -344,11 +367,13 @@ services: |
|
|
user: root |
|
|
user: root |
|
|
entrypoint: ["sec_bootstrap", "role=master", "sec_master_service_name=master", "sec_worker_service_name=worker"] |
|
|
entrypoint: ["sec_bootstrap", "role=master", "sec_master_service_name=master", "sec_worker_service_name=worker"] |
|
|
ports: |
|
|
ports: |
|
|
|
|
|
- "\${R_PORT1}:3787" |
|
|
- "\${SSH_PORT}:22" |
|
|
- "\${SSH_PORT}:22" |
|
|
networks: |
|
|
networks: |
|
|
- ${HYBRID_NETWORK} |
|
|
- ${HYBRID_NETWORK} |
|
|
volumes: |
|
|
volumes: |
|
|
- $Wdir/project:/project |
|
|
- $Wdir/project:/project |
|
|
|
|
|
- $Wdir/bin/ttyd.x86_64:/usr/bin/ttyd |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
worker: |
|
|
worker: |
|
|