Browse Source

remove registry

master
zeus 4 years ago
parent
commit
951d0eebf9
  1. 38
      install/usr/share/swarmlab.io/sec/swarmlab-sec

38
install/usr/share/swarmlab.io/sec/swarmlab-sec

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

Loading…
Cancel
Save