zeus 3 years ago
parent
commit
d4ba1bd16f
  1. 44
      default.conf
  2. 20
      install/usr/share/swarmlab.io/sec/sec_bootstrap
  3. 18
      install/usr/share/swarmlab.io/sec/swarmlab-sec

44
default.conf

@ -0,0 +1,44 @@
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/log/host.access.log main;
location / {
root /data/www;
index index.html index.htm;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /data/www;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}

20
install/usr/share/swarmlab.io/sec/sec_bootstrap

@ -46,26 +46,28 @@ case $ROLE in
# Auto update default host file in background and dumb all output
auto_update_hosts "${HOSTNAMES}" > /dev/null 2>&1 &
tail -f /dev/null
# Start ssh server
/usr/sbin/sshd -D
#/usr/sbin/sshd -D
;;
"workerservice")
# Start ssh server in background
/usr/sbin/sshd -D &
#/usr/sbin/sshd -D &
# Keep trying to connect to master node and stay there indefinitely so that master node can see
# the connected hosts that are ready for MPI work
while sleep 1
do
#while sleep 1
#do
# shellcheck disable=SC2086
ssh -T -o "StrictHostKeyChecking no" \
-i "${USER_HOME}/.ssh/id_rsa" \
${USER}@${MPI_MASTER_SERVICE_NAME} \
"tail -f /dev/null"
done
# ssh -T -o "StrictHostKeyChecking no" \
# -i "${USER_HOME}/.ssh/id_rsa" \
# ${USER}@${MPI_MASTER_SERVICE_NAME} \
tail -f /dev/null
#done
;;
*)
echo 'role argument only accepts "masterservice" or "workerservice"'

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

@ -465,9 +465,17 @@ up_master ()
printf "\\n%s\\n" "$HEADER"
echo "$ docker-compose up -d masterservice"
printf "\\n"
docker-compose rm -f
docker-compose up --build -d masterservice
# docker-compose rm -f
# docker-compose up --build -d masterservice
#docker-compose up --force-recreate -d masterservice
docker-compose rm -f -s -v
docker pull $IMAGE_NAME
docker-compose up --build --remove-orphans -d masterservice << ANSWERS
yes
yes
yes
ANSWERS
}
@ -646,7 +654,7 @@ if [ $COMMAND_UP -eq 1 ]; then
generate_ssh_keys
build_and_push_image # remove for microservices
up_master
up_workers
#up_workers
prompt_ready
show_instruction
@ -667,7 +675,7 @@ elif [ $COMMAND_SCALE -eq 1 ]; then
down_master
down_workers
up_master
up_workers
#up_workers
prompt_ready
show_instruction
@ -678,7 +686,7 @@ elif [ $COMMAND_RELOAD -eq 1 ]; then
down_workers
build_and_push_image
up_master
up_workers
#up_workers
prompt_ready
show_instruction

Loading…
Cancel
Save