|
|
@ -43,7 +43,7 @@ IMAGE_origin="hub.swarmlab.io:5443/hybrid-nodevuejs:latest" |
|
|
|
bootstrap="sec_bootstrap" |
|
|
|
hostnames="auto_update_hosts" |
|
|
|
hostnames_get="get_hosts" |
|
|
|
NODENAME=${HYBRID_NETWORK}_master_1.${HYBRID_NETWORK}_${HYBRID_NETWORK} |
|
|
|
NODENAME=${HYBRID_NETWORK}_masterservice_1.${HYBRID_NETWORK}_${HYBRID_NETWORK} |
|
|
|
NODENETWORK=${HYBRID_NETWORK} |
|
|
|
# shellcheck disable=SC1091 |
|
|
|
#. ./.env |
|
|
@ -251,7 +251,7 @@ services: |
|
|
|
# ports: |
|
|
|
# - "${REGISTRY_PORT}:5000" |
|
|
|
|
|
|
|
master: |
|
|
|
masterservice: |
|
|
|
image: $REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME |
|
|
|
privileged: true |
|
|
|
environment: |
|
|
@ -261,7 +261,7 @@ services: |
|
|
|
cap_add: |
|
|
|
- NET_ADMIN |
|
|
|
user: root |
|
|
|
entrypoint: ["sec_bootstrap", "role=master", "sec_master_service_name=master", "sec_worker_service_name=worker"] |
|
|
|
entrypoint: ["sec_bootstrap", "role=masterservice", "sec_masterservice_service_name=masterservice", "sec_worker_service_name=workerservice"] |
|
|
|
ports: |
|
|
|
- "\${SSH_PORT}:22" |
|
|
|
networks: |
|
|
@ -270,7 +270,7 @@ services: |
|
|
|
- $Wdir/project:/home/docker/project |
|
|
|
|
|
|
|
|
|
|
|
worker: |
|
|
|
workerservice: |
|
|
|
image: $REGISTRY_ADDR:$REGISTRY_PORT/$IMAGE_NAME |
|
|
|
privileged: true |
|
|
|
environment: |
|
|
@ -280,7 +280,7 @@ services: |
|
|
|
cap_add: |
|
|
|
- NET_ADMIN |
|
|
|
user: root |
|
|
|
entrypoint: ["sec_bootstrap", "role=worker", "sec_master_service_name=master", "sec_worker_service_name=worker"] |
|
|
|
entrypoint: ["sec_bootstrap", "role=workerservice", "sec_masterservice_service_name=masterservice", "sec_worker_service_name=workerservice"] |
|
|
|
networks: |
|
|
|
- ${HYBRID_NETWORK} |
|
|
|
volumes: |
|
|
@ -389,12 +389,12 @@ SwarmLab.io" |
|
|
|
|
|
|
|
clear_all () |
|
|
|
{ |
|
|
|
$(docker stop $(docker ps -a | grep "_master_" | awk '{print $1}')) || true |
|
|
|
$(docker stop $(docker ps -a | grep "_worker_" | awk '{print $1}')) || true |
|
|
|
$(docker stop $(docker ps -a | grep "_masterservice_" | awk '{print $1}')) || true |
|
|
|
$(docker stop $(docker ps -a | grep "_workerservice_" | awk '{print $1}')) || true |
|
|
|
#$(docker stop $(docker ps -a | grep "_registry_" | awk '{print $1}')) || true # remove for microservices |
|
|
|
#docker ps -a | grep "_registry_" | awk '{print $1}' | xargs docker container rm || true # remove for microservices |
|
|
|
docker ps -a | grep "_worker_" | awk '{print $1}' | xargs docker container rm || true |
|
|
|
docker ps -a | grep "_master_" | awk '{print $1}' | xargs docker container rm || true |
|
|
|
docker ps -a | grep "_workerservice_" | awk '{print $1}' | xargs docker container rm || true |
|
|
|
docker ps -a | grep "_masterservice_" | awk '{print $1}' | xargs docker container rm || true |
|
|
|
} |
|
|
|
|
|
|
|
down_all () |
|
|
@ -459,9 +459,9 @@ up_master () |
|
|
|
{ |
|
|
|
printf "\\n\\n===> SPIN UP MASTER NODE" |
|
|
|
printf "\\n%s\\n" "$HEADER" |
|
|
|
echo "$ docker-compose up -d master" |
|
|
|
echo "$ docker-compose up -d masterservice" |
|
|
|
printf "\\n" |
|
|
|
docker-compose up -d master |
|
|
|
docker-compose up -d masterservice |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -471,7 +471,7 @@ up_workers () |
|
|
|
printf "\\n%s\\n" "$HEADER" |
|
|
|
echo "$ docker-compose up -d worker" |
|
|
|
printf "\\n" |
|
|
|
docker-compose up -d worker |
|
|
|
docker-compose up -d workerservice |
|
|
|
|
|
|
|
printf "\\n" |
|
|
|
printf "\\n%s\\n" "$HEADER" |
|
|
@ -487,9 +487,9 @@ down_master () |
|
|
|
printf "\\n\\n===> TORN DOWN MASTER NODE" |
|
|
|
printf "\\n%s\\n" "$HEADER" |
|
|
|
|
|
|
|
echo "$ docker-compose stop master && docker-compose rm -f master" |
|
|
|
echo "$ docker-compose stop masterservice && docker-compose rm -f masterservice" |
|
|
|
printf "\\n" |
|
|
|
docker-compose stop master && docker-compose rm -f master |
|
|
|
docker-compose stop masterservice && docker-compose rm -f masterservice |
|
|
|
} |
|
|
|
|
|
|
|
down_workers () |
|
|
@ -498,7 +498,7 @@ down_workers () |
|
|
|
printf "\\n%s\\n" "$HEADER" |
|
|
|
echo "$ docker-compose stop worker && docker-compose rm -f worker" |
|
|
|
printf "\\n" |
|
|
|
docker-compose stop worker && docker-compose rm -f worker |
|
|
|
docker-compose stop workerservice && docker-compose rm -f workerservice |
|
|
|
} |
|
|
|
|
|
|
|
list () |
|
|
@ -514,7 +514,7 @@ list () |
|
|
|
exec_on_mpi_master_container () |
|
|
|
{ |
|
|
|
# shellcheck disable=SC2046 |
|
|
|
docker exec -it -u $DOCKERuser $(docker-compose ps | grep 'master'| awk 'NR==1{print $1}') "$@" |
|
|
|
docker exec -it -u $DOCKERuser $(docker-compose ps | grep 'masterservice'| awk 'NR==1{print $1}') "$@" |
|
|
|
} |
|
|
|
|
|
|
|
prompt_ready () |
|
|
@ -539,15 +539,15 @@ show_instruction () |
|
|
|
echo '' |
|
|
|
|
|
|
|
echo "To run SEC programs in an interative shell:" |
|
|
|
echo " 1. Login to master node:" |
|
|
|
echo " 1. Login to masterservice node:" |
|
|
|
echo " Using Container->connect Menou:" |
|
|
|
echo " copy/paste and Run command" |
|
|
|
echo "" |
|
|
|
echo " Or using SSH with keys through exposed port:" |
|
|
|
echo " $ ssh -o \"StrictHostKeyChecking no\" -i ssh/id_rsa -p $SSH_PORT docker@localhost" |
|
|
|
echo ' where [localhost] could be changed to the host IP of master node' |
|
|
|
echo ' where [localhost] could be changed to the host IP of masterservice node' |
|
|
|
echo "" |
|
|
|
echo " 2. Execute programs inside master node, for example:" |
|
|
|
echo " 2. Execute programs inside masterservice node, for example:" |
|
|
|
echo " $ sudo su" |
|
|
|
echo " # apk update" |
|
|
|
echo " *----------------------------------------------------*" |
|
|
|